diff --git a/server/asset/eth/common.go b/server/asset/eth/common.go index 6fbb57b6b9..11247dbefa 100644 --- a/server/asset/eth/common.go +++ b/server/asset/eth/common.go @@ -81,7 +81,7 @@ func (ss SwapState) String() string { func DecodeCoinID(coinID []byte) (CoinIDFlag, *common.Address, []byte, error) { var addr common.Address if len(coinID) != coinIDSize { - return 0, &addr, nil, fmt.Errorf("coin ID wrong length. expected %d, got %d", + return 0, nil, nil, fmt.Errorf("coin ID wrong length. expected %d, got %d", coinIDSize, len(coinID)) } hash := make([]byte, 32) diff --git a/server/asset/eth/eth_test.go b/server/asset/eth/eth_test.go index b5d68eef47..dd164f44c2 100644 --- a/server/asset/eth/eth_test.go +++ b/server/asset/eth/eth_test.go @@ -180,7 +180,7 @@ func TestDecodeCoinID(t *testing.T) { t.Fatalf("want flags value of %v but got %v for test %v", test.wantFlags, flags, test.name) } - if !bytes.Equal(addr[:], test.wantAddr[:]) { + if *addr != *test.wantAddr { t.Fatalf("want addr value of %v but got %v for test %v", test.wantAddr, addr, test.name) }