Skip to content

Commit

Permalink
Decimal nonce (#40)
Browse files Browse the repository at this point in the history
* decimal nonce

* update version
  • Loading branch information
patrick-ogrady authored Sep 10, 2021
1 parent 9b8396c commit 82ac2e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion service/rosetta.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package service

const (
NodeVersion = "1.5.3"
MiddlewareVersion = "0.0.10"
MiddlewareVersion = "0.0.11"
BlockchainName = "Avalanche"
)
5 changes: 3 additions & 2 deletions service/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package service
import (
"encoding/json"
"math/big"
"strconv"

"github.com/ethereum/go-ethereum/common/hexutil"
)
Expand Down Expand Up @@ -224,7 +225,7 @@ type accountMetadataWire struct {

func (m *accountMetadata) MarshalJSON() ([]byte, error) {
mw := &accountMetadataWire{
Nonce: hexutil.Uint64(m.Nonce).String(),
Nonce: strconv.FormatUint(m.Nonce, 10),
}

return json.Marshal(mw)
Expand All @@ -236,7 +237,7 @@ func (m *accountMetadata) UnmarshalJSON(data []byte) error {
return err
}

nonce, err := hexutil.DecodeUint64(mw.Nonce)
nonce, err := strconv.ParseUint(mw.Nonce, 10, 64)
if err != nil {
return err
}
Expand Down

0 comments on commit 82ac2e9

Please sign in to comment.