Skip to content

Commit

Permalink
fix: alternate way of getting a bytes version of Uint64 using binary.…
Browse files Browse the repository at this point in the history
…BigEndian.PutUint64()
  • Loading branch information
randomshinichi committed Jan 21, 2020
1 parent f55cd2d commit e403a29
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions transactions/tx_oracles.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package transactions

import (
gobinary "encoding/binary"
"io"
"math"
"math/big"
Expand Down Expand Up @@ -355,9 +356,9 @@ func (tx *OracleQueryTx) ID() (id string, err error) {
}
b = append(b, senderIDRaw...)

nonceRaw := new(big.Int)
nonceRaw.SetUint64(tx.AccountNonce)
nonceRawPadded := leftPadByteSlice(32, nonceRaw.Bytes())
nonceRaw2 := make([]byte, 8)
gobinary.BigEndian.PutUint64(nonceRaw2, tx.AccountNonce)
nonceRawPadded := leftPadByteSlice(32, nonceRaw2)
b = append(b, nonceRawPadded...)

oracleIDRaw, err := binary.Decode(tx.OracleID)
Expand Down

0 comments on commit e403a29

Please sign in to comment.