mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
Add TxCompressedData & V2 with some extra parsers for common
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"time"
|
||||
|
||||
eth "github.com/ethereum/go-ethereum/common"
|
||||
@@ -26,3 +27,10 @@ type TokenInfo struct {
|
||||
|
||||
// TokenID is the unique identifier of the token, as set in the smart contract
|
||||
type TokenID uint32 // current implementation supports up to 2^32 tokens
|
||||
|
||||
// Bytes returns a byte array of length 4 representing the TokenID
|
||||
func (t TokenID) Bytes() []byte {
|
||||
var tokenIDBytes [4]byte
|
||||
binary.LittleEndian.PutUint32(tokenIDBytes[:], uint32(t))
|
||||
return tokenIDBytes[:]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user