Skip to content

Commit

Permalink
Resolve failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zivkovicmilos committed Oct 6, 2023
1 parent 9429ff8 commit 4996702
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions backup/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}

Expand Down
Binary file added build/archive
Binary file not shown.
1 change: 0 additions & 1 deletion restore/source/standard/standard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions restore/source/standard/standard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4996702

Please sign in to comment.