You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
335 B

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