hermez-node/common/l2tx_test.go
common/l2tx_test.goRaw
1package common
2
3import (
4 "math/big"
5 "testing"
6
7 "github.com/stretchr/testify/assert"
8)
9
10func TestNewL2Tx(t *testing.T) {
11 l2Tx := &L2Tx{
12 FromIdx: 87654,
13 ToIdx: 300,
14 Amount: big.NewInt(4),
15 Nonce: 144,
16 }
17 l2Tx, err := NewL2Tx(l2Tx)
18 assert.Nil(t, err)
19 assert.Equal(t, "0x020000000156660000000090", l2Tx.TxID.String())
20}