testing

package
v0.5.1-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2022 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLogLevels = config.DefaultLogLevels //+ ";accumulate=debug"
View Source
const LogConsole = true
View Source
const TestTokenAmount = 5e5

Token multiplier

Variables

This section is empty.

Functions

func AcmeLiteAddress

func AcmeLiteAddress(pubKey []byte) *url.URL

AcmeLiteAddress creates an ACME lite address for the given key. FOR TESTING USE ONLY.

func AcmeLiteAddressStdPriv

func AcmeLiteAddressStdPriv(key ed25519.PrivateKey) *url.URL

func AcmeLiteAddressTmPriv

func AcmeLiteAddressTmPriv(key tmcrypto.PrivKey) *url.URL

func AddCredits

func AddCredits(db DB, account *url.URL, credits float64) error

func BuildTestSynthDepositGenTx

func BuildTestSynthDepositGenTx() (string, ed25519.PrivateKey, *transactions.Envelope, error)

func BuildTestTokenTxGenTx

func BuildTestTokenTxGenTx(sponsor ed25519.PrivateKey, destAddr string, amount uint64) (*transactions.Envelope, error)

func CreateADI

func CreateADI(db DB, key tmed25519.PrivKey, urlStr types.String) error

func CreateAdiWithCredits

func CreateAdiWithCredits(db DB, key tmed25519.PrivKey, urlStr types.String, credits float64) error

func CreateFakeSyntheticDepositTx

func CreateFakeSyntheticDepositTx(recipient tmed25519.PrivKey) (*transactions.Envelope, error)

func CreateKeyBook

func CreateKeyBook(db DB, urlStr types.String, pageUrls ...string) error

func CreateKeyPage

func CreateKeyPage(db DB, urlStr types.String, keys ...tmed25519.PubKey) error

func CreateLiteTokenAccount

func CreateLiteTokenAccount(db DB, key tmed25519.PrivKey, tokens float64) error

func CreateLiteTokenAccountWithCredits

func CreateLiteTokenAccountWithCredits(db DB, key tmed25519.PrivKey, tokens, credits float64) error

func CreateTestNet

func CreateTestNet(t *testing.T, numBvns, numValidators, numFollowers int) ([]string, map[string][]*accumulated.Daemon)

func CreateTokenAccount

func CreateTokenAccount(db DB, accUrl, tokenUrl string, tokens float64, lite bool) error

func CreateTokenIssuer

func CreateTokenIssuer(db DB, urlStr, symbol string, precision uint64) error

func DefaultConfig

func DefaultConfig(net config.NetworkType, node config.NodeType, netId string) *config.Config

func GenerateKey

func GenerateKey(seed ...interface{}) ed25519.PrivateKey

func GetIP

func GetIP() net.IP

func GetIPs

func GetIPs(n int) []net.IP

func MustParseUrl

func MustParseUrl(s string) *url.URL

func RunTestNet

func RunTestNet(t *testing.T, subnets []string, daemons map[string][]*accumulated.Daemon)

func SkipCI

func SkipCI(t testing.TB, reason string)

SkipCI skips a test when running in CI.

func SkipLong

func SkipLong(t testing.TB)

SkipLong skips a long test when running in -short mode.

func SkipPlatform

func SkipPlatform(t testing.TB, goos, reason string)

SkipPlatform skips a test when on a specific GOOS.

func SkipPlatformCI

func SkipPlatformCI(t testing.TB, goos, reason string)

SkipPlatformCI skips a test when running in CI on a specific GOOS.

func WriteStates

func WriteStates(db DB, chains ...state.Chain) error

Types

type DB

type DB = *database.Batch

type FakeTendermint

type FakeTendermint struct {
	// contains filtered or unexported fields
}

FakeTendermint is a test harness that facilitates testing the ABCI application without creating an actual Tendermint node.

func NewFakeTendermint

func NewFakeTendermint(app <-chan abci.Application, db *database.Database, network *config.Network, address crypto.Address, logger log.Logger, nextHeight func() int64, onError func(err error), interval time.Duration) *FakeTendermint

func (*FakeTendermint) ABCIQuery

func (c *FakeTendermint) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*ctypes.ResultABCIQuery, error)

func (*FakeTendermint) ABCIQueryWithOptions

func (c *FakeTendermint) ABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, opts rpc.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error)

func (*FakeTendermint) App

func (c *FakeTendermint) App() abci.Application

func (*FakeTendermint) BroadcastTxAsync

func (c *FakeTendermint) BroadcastTxAsync(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error)

func (*FakeTendermint) BroadcastTxSync

func (c *FakeTendermint) BroadcastTxSync(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error)

func (*FakeTendermint) CheckTx

func (c *FakeTendermint) CheckTx(ctx context.Context, tx types.Tx) (*ctypes.ResultCheckTx, error)

func (*FakeTendermint) Shutdown

func (c *FakeTendermint) Shutdown()

func (*FakeTendermint) SubmitTx

func (c *FakeTendermint) SubmitTx(ctx context.Context, tx types.Tx) *txStatus

func (*FakeTendermint) Tx

func (c *FakeTendermint) Tx(ctx context.Context, hash []byte, prove bool) (*ctypes.ResultTx, error)

type NullRouter added in v0.5.1

type NullRouter struct{}

func (NullRouter) Query added in v0.5.1

func (NullRouter) Query(ctx context.Context, subnet string, query []byte, opts client.ABCIQueryOptions) (*core.ResultABCIQuery, error)

func (NullRouter) Route added in v0.5.1

func (NullRouter) Route(account *url.URL) (string, error)

func (NullRouter) Submit added in v0.5.1

func (NullRouter) Submit(ctx context.Context, subnet string, tx []byte, pretend, async bool) (*routing.ResponseSubmit, error)

type TransactionBuilder

type TransactionBuilder struct {
	*protocol.Envelope
}

func NewTransaction

func NewTransaction() TransactionBuilder

func (TransactionBuilder) Sign

func (tb TransactionBuilder) Sign(signer func(nonce uint64, hash []byte) (protocol.Signature, error)) *protocol.Envelope

func (TransactionBuilder) SignLegacyED25519

func (tb TransactionBuilder) SignLegacyED25519(key []byte) *protocol.Envelope

func (TransactionBuilder) WithBody

func (TransactionBuilder) WithHeader

func (TransactionBuilder) WithKeyPage

func (tb TransactionBuilder) WithKeyPage(index, height uint64) TransactionBuilder

func (TransactionBuilder) WithNonce

func (tb TransactionBuilder) WithNonce(nonce uint64) TransactionBuilder

func (TransactionBuilder) WithNonceTimestamp

func (tb TransactionBuilder) WithNonceTimestamp() TransactionBuilder

func (TransactionBuilder) WithNonceVar

func (tb TransactionBuilder) WithNonceVar(nonce *uint64) TransactionBuilder

func (TransactionBuilder) WithOrigin

func (tb TransactionBuilder) WithOrigin(origin *url.URL) TransactionBuilder

func (TransactionBuilder) WithOriginStr

func (tb TransactionBuilder) WithOriginStr(origin string) TransactionBuilder

func (TransactionBuilder) WithTxnHash

func (tb TransactionBuilder) WithTxnHash(hash []byte) TransactionBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL