Skip to content

Commit

Permalink
Return nil pointer on error.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeGruffins committed Aug 20, 2021
1 parent 2359e9f commit 9344f0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/asset/eth/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion server/asset/eth/eth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 9344f0a

Please sign in to comment.