Documentation ¶
Index ¶
- Constants
- Variables
- func CreateNewTestWallet(t *testing.T, opts ...Option) string
- func CreateNewWallet(t *testing.T, mnemonic string) (account.Manager, string)
- func SetupNetworkWithWallets(t *testing.T, opts ...AlphabillNetworkOption) ([]*Wallet, *AlphabillNetwork)
- func SetupTestHomeDir(t *testing.T, dir string) string
- func TestPubKey0Hash(t *testing.T) []byte
- func TestPubKey1Hash(t *testing.T) []byte
- func VerifyStdout(t *testing.T, consoleWriter *TestConsoleWriter, expectedLines ...string)
- func VerifyStdoutEventually(t *testing.T, exec func() *TestConsoleWriter, expectedLines ...string)
- func VerifyStdoutEventuallyWithTimeout(t *testing.T, exec func() *TestConsoleWriter, waitFor time.Duration, ...)
- func VerifyStdoutNotExists(t *testing.T, consoleWriter *TestConsoleWriter, expectedLines ...string)
- type AlphabillNetwork
- type AlphabillNetworkOption
- type CmdConstructor
- type CmdExecutor
- func (c *CmdExecutor) Exec(t *testing.T, args ...string) *TestConsoleWriter
- func (c *CmdExecutor) ExecFunc(t *testing.T, args ...string) func() *TestConsoleWriter
- func (c *CmdExecutor) ExecWithError(t *testing.T, expectedError string, args ...string)
- func (c CmdExecutor) WithHome(home string) *CmdExecutor
- func (c CmdExecutor) WithPrefixArgs(prefixArgs ...string) *CmdExecutor
- type Option
- type Options
- type StdoutLogConsumer
- type SubCmdConstructor
- type TestConsoleWriter
- type Wallet
Constants ¶
View Source
const ( WalletBaseDir = "wallet" TestMnemonic = "dinosaur simple verify deliver bless ridge monkey design venue six problem lucky" TestPubKey0Hex = "03c30573dc0c7fd43fcb801289a6a96cb78c27f4ba398b89da91ece23e9a99aca3" TestPubKey1Hex = "02d36c574db299904b285aaeb57eb7b1fa145c43af90bec3c635c4174c224587b6" WaitDuration = 4 * time.Second WaitTick = 100 * time.Millisecond )
Variables ¶
View Source
var (
DefaultInitialBillID = money.NewBillID(nil, []byte{1})
)
Functions ¶
func CreateNewWallet ¶
func SetupNetworkWithWallets ¶
func SetupNetworkWithWallets(t *testing.T, opts ...AlphabillNetworkOption) ([]*Wallet, *AlphabillNetwork)
SetupNetworkWithWallets sets up the Alphabill network and creates two wallets with two keys in both of them. Starts money partition, and with given options, tokens, evm and/or orchestration partitions, with rpc servers up and running. The owner of the initial bill is set to the first key of the first wallet. Returns the created wallets and a reference to the Alphabill network.
func TestPubKey0Hash ¶ added in v0.4.0
func TestPubKey1Hash ¶ added in v0.4.0
func VerifyStdout ¶
func VerifyStdout(t *testing.T, consoleWriter *TestConsoleWriter, expectedLines ...string)
func VerifyStdoutEventually ¶
func VerifyStdoutEventually(t *testing.T, exec func() *TestConsoleWriter, expectedLines ...string)
func VerifyStdoutNotExists ¶
func VerifyStdoutNotExists(t *testing.T, consoleWriter *TestConsoleWriter, expectedLines ...string)
Types ¶
type AlphabillNetwork ¶
type AlphabillNetworkOption ¶
type AlphabillNetworkOption func(*AlphabillNetwork)
func WithEvmNode ¶
func WithEvmNode(t *testing.T) AlphabillNetworkOption
func WithOrchestrationNode ¶
func WithOrchestrationNode(t *testing.T) AlphabillNetworkOption
func WithTokensNode ¶
func WithTokensNode(t *testing.T) AlphabillNetworkOption
type CmdConstructor ¶
type CmdConstructor func(*types.BaseConfiguration) *cobra.Command
type CmdExecutor ¶
type CmdExecutor struct {
// contains filtered or unexported fields
}
func NewCmdExecutor ¶
func NewCmdExecutor(cmdConstructor CmdConstructor, prefixArgs ...string) *CmdExecutor
func NewSubCmdExecutor ¶
func NewSubCmdExecutor(cmdConstructor SubCmdConstructor, prefixArgs ...string) *CmdExecutor
func (*CmdExecutor) Exec ¶
func (c *CmdExecutor) Exec(t *testing.T, args ...string) *TestConsoleWriter
func (*CmdExecutor) ExecFunc ¶
func (c *CmdExecutor) ExecFunc(t *testing.T, args ...string) func() *TestConsoleWriter
func (*CmdExecutor) ExecWithError ¶
func (c *CmdExecutor) ExecWithError(t *testing.T, expectedError string, args ...string)
func (CmdExecutor) WithHome ¶
func (c CmdExecutor) WithHome(home string) *CmdExecutor
func (CmdExecutor) WithPrefixArgs ¶
func (c CmdExecutor) WithPrefixArgs(prefixArgs ...string) *CmdExecutor
type Option ¶ added in v0.4.0
type Option func(*Options)
func WithDefaultMnemonic ¶ added in v0.4.0
func WithDefaultMnemonic() Option
func WithNumberOfAccounts ¶ added in v0.4.0
type StdoutLogConsumer ¶
type StdoutLogConsumer struct{}
func (*StdoutLogConsumer) Accept ¶
func (lc *StdoutLogConsumer) Accept(l tc.Log)
type SubCmdConstructor ¶
type SubCmdConstructor func(*types.WalletConfig) *cobra.Command
type TestConsoleWriter ¶
type TestConsoleWriter struct {
Lines []string
}
func (*TestConsoleWriter) Print ¶
func (w *TestConsoleWriter) Print(a ...any)
func (*TestConsoleWriter) Println ¶
func (w *TestConsoleWriter) Println(a ...any)
func (*TestConsoleWriter) String ¶
func (w *TestConsoleWriter) String() string
Click to show internal directories.
Click to hide internal directories.