1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-07-03 11:53:41 +02:00

internal/ship/contract_row.go: rename DecodeContractRow to ParseContractRow

This commit is contained in:
Henrik Hautakoski 2024-08-11 17:03:14 +02:00
parent 14a498d7d6
commit a892b40cde
2 changed files with 3 additions and 3 deletions

View file

@ -14,7 +14,7 @@ type ContractRow struct {
Value chain.Bytes `mapstructure:"value"` Value chain.Bytes `mapstructure:"value"`
} }
func DecodeContractRow(v map[string]interface{}) (*ContractRow, error) { func ParseContractRow(v map[string]interface{}) (*ContractRow, error) {
out := &ContractRow{} out := &ContractRow{}
err := mapstructure.WeakDecode(v, out) err := mapstructure.WeakDecode(v, out)
return out, err return out, err

View file

@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
func TestContractRow_Decode(t *testing.T) { func TestContractRow_Parse(t *testing.T) {
expected := &ship.ContractRow{ expected := &ship.ContractRow{
Code: chain.N("eosio"), Code: chain.N("eosio"),
Scope: chain.N("scope"), Scope: chain.N("scope"),
@ -18,7 +18,7 @@ func TestContractRow_Decode(t *testing.T) {
Value: []byte{0x01, 0x01, 0x02, 0x03}, Value: []byte{0x01, 0x01, 0x02, 0x03},
} }
actual, err := ship.DecodeContractRow(map[string]any{ actual, err := ship.ParseContractRow(map[string]any{
"code": uint64(6138663577826885632), "code": uint64(6138663577826885632),
"scope": uint64(13990807175891517440), "scope": uint64(13990807175891517440),
"table": uint64(3607749779137757184), "table": uint64(3607749779137757184),