diff --git a/backup/backup_test.go b/backup/backup_test.go index f9175ee..7d55c90 100644 --- a/backup/backup_test.go +++ b/backup/backup_test.go @@ -3,11 +3,11 @@ package backup import ( "bufio" "context" - "encoding/json" "errors" "os" "testing" + "github.com/gnolang/gno/tm2/pkg/amino" "github.com/gnolang/gno/tm2/pkg/std" "github.com/gnolang/tx-archive/log/noop" "github.com/gnolang/tx-archive/types" @@ -144,7 +144,7 @@ func TestBackup_ExecuteBackup(t *testing.T) { var txData types.TxData // Unmarshal the JSON data into the Person struct - if err := json.Unmarshal(scanner.Bytes(), &txData); err != nil { + if err := amino.UnmarshalJSON(scanner.Bytes(), &txData); err != nil { t.Fatalf("unable to unmarshal JSON line, %v", err) } diff --git a/build/archive b/build/archive new file mode 100755 index 0000000..b196c6b Binary files /dev/null and b/build/archive differ diff --git a/restore/source/standard/standard.go b/restore/source/standard/standard.go index 8e6cfb0..019870a 100644 --- a/restore/source/standard/standard.go +++ b/restore/source/standard/standard.go @@ -45,7 +45,6 @@ func (s *Standard) Next(ctx context.Context) (*std.Tx, error) { var tx types.TxData txt := s.scanner.Text() - fmt.Println(txt) if err := amino.UnmarshalJSON([]byte(txt), &tx); err != nil { return nil, fmt.Errorf( diff --git a/restore/source/standard/standard_test.go b/restore/source/standard/standard_test.go index a0453c7..4610b6f 100644 --- a/restore/source/standard/standard_test.go +++ b/restore/source/standard/standard_test.go @@ -2,10 +2,10 @@ package standard import ( "context" - "encoding/json" "os" "testing" + "github.com/gnolang/gno/tm2/pkg/amino" "github.com/gnolang/gno/tm2/pkg/std" "github.com/gnolang/tx-archive/types" "github.com/stretchr/testify/assert" @@ -81,7 +81,7 @@ func TestSource_Standard(t *testing.T) { BlockNum: 10, } - txDataRaw, err := json.Marshal(txData) + txDataRaw, err := amino.MarshalJSON(txData) require.NoError(t, err) _, err = tempFile.Write(txDataRaw)