rename to ActorWithdrawBalance
This commit is contained in:
parent
e0e0b0b62f
commit
f5a7a650e7
@ -51,7 +51,7 @@ type StorageMiner interface {
|
||||
// WithdrawBalance allows to withdraw balance from miner actor to owner address
|
||||
// Specify amount as "0" to withdraw full balance. This method returns a message CID
|
||||
// and does not wait for message execution
|
||||
WithdrawBalance(ctx context.Context, amount abi.TokenAmount) (cid.Cid, error) //perm:admin
|
||||
ActorWithdrawBalance(ctx context.Context, amount abi.TokenAmount) (cid.Cid, error) //perm:admin
|
||||
|
||||
MiningBase(context.Context) (*types.TipSet, error) //perm:read
|
||||
|
||||
|
@ -656,6 +656,8 @@ type StorageMinerStruct struct {
|
||||
|
||||
ActorSectorSize func(p0 context.Context, p1 address.Address) (abi.SectorSize, error) `perm:"read"`
|
||||
|
||||
ActorWithdrawBalance func(p0 context.Context, p1 abi.TokenAmount) (cid.Cid, error) `perm:"admin"`
|
||||
|
||||
CheckProvable func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storiface.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) `perm:"admin"`
|
||||
|
||||
ComputeDataCid func(p0 context.Context, p1 abi.UnpaddedPieceSize, p2 storiface.Data) (abi.PieceInfo, error) `perm:"admin"`
|
||||
@ -880,8 +882,6 @@ type StorageMinerStruct struct {
|
||||
|
||||
StorageTryLock func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) (bool, error) `perm:"admin"`
|
||||
|
||||
WithdrawBalance func(p0 context.Context, p1 abi.TokenAmount) (cid.Cid, error) `perm:"admin"`
|
||||
|
||||
WorkerConnect func(p0 context.Context, p1 string) error `perm:"admin"`
|
||||
|
||||
WorkerJobs func(p0 context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) `perm:"admin"`
|
||||
@ -3956,6 +3956,17 @@ func (s *StorageMinerStub) ActorSectorSize(p0 context.Context, p1 address.Addres
|
||||
return *new(abi.SectorSize), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ActorWithdrawBalance(p0 context.Context, p1 abi.TokenAmount) (cid.Cid, error) {
|
||||
if s.Internal.ActorWithdrawBalance == nil {
|
||||
return *new(cid.Cid), ErrNotSupported
|
||||
}
|
||||
return s.Internal.ActorWithdrawBalance(p0, p1)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) ActorWithdrawBalance(p0 context.Context, p1 abi.TokenAmount) (cid.Cid, error) {
|
||||
return *new(cid.Cid), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storiface.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) {
|
||||
if s.Internal.CheckProvable == nil {
|
||||
return *new(map[abi.SectorNumber]string), ErrNotSupported
|
||||
@ -5188,17 +5199,6 @@ func (s *StorageMinerStub) StorageTryLock(p0 context.Context, p1 abi.SectorID, p
|
||||
return false, ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) WithdrawBalance(p0 context.Context, p1 abi.TokenAmount) (cid.Cid, error) {
|
||||
if s.Internal.WithdrawBalance == nil {
|
||||
return *new(cid.Cid), ErrNotSupported
|
||||
}
|
||||
return s.Internal.WithdrawBalance(p0, p1)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStub) WithdrawBalance(p0 context.Context, p1 abi.TokenAmount) (cid.Cid, error) {
|
||||
return *new(cid.Cid), ErrNotSupported
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) WorkerConnect(p0 context.Context, p1 string) error {
|
||||
if s.Internal.WorkerConnect == nil {
|
||||
return ErrNotSupported
|
||||
|
Binary file not shown.
@ -243,7 +243,7 @@ var actorWithdrawCmd = &cli.Command{
|
||||
|
||||
ctx := lcli.ReqContext(cctx)
|
||||
|
||||
res, err := nodeApi.WithdrawBalance(ctx, amount)
|
||||
res, err := nodeApi.ActorWithdrawBalance(ctx, amount)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
* [ActorAddress](#ActorAddress)
|
||||
* [ActorAddressConfig](#ActorAddressConfig)
|
||||
* [ActorSectorSize](#ActorSectorSize)
|
||||
* [ActorWithdrawBalance](#ActorWithdrawBalance)
|
||||
* [Auth](#Auth)
|
||||
* [AuthNew](#AuthNew)
|
||||
* [AuthVerify](#AuthVerify)
|
||||
@ -170,8 +171,6 @@
|
||||
* [StorageReportHealth](#StorageReportHealth)
|
||||
* [StorageStat](#StorageStat)
|
||||
* [StorageTryLock](#StorageTryLock)
|
||||
* [Withdraw](#Withdraw)
|
||||
* [WithdrawBalance](#WithdrawBalance)
|
||||
* [Worker](#Worker)
|
||||
* [WorkerConnect](#WorkerConnect)
|
||||
* [WorkerJobs](#WorkerJobs)
|
||||
@ -294,6 +293,28 @@ Inputs:
|
||||
|
||||
Response: `34359738368`
|
||||
|
||||
### ActorWithdrawBalance
|
||||
WithdrawBalance allows to withdraw balance from miner actor to owner address
|
||||
Specify amount as "0" to withdraw full balance. This method returns a message CID
|
||||
and does not wait for message execution
|
||||
|
||||
|
||||
Perms: admin
|
||||
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
"0"
|
||||
]
|
||||
```
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
}
|
||||
```
|
||||
|
||||
## Auth
|
||||
|
||||
|
||||
@ -3664,31 +3685,6 @@ Inputs:
|
||||
|
||||
Response: `true`
|
||||
|
||||
## Withdraw
|
||||
|
||||
|
||||
### WithdrawBalance
|
||||
WithdrawBalance allows to withdraw balance from miner actor to owner address
|
||||
Specify amount as "0" to withdraw full balance. This method returns a message CID
|
||||
and does not wait for message execution
|
||||
|
||||
|
||||
Perms: admin
|
||||
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
"0"
|
||||
]
|
||||
```
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
|
||||
}
|
||||
```
|
||||
|
||||
## Worker
|
||||
|
||||
|
||||
|
@ -1283,7 +1283,7 @@ func (sm *StorageMinerAPI) RuntimeSubsystems(context.Context) (res api.MinerSubs
|
||||
return sm.EnabledSubsystems, nil
|
||||
}
|
||||
|
||||
func (sm *StorageMinerAPI) WithdrawBalance(ctx context.Context, amount abi.TokenAmount) (cid.Cid, error) {
|
||||
func (sm *StorageMinerAPI) ActorWithdrawBalance(ctx context.Context, amount abi.TokenAmount) (cid.Cid, error) {
|
||||
available, err := sm.Full.StateMinerAvailableBalance(ctx, sm.Miner.Address(), types.EmptyTSK)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("Error getting miner balance: %w", err)
|
||||
|
Loading…
Reference in New Issue
Block a user