Documentation ¶
Index ¶
- Constants
- func MustBroadcastTx(t testing.TB, env *EnvConf, tx *bnsd.Tx) *coretypes.ResultBroadcastTxCommit
- func MustSignTx(t testing.TB, env *EnvConf, tx *bnsd.Tx, pk *crypto.PrivateKey)
- func SeedAccountWithTokens(t testing.TB, env *EnvConf, dest weave.Address)
- func WaitCronTask(t testing.TB, env *EnvConf, timeout time.Duration, taskID []byte) cron.TaskResult
- func WaitCronTaskSuccess(t testing.TB, env *EnvConf, timeout time.Duration, taskID []byte)
- type EnvConf
- type StartBnsdOption
- func WithAntiSpamFee(c coin.Coin) StartBnsdOption
- func WithGovernance(votingPeriod weave.UnixDuration, electors []weave.Address) StartBnsdOption
- func WithLogger(out io.Writer) StartBnsdOption
- func WithMinFee(c coin.Coin) StartBnsdOption
- func WithMsgFee(msgPath string, fee coin.Coin) StartBnsdOption
- func WithThrottle(frequency time.Duration) StartBnsdOption
- func WithUsername(name string, token username.Token) StartBnsdOption
- type ThrottledClient
- func (t *ThrottledClient) AbciQuery(path string, data []byte) (client.AbciResponse, error)
- func (t *ThrottledClient) BroadcastTx(tx weave.Tx) client.BroadcastTxResponse
- func (t *ThrottledClient) BroadcastTxAsync(tx weave.Tx, out chan<- client.BroadcastTxResponse)
- func (t *ThrottledClient) BroadcastTxSync(tx weave.Tx, timeout time.Duration) client.BroadcastTxResponse
- func (t *ThrottledClient) Close()
- func (t *ThrottledClient) GetUser(addr weave.Address) (*client.UserResponse, error)
- func (t *ThrottledClient) GetWallet(addr weave.Address) (*client.WalletResponse, error)
- func (t *ThrottledClient) TendermintClient() rpcclient.Client
Constants ¶
const TendermintLocalAddr = "localhost:46657"
Variables ¶
This section is empty.
Functions ¶
func MustBroadcastTx ¶
MustBroadcastTx submits given transaction to the network and returns broadcast response. This function fails the test if any operation was not successful or broadcast response contain an error.
func MustSignTx ¶
MustSignTx will modify given transaction by signing it with provided private key. This function fails the test if any operation was not successful.
func SeedAccountWithTokens ¶
SeedAccountWithTokens acts as a faucet that sends tokens to the given address.
func WaitCronTask ¶ added in v0.19.0
Types ¶
type EnvConf ¶
type EnvConf struct { Alice *client.PrivateKey ChainID string AntiSpamFee coin.Coin MinFee coin.Coin Client client.Client MultiSigContract weave.Condition EscrowContract weave.Condition DistrContractAddr weave.Address Node *nm.Node Logger log.Logger RpcAddress string // contains filtered or unexported fields }
EnvConf is a work in progress collection of previously global variables. This is to be cleaned up in the following updates.
type StartBnsdOption ¶
type StartBnsdOption func(*EnvConf)
func WithAntiSpamFee ¶
func WithAntiSpamFee(c coin.Coin) StartBnsdOption
func WithGovernance ¶
func WithGovernance(votingPeriod weave.UnixDuration, electors []weave.Address) StartBnsdOption
WithGovernance sets given group of weave addresses as the electorate for the first electorate instance created. First address is used as the admin for the electorate and the governance rule.
func WithLogger ¶
func WithLogger(out io.Writer) StartBnsdOption
func WithMinFee ¶
func WithMinFee(c coin.Coin) StartBnsdOption
func WithMsgFee ¶
func WithMsgFee(msgPath string, fee coin.Coin) StartBnsdOption
func WithThrottle ¶
func WithThrottle(frequency time.Duration) StartBnsdOption
func WithUsername ¶ added in v0.18.0
func WithUsername(name string, token username.Token) StartBnsdOption
type ThrottledClient ¶
type ThrottledClient struct {
// contains filtered or unexported fields
}
ThrottleClient implements bnsd Client interface. All operations are throttled and executed at most with given frequency to avoid server throttling. Throttling is transparent for the client as all method calls are blocking.
func (*ThrottledClient) AbciQuery ¶
func (t *ThrottledClient) AbciQuery(path string, data []byte) (client.AbciResponse, error)
func (*ThrottledClient) BroadcastTx ¶
func (t *ThrottledClient) BroadcastTx(tx weave.Tx) client.BroadcastTxResponse
func (*ThrottledClient) BroadcastTxAsync ¶
func (t *ThrottledClient) BroadcastTxAsync(tx weave.Tx, out chan<- client.BroadcastTxResponse)
func (*ThrottledClient) BroadcastTxSync ¶
func (t *ThrottledClient) BroadcastTxSync(tx weave.Tx, timeout time.Duration) client.BroadcastTxResponse
func (*ThrottledClient) Close ¶
func (t *ThrottledClient) Close()
Close free resources. Closing twice will cause panic.
func (*ThrottledClient) GetUser ¶
func (t *ThrottledClient) GetUser(addr weave.Address) (*client.UserResponse, error)
func (*ThrottledClient) GetWallet ¶
func (t *ThrottledClient) GetWallet(addr weave.Address) (*client.WalletResponse, error)
func (*ThrottledClient) TendermintClient ¶
func (t *ThrottledClient) TendermintClient() rpcclient.Client