Add unit-test for ethereum utils (#1022)

This commit is contained in:
Jonathan Claudius 2022-03-29 12:24:16 -04:00 committed by GitHub
parent 33e9f4d57a
commit 5921150f93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
package ethereum
import (
"github.com/certusone/wormhole/node/pkg/vaa"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/assert"
"testing"
)
func TestPadAddress(t *testing.T) {
addr := common.HexToAddress("0x5aaeb6053f3e94c9b9a09f33669435e7ef1beaed")
expected_addr := vaa.Address{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5a, 0xae, 0xb6, 0x5, 0x3f, 0x3e, 0x94, 0xc9, 0xb9, 0xa0, 0x9f, 0x33, 0x66, 0x94, 0x35, 0xe7, 0xef, 0x1b, 0xea, 0xed}
assert.Equal(t, PadAddress(addr), expected_addr)
}