From a892b40cdeb720a381995277ce0b2433f3ae4556 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 17:03:14 +0200 Subject: [PATCH] internal/ship/contract_row.go: rename DecodeContractRow to ParseContractRow --- internal/ship/contract_row.go | 2 +- internal/ship/contract_row_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/ship/contract_row.go b/internal/ship/contract_row.go index a5b785f..5449e58 100644 --- a/internal/ship/contract_row.go +++ b/internal/ship/contract_row.go @@ -14,7 +14,7 @@ type ContractRow struct { Value chain.Bytes `mapstructure:"value"` } -func DecodeContractRow(v map[string]interface{}) (*ContractRow, error) { +func ParseContractRow(v map[string]interface{}) (*ContractRow, error) { out := &ContractRow{} err := mapstructure.WeakDecode(v, out) return out, err diff --git a/internal/ship/contract_row_test.go b/internal/ship/contract_row_test.go index 6a46be6..d281732 100644 --- a/internal/ship/contract_row_test.go +++ b/internal/ship/contract_row_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestContractRow_Decode(t *testing.T) { +func TestContractRow_Parse(t *testing.T) { expected := &ship.ContractRow{ Code: chain.N("eosio"), Scope: chain.N("scope"), @@ -18,7 +18,7 @@ func TestContractRow_Decode(t *testing.T) { Value: []byte{0x01, 0x01, 0x02, 0x03}, } - actual, err := ship.DecodeContractRow(map[string]any{ + actual, err := ship.ParseContractRow(map[string]any{ "code": uint64(6138663577826885632), "scope": uint64(13990807175891517440), "table": uint64(3607749779137757184),