Action hash cmd supports putpollresult action
@@ -9,6 +9,7 @@ package action
import (
"context"
"fmt"
+ "math/big"
"strconv"
"github.com/golang/protobuf/proto"
@@ -132,7 +133,21 @@ func printActionProto(action *iotextypes.Action) (string, error) {
output += fmt.Sprintf(" amount: %s Rau\n", execution.Amount)
}
output += fmt.Sprintf(" data: %x\n", execution.Data) + ">\n"
-
+ case action.Core.GetPutPollResult() != nil:
+ putPollResult := action.Core.GetPutPollResult()
+ output += "putPollResult: <\n" +
+ fmt.Sprintf(" height: %d\n", putPollResult.Height) +
+ " candidates: <\n"
+ for _, candidate := range putPollResult.Candidates.Candidates {
+ output += " candidate: <\n" +
+ fmt.Sprintf(" address: %s\n", candidate.Address)
+ votes := big.NewInt(0).SetBytes(candidate.Votes)
+ output += fmt.Sprintf(" votes: %s\n", votes.String()) +
+ fmt.Sprintf(" rewardAdress: %s\n", candidate.RewardAddress) +
+ " >\n"
+ }
+ output += " >\n" +
+ ">\n"
}
output += fmt.Sprintf("senderPubKey: %x\n", action.SenderPubKey) +
fmt.Sprintf("signature: %x\n", action.Signature)
