Skip to content

Commit

Permalink
fix staking payload bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ququzone committed Oct 27, 2020
1 parent 6ffb4d3 commit 436c02d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions iotex/caller_staking.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 436c02d

Please sign in to comment.