Documentation
¶
Index ¶
- Constants
- Variables
- func KeyTestPubAddr() (crypto.PrivKey, crypto.PubKey, crypto.Address)
- func NewSessionTestTx(t *testing.T, chainID string, msgs []std.Msg, sessionPriv crypto.PrivKey, ...) std.Tx
- func NewTestCoins() std.Coins
- func NewTestFee() std.Fee
- func NewTestTx(t *testing.T, chainID string, msgs []std.Msg, privs []crypto.PrivKey, ...) std.Tx
- func NewTestTxWithMemo(t *testing.T, chainID string, msgs []std.Msg, privs []crypto.PrivKey, ...) std.Tx
- func NewTestTxWithSignBytes(msgs []std.Msg, privs []crypto.PrivKey, fee std.Fee, signBytes []byte, ...) std.Tx
- func TestAddress(name string) crypto.Address
- func TestBech32Address(name string) crypto.Bech32Address
- type MockMsgCall
- func (msg MockMsgCall) GetPkgPath() string
- func (msg MockMsgCall) GetReceived() std.Coins
- func (msg MockMsgCall) GetSignBytes() []byte
- func (msg MockMsgCall) GetSigners() []crypto.Address
- func (msg MockMsgCall) Route() string
- func (msg MockMsgCall) SpendForSigner(signer crypto.Address) std.Coins
- func (msg MockMsgCall) Type() string
- func (msg MockMsgCall) ValidateBasic() error
- type MockMsgRun
- type MockMsgSend
- type MsgCounter
- type MsgCounter2
- type MsgNoRoute
- type TestMsg
Constants ¶
const ( RouteMsgCounter = "MsgCounter" RouteMsgCounter2 = "MsgCounter2" )
Variables ¶
var Package = amino.RegisterPackage(amino.NewPackage( "github.com/gnolang/gno/tm2/pkg/sdk/testutils", "sdk.testutils", amino.GetCallersDirname(), ).WithDependencies().WithTypes( &TestMsg{}, "TestMsg", MockMsgCall{}, "MockMsgCall", MockMsgRun{}, "MockMsgRun", MockMsgSend{}, "MockMsgSend", MsgCounter{}, MsgNoRoute{}, MsgCounter2{}, ))
Functions ¶
func NewSessionTestTx ¶
func NewSessionTestTx( t *testing.T, chainID string, msgs []std.Msg, sessionPriv crypto.PrivKey, sessionAddr crypto.Address, accNum uint64, seq uint64, fee std.Fee, ) std.Tx
NewSessionTestTx creates a tx signed by a session key with SessionAddr set.
func NewTestFee ¶
func NewTestTxWithMemo ¶
func NewTestTxWithSignBytes ¶
func TestAddress ¶
func TestBech32Address ¶
func TestBech32Address(name string) crypto.Bech32Address
Types ¶
type MockMsgCall ¶
MockMsgCall mimics vm.MsgCall for testing session AllowPaths.
func (MockMsgCall) GetPkgPath ¶
func (msg MockMsgCall) GetPkgPath() string
func (MockMsgCall) GetReceived ¶
func (msg MockMsgCall) GetReceived() std.Coins
func (MockMsgCall) GetSignBytes ¶
func (msg MockMsgCall) GetSignBytes() []byte
func (MockMsgCall) GetSigners ¶
func (msg MockMsgCall) GetSigners() []crypto.Address
func (MockMsgCall) Route ¶
func (msg MockMsgCall) Route() string
func (MockMsgCall) SpendForSigner ¶
func (msg MockMsgCall) SpendForSigner(signer crypto.Address) std.Coins
SpendForSigner implements std.SpendEstimator for the session ante pre-check.
func (MockMsgCall) Type ¶
func (msg MockMsgCall) Type() string
func (MockMsgCall) ValidateBasic ¶
func (msg MockMsgCall) ValidateBasic() error
type MockMsgRun ¶
MockMsgRun mimics vm.MsgRun for testing session allowlist behavior. Intentionally does NOT implement GetPkgPath — MsgRun has no realm path at the protocol level (the path is auto-derived from Caller), so the session AllowPaths check should treat it as path-less.
func (MockMsgRun) GetSignBytes ¶
func (msg MockMsgRun) GetSignBytes() []byte
func (MockMsgRun) GetSigners ¶
func (msg MockMsgRun) GetSigners() []crypto.Address
func (MockMsgRun) Route ¶
func (msg MockMsgRun) Route() string
func (MockMsgRun) SpendForSigner ¶
func (msg MockMsgRun) SpendForSigner(signer crypto.Address) std.Coins
SpendForSigner implements std.SpendEstimator for the session ante pre-check.
func (MockMsgRun) Type ¶
func (msg MockMsgRun) Type() string
func (MockMsgRun) ValidateBasic ¶
func (msg MockMsgRun) ValidateBasic() error
type MockMsgSend ¶
MockMsgSend mimics bank.MsgSend for testing session allowlist behavior.
func (MockMsgSend) GetSignBytes ¶
func (msg MockMsgSend) GetSignBytes() []byte
func (MockMsgSend) GetSigners ¶
func (msg MockMsgSend) GetSigners() []crypto.Address
func (MockMsgSend) Route ¶
func (msg MockMsgSend) Route() string
func (MockMsgSend) SpendForSigner ¶
func (msg MockMsgSend) SpendForSigner(signer crypto.Address) std.Coins
SpendForSigner implements std.SpendEstimator for the session ante pre-check.
func (MockMsgSend) Type ¶
func (msg MockMsgSend) Type() string
func (MockMsgSend) ValidateBasic ¶
func (msg MockMsgSend) ValidateBasic() error
type MsgCounter ¶
ValidateBasic() fails on negative counters. Otherwise it's up to the handlers
func (MsgCounter) GetSignBytes ¶
func (msg MsgCounter) GetSignBytes() []byte
func (MsgCounter) GetSigners ¶
func (msg MsgCounter) GetSigners() []crypto.Address
func (MsgCounter) Type ¶
func (msg MsgCounter) Type() string
func (MsgCounter) ValidateBasic ¶
func (msg MsgCounter) ValidateBasic() error
type MsgCounter2 ¶
type MsgCounter2 struct {
Counter int64
}
Another counter msg. Duplicate of MsgCounter
func (MsgCounter2) GetSignBytes ¶
func (msg MsgCounter2) GetSignBytes() []byte
func (MsgCounter2) GetSigners ¶
func (msg MsgCounter2) GetSigners() []crypto.Address
func (MsgCounter2) Type ¶
func (msg MsgCounter2) Type() string
func (MsgCounter2) ValidateBasic ¶
func (msg MsgCounter2) ValidateBasic() error
type MsgNoRoute ¶
type MsgNoRoute struct {
MsgCounter
}
a msg we dont know how to route
func (MsgNoRoute) Route ¶
func (tx MsgNoRoute) Route() string
type TestMsg ¶
msg type for testing