Skip to content

Commit

Permalink
rename to ActorWithdrawBalance
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr committed Aug 2, 2022
1 parent e0e0b0b commit f5a7a65
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 43 deletions.
2 changes: 1 addition & 1 deletion api/api_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
26 changes: 13 additions & 13 deletions api/proxy_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/openrpc/miner.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion cmd/lotus-miner/actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
50 changes: 23 additions & 27 deletions documentation/en/api-v0-methods-miner.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [ActorAddress](#ActorAddress)
* [ActorAddressConfig](#ActorAddressConfig)
* [ActorSectorSize](#ActorSectorSize)
* [ActorWithdrawBalance](#ActorWithdrawBalance)
* [Auth](#Auth)
* [AuthNew](#AuthNew)
* [AuthVerify](#AuthVerify)
Expand Down Expand Up @@ -170,8 +171,6 @@
* [StorageReportHealth](#StorageReportHealth)
* [StorageStat](#StorageStat)
* [StorageTryLock](#StorageTryLock)
* [Withdraw](#Withdraw)
* [WithdrawBalance](#WithdrawBalance)
* [Worker](#Worker)
* [WorkerConnect](#WorkerConnect)
* [WorkerJobs](#WorkerJobs)
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion node/impl/storminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f5a7a65

Please sign in to comment.