File tree 1 file changed +7
-4
lines changed
action/protocol/staking/ethabi/common
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -76,17 +76,20 @@ func EncodeVoteBucketListToEth(outputs abi.Arguments, buckets *iotextypes.VoteBu
76
76
if bucket .ContractAddress == "" {
77
77
// native bucket contract address is 0x0000000000000000000000000000000000000000
78
78
args [i ].ContractAddress = common.Address {}
79
- args [i ].StakedDuration = bucket .StakedDuration
80
- args [i ].CreateTime = bucket .CreateTime .Seconds
81
- args [i ].StakeStartTime = bucket .StakeStartTime .Seconds
82
- args [i ].UnstakeStartTime = bucket .UnstakeStartTime .Seconds
83
79
args [i ].EndorsementExpireBlockHeight = bucket .EndorsementExpireBlockHeight
84
80
} else {
85
81
addr , err = addrutil .IoAddrToEvmAddr (bucket .ContractAddress )
86
82
if err != nil {
87
83
return "" , err
88
84
}
89
85
args [i ].ContractAddress = addr
86
+ }
87
+ if bucket .CreateBlockHeight == 0 {
88
+ args [i ].StakedDuration = bucket .StakedDuration
89
+ args [i ].CreateTime = bucket .CreateTime .Seconds
90
+ args [i ].StakeStartTime = bucket .StakeStartTime .Seconds
91
+ args [i ].UnstakeStartTime = bucket .UnstakeStartTime .Seconds
92
+ } else {
90
93
args [i ].StakedDurationBlockNumber = bucket .StakedDurationBlockNumber
91
94
args [i ].CreateBlockHeight = bucket .CreateBlockHeight
92
95
args [i ].StakeStartBlockHeight = bucket .StakeStartBlockHeight
You can’t perform that action at this time.
0 commit comments