miner withdrawbalance API

This commit is contained in:
LexLuthr
2022-07-29 20:09:49 +05:30
parent a843c52e38
commit 4f03486011
9 changed files with 118 additions and 57 deletions
+7
View File
@@ -48,6 +48,13 @@ type StorageMiner interface {
ActorSectorSize(context.Context, address.Address) (abi.SectorSize, error) //perm:read
ActorAddressConfig(ctx context.Context) (AddressConfig, error) //perm:read
// 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
// even when StateWaitMessage() fails and reciept exit code is non-zero
// User should check for message execution manually if this method returns a
// "Timeout waiting for withdrawl message" error.
WithdrawBalance(ctx context.Context, amount abi.TokenAmount, confidence uint64) (cid.Cid, error) //perm:admin
MiningBase(context.Context) (*types.TipSet, error) //perm:read
ComputeWindowPoSt(ctx context.Context, dlIdx uint64, tsk types.TipSetKey) ([]miner.SubmitWindowedPoStParams, error) //perm:admin
+13
View File
@@ -880,6 +880,8 @@ 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, p2 uint64) (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"`
@@ -5186,6 +5188,17 @@ func (s *StorageMinerStub) StorageTryLock(p0 context.Context, p1 abi.SectorID, p
return false, ErrNotSupported
}
func (s *StorageMinerStruct) WithdrawBalance(p0 context.Context, p1 abi.TokenAmount, p2 uint64) (cid.Cid, error) {
if s.Internal.WithdrawBalance == nil {
return *new(cid.Cid), ErrNotSupported
}
return s.Internal.WithdrawBalance(p0, p1, p2)
}
func (s *StorageMinerStub) WithdrawBalance(p0 context.Context, p1 abi.TokenAmount, p2 uint64) (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