Skip to content

Commit

Permalink
Fixed JSON decoding of PairAccountNameBlockNum
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Vachon committed May 5, 2020
1 parent d07c6e0 commit f6651dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions p2ptypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ func (c *PairAccountNameBlockNum) UnmarshalJSON(data []byte) error {
return fmt.Errorf("expecting first element to be a string, got %T", object[0])
}

blockNum, ok := object[1].(uint32)
blockNum, ok := object[1].(float64)
if !ok {
return fmt.Errorf("expecting second element to be a uint32, got %T", object[1])
return fmt.Errorf("expecting second element to be a float64, got %T", object[1])
}

c.AccountName = AN(accountName)
c.BlockNum = blockNum
c.BlockNum = uint32(blockNum)

return nil
}
Expand Down

0 comments on commit f6651dd

Please sign in to comment.