Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Villaquiranm committed Nov 24, 2024
1 parent 82d9b88 commit 5e2ca66
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contribs/gnogenesis/internal/txs/txs_add_packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func execTxsAddPackages(
parsedTxs := make([]gnoland.TxWithMetadata, 0)
for _, path := range args {
// Generate transactions from the packages (recursively)
txs, err := gnoland.LoadPackagesFromDir(path, cfg.deployerMnemonic, genesisDeployFee)
txs, err := gnoland.LoadPackagesFromDir(path, cfg.deployerMnemonic, genesis.ChainID, genesisDeployFee)
if err != nil {
return fmt.Errorf("unable to load txs from directory, %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion gno.land/cmd/gnoland/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func generateGenesisFile(genesisFile string, pk crypto.PubKey, c *startCfg) erro

// Load examples folder
examplesDir := filepath.Join(c.gnoRootDir, "examples")
pkgsTxs, err := gnoland.LoadPackagesFromDir(examplesDir, deployerMnemonic, genesisDeployFee)
pkgsTxs, err := gnoland.LoadPackagesFromDir(examplesDir, deployerMnemonic, c.chainID, genesisDeployFee)
if err != nil {
return fmt.Errorf("unable to load examples folder: %w", err)
}
Expand Down
5 changes: 3 additions & 2 deletions gno.land/cmd/gnoland/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ func TestStart_Lazy(t *testing.T) {
io.SetErr(commands.WriteNopCloser(mockErr))

// Create and run the command
ctx, cancelFn := context.WithTimeout(context.Background(), 10*time.Second)
// Now lazy init takes longer as we're signing each transaction
ctx, cancelFn := context.WithTimeout(context.Background(), 100*time.Second)
defer cancelFn()

// Set up the command ctx
Expand All @@ -128,7 +129,7 @@ func TestStart_Lazy(t *testing.T) {
})

// Set up the retry ctx
retryCtx, retryCtxCancelFn := context.WithTimeout(ctx, 5*time.Second)
retryCtx, retryCtxCancelFn := context.WithTimeout(ctx, 100*time.Hour)
defer retryCtxCancelFn()

// This is a very janky way to verify the node has started.
Expand Down
4 changes: 2 additions & 2 deletions gno.land/pkg/gnoland/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func LoadGenesisTxsFile(path string, chainID string, genesisRemote string) ([]Tx

// LoadPackagesFromDir loads gno packages from a directory.
// It creates and returns a list of transactions based on these packages.
func LoadPackagesFromDir(dir string, creatorMnemonic string, fee std.Fee) ([]TxWithMetadata, error) {
func LoadPackagesFromDir(dir string, creatorMnemonic string, chainID string, fee std.Fee) ([]TxWithMetadata, error) {
// list all packages from target path
pkgs, err := gnomod.ListPkgs(dir)
if err != nil {
Expand Down Expand Up @@ -174,7 +174,7 @@ func LoadPackagesFromDir(dir string, creatorMnemonic string, fee std.Fee) ([]TxW
return nil, fmt.Errorf("unable to load package %q: %w", pkg.Dir, err)
}

txData, err := tx.GetSignBytes("dev", 0, accountSequence)
txData, err := tx.GetSignBytes(chainID, 0, accountSequence)
if err != nil {
return nil, fmt.Errorf("unable to generate mnemonic, %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/integration/testing_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func LoadDefaultPackages(t TestingTS, creatorMnemonic string, gnoroot string) []
examplesDir := filepath.Join(gnoroot, "examples")

defaultFee := std.NewFee(50000, std.MustParseCoin(ugnot.ValueString(1000000)))
txs, err := gnoland.LoadPackagesFromDir(examplesDir, creatorMnemonic, defaultFee)
txs, err := gnoland.LoadPackagesFromDir(examplesDir, creatorMnemonic, "dev", defaultFee)
require.NoError(t, err)

return txs
Expand Down

0 comments on commit 5e2ca66

Please sign in to comment.