Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelm41 committed Apr 7, 2024
1 parent 5edd27c commit 0c46894
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
23 changes: 12 additions & 11 deletions parser/errors_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package parser

import (
"github.com/filecoin-project/go-state-types/exitcode"
"testing"

"github.com/filecoin-project/go-state-types/exitcode"
)

func TestCheckExitCodeCommonError(t *testing.T) {
Expand All @@ -14,52 +15,52 @@ func TestCheckExitCodeCommonError(t *testing.T) {
{
name: "ErrIllegalArgument",
code: exitcode.ErrIllegalArgument,
want: "ErrIllegalArgument",
want: "ErrIllegalArgument(16)",
},
{
name: "ErrNotFound",
code: exitcode.ErrNotFound,
want: "ErrNotFound",
want: "ErrNotFound(17)",
},
{
name: "ErrForbidden",
code: exitcode.ErrForbidden,
want: "ErrForbidden",
want: "ErrForbidden(18)",
},
{
name: "ErrInsufficientFunds",
code: exitcode.ErrInsufficientFunds,
want: "ErrInsufficientFunds",
want: "ErrInsufficientFunds(19)",
},
{
name: "ErrIllegalState",
code: exitcode.ErrIllegalState,
want: "ErrIllegalState",
want: "ErrIllegalState(20)",
},
{
name: "ErrSerialization",
code: exitcode.ErrSerialization,
want: "ErrSerialization",
want: "ErrSerialization(21)",
},
{
name: "ErrUnhandledMessage",
code: exitcode.ErrUnhandledMessage,
want: "ErrUnhandledMessage",
want: "ErrUnhandledMessage(22)",
},
{
name: "ErrUnspecified",
code: exitcode.ErrUnspecified,
want: "ErrUnspecified",
want: "ErrUnspecified(23)",
},
{
name: "ErrAssertionFailed",
code: exitcode.ErrAssertionFailed,
want: "ErrAssertionFailed",
want: "ErrAssertionFailed(24)",
},
{
name: "ErrReadOnly",
code: exitcode.ErrReadOnly,
want: "ErrReadOnly",
want: "ErrReadOnly(25)",
},
}
for _, tt := range tests {
Expand Down
10 changes: 1 addition & 9 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import (

"github.com/stretchr/testify/assert"

"github.com/zondax/fil-parser/parser"

"go.uber.org/zap"

"github.com/filecoin-project/lotus/api"
Expand Down Expand Up @@ -356,13 +354,7 @@ func TestParseGenesis(t *testing.T) {
logger, err := zap.NewDevelopment()
require.NoError(t, err)
lib := getLib(t, nodeUrl)
config := &parser.FilecoinParserConfig{
ConsolidateAddressesToRobust: parser.ConsolidateAddressesToRobust{
Enable: true,
BestEffort: true,
},
}
p, err := NewFilecoinParser(lib, getCacheDataSource(t, nodeUrl), logger, config)
p, err := NewFilecoinParser(lib, getCacheDataSource(t, nodeUrl), logger)
assert.NoError(t, err)
actualTxs, _ := p.ParseGenesis(genesisBalances, genesisTipset)

Expand Down

0 comments on commit 0c46894

Please sign in to comment.