mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-04 12:03:41 +02:00
internal/ship/contract_row.go: rename DecodeContractRow to ParseContractRow
This commit is contained in:
parent
14a498d7d6
commit
a892b40cde
2 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue