From 436c02d581cead1f4a4578559a3bafa50421b19d Mon Sep 17 00:00:00 2001 From: ququzone Date: Tue, 27 Oct 2020 15:07:29 +0800 Subject: [PATCH] fix staking payload bug --- iotex/caller_staking.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/iotex/caller_staking.go b/iotex/caller_staking.go index d404497f..b917b07f 100644 --- a/iotex/caller_staking.go +++ b/iotex/caller_staking.go @@ -176,6 +176,24 @@ func (c *stakingBase) API() iotexapi.APIServiceClient { //Call call sendActionCaller func (c *stakingBase) Call(ctx context.Context, opts ...grpc.CallOption) (hash.Hash256, error) { + if c.payload != nil { + switch c.action.(type) { + case *iotextypes.StakeCreate: + c.action.(*iotextypes.StakeCreate).Payload = c.payload + case *iotextypes.StakeReclaim: + c.action.(*iotextypes.StakeReclaim).Payload = c.payload + case *iotextypes.StakeAddDeposit: + c.action.(*iotextypes.StakeAddDeposit).Payload = c.payload + case *iotextypes.StakeRestake: + c.action.(*iotextypes.StakeRestake).Payload = c.payload + case *iotextypes.StakeChangeCandidate: + c.action.(*iotextypes.StakeChangeCandidate).Payload = c.payload + case *iotextypes.StakeTransferOwnership: + c.action.(*iotextypes.StakeTransferOwnership).Payload = c.payload + case *iotextypes.CandidateRegister: + c.action.(*iotextypes.CandidateRegister).Payload = c.payload + } + } sc := &sendActionCaller{ account: c.account, api: c.api,