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
|
// 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
|
// Specify amount as "0" to withdraw full balance. This method returns a message CID
|
||||||
// and does not wait for message execution
|
// 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
|
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"`
|
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"`
|
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"`
|
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"`
|
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"`
|
WorkerConnect func(p0 context.Context, p1 string) error `perm:"admin"`
|
||||||
|
|
||||||
WorkerJobs func(p0 context.Context) (map[uuid.UUID][]storiface.WorkerJob, 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
|
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) {
|
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 {
|
if s.Internal.CheckProvable == nil {
|
||||||
return *new(map[abi.SectorNumber]string), ErrNotSupported
|
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
|
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 {
|
func (s *StorageMinerStruct) WorkerConnect(p0 context.Context, p1 string) error {
|
||||||
if s.Internal.WorkerConnect == nil {
|
if s.Internal.WorkerConnect == nil {
|
||||||
return ErrNotSupported
|
return ErrNotSupported
|
||||||
|
Binary file not shown.
@ -243,7 +243,7 @@ var actorWithdrawCmd = &cli.Command{
|
|||||||
|
|
||||||
ctx := lcli.ReqContext(cctx)
|
ctx := lcli.ReqContext(cctx)
|
||||||
|
|
||||||
res, err := nodeApi.WithdrawBalance(ctx, amount)
|
res, err := nodeApi.ActorWithdrawBalance(ctx, amount)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
* [ActorAddress](#ActorAddress)
|
* [ActorAddress](#ActorAddress)
|
||||||
* [ActorAddressConfig](#ActorAddressConfig)
|
* [ActorAddressConfig](#ActorAddressConfig)
|
||||||
* [ActorSectorSize](#ActorSectorSize)
|
* [ActorSectorSize](#ActorSectorSize)
|
||||||
|
* [ActorWithdrawBalance](#ActorWithdrawBalance)
|
||||||
* [Auth](#Auth)
|
* [Auth](#Auth)
|
||||||
* [AuthNew](#AuthNew)
|
* [AuthNew](#AuthNew)
|
||||||
* [AuthVerify](#AuthVerify)
|
* [AuthVerify](#AuthVerify)
|
||||||
@ -170,8 +171,6 @@
|
|||||||
* [StorageReportHealth](#StorageReportHealth)
|
* [StorageReportHealth](#StorageReportHealth)
|
||||||
* [StorageStat](#StorageStat)
|
* [StorageStat](#StorageStat)
|
||||||
* [StorageTryLock](#StorageTryLock)
|
* [StorageTryLock](#StorageTryLock)
|
||||||
* [Withdraw](#Withdraw)
|
|
||||||
* [WithdrawBalance](#WithdrawBalance)
|
|
||||||
* [Worker](#Worker)
|
* [Worker](#Worker)
|
||||||
* [WorkerConnect](#WorkerConnect)
|
* [WorkerConnect](#WorkerConnect)
|
||||||
* [WorkerJobs](#WorkerJobs)
|
* [WorkerJobs](#WorkerJobs)
|
||||||
@ -294,6 +293,28 @@ Inputs:
|
|||||||
|
|
||||||
Response: `34359738368`
|
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
|
## Auth
|
||||||
|
|
||||||
|
|
||||||
@ -3664,31 +3685,6 @@ Inputs:
|
|||||||
|
|
||||||
Response: `true`
|
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
|
## Worker
|
||||||
|
|
||||||
|
|
||||||
|
@ -1283,7 +1283,7 @@ func (sm *StorageMinerAPI) RuntimeSubsystems(context.Context) (res api.MinerSubs
|
|||||||
return sm.EnabledSubsystems, nil
|
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)
|
available, err := sm.Full.StateMinerAvailableBalance(ctx, sm.Miner.Address(), types.EmptyTSK)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cid.Undef, xerrors.Errorf("Error getting miner balance: %w", err)
|
return cid.Undef, xerrors.Errorf("Error getting miner balance: %w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user