diff --git a/gno.land/pkg/gnoclient/integration_test.go b/gno.land/pkg/gnoclient/integration_test.go index d3d4e0d2c52..6487544b78b 100644 --- a/gno.land/pkg/gnoclient/integration_test.go +++ b/gno.land/pkg/gnoclient/integration_test.go @@ -719,6 +719,5 @@ func loadpkgs(t *testing.T, rootdir string, paths ...string) []gnoland.TxWithMet meta, err := loader.LoadPackages(creator, defaultFee, nil) require.NoError(t, err) - return meta } diff --git a/gno.land/pkg/integration/defaultsigner.go b/gno.land/pkg/integration/defaultsigner.go new file mode 100644 index 00000000000..d4dae5b0f61 --- /dev/null +++ b/gno.land/pkg/integration/defaultsigner.go @@ -0,0 +1,32 @@ +package integration + +import ( + "github.com/gnolang/gno/gno.land/pkg/gnoland" + "github.com/gnolang/gno/tm2/pkg/crypto/keys" + "github.com/gnolang/gno/tm2/pkg/std" +) + +func SignTxs(txs []gnoland.TxWithMetadata, chainID string) error { + kb := keys.NewInMemory() + _, err := kb.CreateAccount(DefaultAccount_Name, DefaultAccount_Seed, "", "", 0, 0) + if err != nil { + return err + } + for index, tx := range txs { + bytes, err := tx.Tx.GetSignBytes(chainID, 0, 0) + if err != nil { + return err + } + signature, publicKey, err := kb.Sign(DefaultAccount_Name, "", bytes) + if err != nil { + return err + } + txs[index].Tx.Signatures = []std.Signature{ + { + PubKey: publicKey, + Signature: signature, + }, + } + } + return nil +} diff --git a/gno.land/pkg/integration/pkgloader.go b/gno.land/pkg/integration/pkgloader.go index 541e24b96eb..dffd4a540bd 100644 --- a/gno.land/pkg/integration/pkgloader.go +++ b/gno.land/pkg/integration/pkgloader.go @@ -77,6 +77,11 @@ func (pl *PkgsLoader) LoadPackages(creator bft.Address, fee std.Fee, deposit std } } + err = SignTxs(txs, "tendermint_test") + if err != nil { + return nil, fmt.Errorf("unable to sign txs: %w", err) + } + return txs, nil }