From cb0ae3e696a22b72e8165c1a4a83a26eeeced093 Mon Sep 17 00:00:00 2001 From: Albert Le Batteux Date: Fri, 6 Oct 2023 12:07:10 +0100 Subject: [PATCH 1/4] chore: remove print of typeinfo --- tm2/pkg/std/package.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tm2/pkg/std/package.go b/tm2/pkg/std/package.go index 76e1f9fc4ad..e3bc324321e 100644 --- a/tm2/pkg/std/package.go +++ b/tm2/pkg/std/package.go @@ -2,6 +2,8 @@ package std import ( "github.com/gnolang/gno/tm2/pkg/amino" + + _ "github.com/gnolang/gno/tm2/pkg/crypto/secp256k1" ) var Package = amino.RegisterPackage(amino.NewPackage( From 8aff57b6fc2b7c3927ef4d9db0cbd4cd1aac1514 Mon Sep 17 00:00:00 2001 From: Albert Le Batteux Date: Fri, 6 Oct 2023 12:41:18 +0100 Subject: [PATCH 2/4] chore: add package amino test --- tm2/pkg/std/package_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tm2/pkg/std/package_test.go diff --git a/tm2/pkg/std/package_test.go b/tm2/pkg/std/package_test.go new file mode 100644 index 00000000000..0a21188737b --- /dev/null +++ b/tm2/pkg/std/package_test.go @@ -0,0 +1,26 @@ +package std_test + +import ( + "testing" + + "github.com/gnolang/gno/tm2/pkg/amino" + "github.com/gnolang/gno/tm2/pkg/std" + "github.com/stretchr/testify/require" +) + +func TestAminoBaseAccount(t *testing.T) { + b := []byte(`{ + "address": "g1x90eh5ejc22548hjqznm2egyvn8ny36lqu460f", + "coins": "4200000ugnot", + "public_key": { + "@type": "/tm.PubKeySecp256k1", + "value": "AwMzujfppqEi8lozMVD8ORENUR8SIE06VLNP8FGL0aQ2" + }, + "account_number": "159", + "sequence": "33" +}`) + acc := std.BaseAccount{} + + err := amino.UnmarshalJSON(b, &acc) + require.NoError(t, err) +} From bffccbff5def54b4b7717af6ee8851bf87bf27ca Mon Sep 17 00:00:00 2001 From: Albert Le Batteux Date: Tue, 24 Oct 2023 11:49:16 -0400 Subject: [PATCH 3/4] chore: update crypto imported struct souce --- tm2/pkg/std/package.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tm2/pkg/std/package.go b/tm2/pkg/std/package.go index e3bc324321e..5580924a90b 100644 --- a/tm2/pkg/std/package.go +++ b/tm2/pkg/std/package.go @@ -4,6 +4,9 @@ import ( "github.com/gnolang/gno/tm2/pkg/amino" _ "github.com/gnolang/gno/tm2/pkg/crypto/secp256k1" + _ "github.com/gnolang/gno/tm2/pkg/crypto/ed25519" + _ "github.com/gnolang/gno/tm2/pkg/crypto/multisig" + _ "github.com/gnolang/gno/tm2/pkg/crypto/mock" ) var Package = amino.RegisterPackage(amino.NewPackage( From ac8594e22be8096d7f44cfe83952fd3ce59f27d9 Mon Sep 17 00:00:00 2001 From: albttx Date: Thu, 7 Dec 2023 12:25:40 +0000 Subject: [PATCH 4/4] chore: move import into account.go --- tm2/pkg/std/account.go | 5 +++++ tm2/pkg/std/package.go | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tm2/pkg/std/account.go b/tm2/pkg/std/account.go index 604444b4046..c70f43d22e9 100644 --- a/tm2/pkg/std/account.go +++ b/tm2/pkg/std/account.go @@ -5,6 +5,11 @@ import ( "github.com/gnolang/gno/tm2/pkg/crypto" "github.com/gnolang/gno/tm2/pkg/errors" + + _ "github.com/gnolang/gno/tm2/pkg/crypto/ed25519" + _ "github.com/gnolang/gno/tm2/pkg/crypto/mock" + _ "github.com/gnolang/gno/tm2/pkg/crypto/multisig" + _ "github.com/gnolang/gno/tm2/pkg/crypto/secp256k1" ) // Account is an interface used to store coins at a given address within state. diff --git a/tm2/pkg/std/package.go b/tm2/pkg/std/package.go index 5580924a90b..76e1f9fc4ad 100644 --- a/tm2/pkg/std/package.go +++ b/tm2/pkg/std/package.go @@ -2,11 +2,6 @@ package std import ( "github.com/gnolang/gno/tm2/pkg/amino" - - _ "github.com/gnolang/gno/tm2/pkg/crypto/secp256k1" - _ "github.com/gnolang/gno/tm2/pkg/crypto/ed25519" - _ "github.com/gnolang/gno/tm2/pkg/crypto/multisig" - _ "github.com/gnolang/gno/tm2/pkg/crypto/mock" ) var Package = amino.RegisterPackage(amino.NewPackage(