Documentation
¶
Index ¶
- Constants
- type Config
- type Test
- func (i *Test) AdminPort() int
- func (i *Test) Client() *sdk.Client
- func (i *Test) Close()
- func (i *Test) CloseCoreLedger() error
- func (i *Test) CloseCoreLedgersUntilSequence(seq int) error
- func (i *Test) CreateAccounts(count int, initialBalance string) ([]*keypair.Full, []txnbuild.Account)
- func (i *Test) CreateSignedTransaction(source txnbuild.Account, signers []*keypair.Full, ops ...txnbuild.Operation) (*txnbuild.Transaction, error)
- func (i *Test) CurrentTest() *testing.T
- func (i *Test) EstablishTrustline(truster *keypair.Full, account txnbuild.Account, asset txnbuild.Asset) (proto.Transaction, error)
- func (i *Test) LedgerClosed(sequence uint32) bool
- func (i *Test) LedgerIngested(sequence uint32) bool
- func (i *Test) LogFailedTx(txResponse proto.Transaction, millenniumResult error)
- func (i *Test) Master() *keypair.Full
- func (i *Test) MasterAccount() txnbuild.Account
- func (i *Test) MetricsURL() string
- func (i *Test) MustCreateClaimableBalance(source *keypair.Full, asset txnbuild.Asset, amount string, ...) (claim proto.ClaimableBalance)
- func (i *Test) MustEstablishTrustline(truster *keypair.Full, account txnbuild.Account, asset txnbuild.Asset) (resp proto.Transaction)
- func (i *Test) MustGetAccount(source *keypair.Full) proto.Account
- func (i *Test) MustSubmitOperations(source txnbuild.Account, signer *keypair.Full, ops ...txnbuild.Operation) proto.Transaction
- func (i *Test) RunMillenniumCLICommand(cmd ...string)
- func (i *Test) SubmitMultiSigOperations(source txnbuild.Account, signers []*keypair.Full, ops ...txnbuild.Operation) (proto.Transaction, error)
- func (i *Test) SubmitOperations(source txnbuild.Account, signer *keypair.Full, ops ...txnbuild.Operation) (proto.Transaction, error)
- func (i *Test) SubmitTransaction(tx *txnbuild.Transaction) (proto.Transaction, error)
- func (i *Test) SubmitTransactionXDR(txb64 string) (proto.Transaction, error)
Constants ¶
const (
NetworkPassphrase = "Standalone Network ; February 2017"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Test ¶
type Test struct {
// contains filtered or unexported fields
}
func NewTest ¶
NewTest starts a new environment for integration test at a given protocol version and blocks until Millennium starts ingesting.
Warning: this requires:
- Docker installed and all docker env variables set.
- MILLENNIUM_BIN_DIR env variable set to the directory with `millennium` binary to test.
- Millennium binary must be built for GOOS=linux and GOARCH=amd64.
Skips the test if MILLENNIUM_INTEGRATION_TESTS env variable is not set.
func (*Test) CloseCoreLedger ¶
CloseCoreLedgers will close one ledger.
func (*Test) CloseCoreLedgersUntilSequence ¶
CloseCoreLedgersUntilSequence will close ledgers until sequence. Note: because manualclose command doesn't block until ledger is actually closed, after running this method the last sequence can be higher than seq.
func (*Test) CreateAccounts ¶
func (i *Test) CreateAccounts(count int, initialBalance string) ([]*keypair.Full, []txnbuild.Account)
Creates new accounts via the master account.
It funds each account with the given balance and then queries the API to find the randomized sequence number for future operations.
Returns: The slice of created keypairs and account objects.
Note: panics on any errors, since we assume that tests cannot proceed without this method succeeding.
func (*Test) CreateSignedTransaction ¶
func (*Test) CurrentTest ¶
func (*Test) EstablishTrustline ¶
func (i *Test) EstablishTrustline( truster *keypair.Full, account txnbuild.Account, asset txnbuild.Asset, ) (proto.Transaction, error)
Establishes a trustline for a given asset for a particular account.
func (*Test) LedgerClosed ¶
LedgerClosed returns true if the ledger with a given sequence has been closed by AiBlocks-Core. Panics in case of errors. Note it's different than LedgerIngested because it checks if the ledger was closed, not necessarily ingested (ex. when rebuilding state Millennium does not ingest recent ledgers).
func (*Test) LedgerIngested ¶
LedgerIngested returns true if the ledger with a given sequence has been ingested by Millennium. Panics in case of errors.
func (*Test) LogFailedTx ¶
func (i *Test) LogFailedTx(txResponse proto.Transaction, millenniumResult error)
A convenience function to provide verbose information about a failing transaction to the test output log, if it's expected to succeed.
func (*Test) MasterAccount ¶
func (*Test) MetricsURL ¶
Metrics URL returns Millennium metrics URL.
func (*Test) MustCreateClaimableBalance ¶
func (i *Test) MustCreateClaimableBalance( source *keypair.Full, asset txnbuild.Asset, amount string, claimants ...txnbuild.Claimant, ) (claim proto.ClaimableBalance)
Panics on any error creating a claimable balance.
func (*Test) MustEstablishTrustline ¶
func (i *Test) MustEstablishTrustline( truster *keypair.Full, account txnbuild.Account, asset txnbuild.Asset, ) (resp proto.Transaction)
Panics on any error establishing a trustline.
func (*Test) MustGetAccount ¶
Panics on any error retrieves an account's details from its key. This means it must have previously been funded.
func (*Test) MustSubmitOperations ¶
func (i *Test) MustSubmitOperations( source txnbuild.Account, signer *keypair.Full, ops ...txnbuild.Operation, ) proto.Transaction
Submits a signed transaction from an account with standard options.
Namely, we set the standard fee, time bounds, etc. to "non-production" defaults that work well for tests.
Most transactions only need one signer, so see the more verbose `MustSubmitOperationsWithSigners` below for multi-sig transactions.
Note: We assume that transaction will be successful here so we panic in case of all errors. To allow failures, use `SubmitOperations`.
func (*Test) RunMillenniumCLICommand ¶
func (*Test) SubmitMultiSigOperations ¶
func (*Test) SubmitOperations ¶
func (*Test) SubmitTransaction ¶
func (i *Test) SubmitTransaction(tx *txnbuild.Transaction) (proto.Transaction, error)
func (*Test) SubmitTransactionXDR ¶
func (i *Test) SubmitTransactionXDR(txb64 string) (proto.Transaction, error)