status-go/services/wallet/thirdparty/fourbyte/client_test.go

32 lines
1.4 KiB
Go
Raw Normal View History

2023-05-25 13:12:54 +00:00
package fourbyte
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestRun(t *testing.T) {
client := NewClient()
res, err := client.Run("0x40e8d703000000000000000000000000670dca62b3418bddd08cbc69cb4490a5a3382a9f0000000000000000000000000000000000000000000000000000000000000064")
require.Nil(t, err)
require.Equal(t, res.Signature, "processDepositQueue(address,uint256)")
require.Equal(t, res.Name, "processDepositQueue")
2023-06-06 11:35:51 +00:00
require.Equal(t, res.ID, "0xf94d2")
2023-05-25 13:12:54 +00:00
require.Equal(t, res.Inputs, map[string]string{
"0": "0x3030303030303030303030303637306463613632",
"1": "44417128579249187980157595307322491418158007948522794164811090501355597543782",
})
2023-06-19 10:04:29 +00:00
res, err = client.Run("0xb88d4fde000000000000000000000000af1857535160973f42c34cb20f5ed7cd29099ad9000000000000000000000000baa4b7858c3277da9cb9cdadf405f2017afea19a00000000000000000000000000000000000000000000000000000000000000cb00000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000360c6ebe")
require.Nil(t, err)
require.Equal(t, res.Signature, "safeTransferFrom(address,address,uint256,bytes)")
require.Equal(t, res.Name, "safeTransferFrom")
require.Equal(t, res.ID, "0x73e0")
require.Equal(t, res.Inputs, map[string]string{
"0": "0x3030303030303030303030306166313835373533",
"1": "0x3463623230663565643763643239303939616439",
"2": "21796157974083048550319244236929488537086114760591164995666220774418197985333",
})
2023-05-25 13:12:54 +00:00
}