Documentation ¶
Index ¶
- Constants
- type Config
- type Test
- func (i *Test) Client() *http.Client
- func (i *Test) CreateAccounts(count int) ([]*keypair.Full, []txnbuild.Account)
- func (i *Test) CreateSignedTransaction(signers []*keypair.Full, txParams txnbuild.TransactionParams) (*txnbuild.Transaction, error)
- func (i *Test) CreateSignedTransactionFromOps(source txnbuild.Account, signers []*keypair.Full, ops ...txnbuild.Operation) (*txnbuild.Transaction, error)
- func (i *Test) CurrentTest() *testing.T
- func (i *Test) HorizonClient() *horizonclient.Client
- func (i *Test) LogFailedTx(txResponse proto.Transaction, horizonResult error)
- func (i *Test) Master() *keypair.Full
- func (i *Test) MasterAccount() txnbuild.Account
- func (i *Test) MasterAccountDetails() proto.Account
- func (i *Test) MustGetAccount(source *keypair.Full) proto.Account
- func (i *Test) MustSubmitMultiSigOperations(source txnbuild.Account, signers []*keypair.Full, ops ...txnbuild.Operation) proto.Transaction
- func (i *Test) MustSubmitMultiSigTransaction(signers []*keypair.Full, txParams txnbuild.TransactionParams) proto.Transaction
- func (i *Test) MustSubmitOperations(source txnbuild.Account, signer *keypair.Full, ops ...txnbuild.Operation) proto.Transaction
- func (i *Test) MustSubmitTransaction(signer *keypair.Full, txParams txnbuild.TransactionParams) proto.Transaction
- func (i *Test) Shutdown()
- func (i *Test) StartStarbridge(id int, config Config, ingestSequence uint32) error
- func (i *Test) StopStarbridge()
- func (i *Test) SubmitMultiSigOperations(source txnbuild.Account, signers []*keypair.Full, ops ...txnbuild.Operation) (proto.Transaction, error)
- func (i *Test) SubmitMultiSigTransaction(signers []*keypair.Full, txParams txnbuild.TransactionParams) (proto.Transaction, error)
- func (i *Test) SubmitOperations(source txnbuild.Account, signer *keypair.Full, ops ...txnbuild.Operation) (proto.Transaction, error)
- func (i *Test) SubmitTransaction(signer *keypair.Full, txParams txnbuild.TransactionParams) (proto.Transaction, error)
Constants ¶
const ( StandaloneNetworkPassphrase = "Standalone Network ; February 2017" EthereumBridgeAddress = "0x31995201773dA53F950f15278Ea1538eA37A68A1" EthereumXLMTokenAddress = "0x4Ee50847CD1278DBE87190080DD53055672755F6" EthereumRPCURL = "http://127.0.0.1:8545" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Test ¶
type Test struct {
// contains filtered or unexported fields
}
func NewIntegrationTest ¶
NewIntegrationTest starts a new environment for integration test.
WARNING: This requires Docker Compose installed.
func (*Test) CreateAccounts ¶
Creates new accounts via friendbot.
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 (i *Test) CreateSignedTransaction(signers []*keypair.Full, txParams txnbuild.TransactionParams, ) (*txnbuild.Transaction, error)
func (*Test) CreateSignedTransactionFromOps ¶
func (*Test) CurrentTest ¶
func (*Test) HorizonClient ¶
func (i *Test) HorizonClient() *horizonclient.Client
HorizonClient returns horizon.Client connected to started Horizon instance.
func (*Test) LogFailedTx ¶
func (i *Test) LogFailedTx(txResponse proto.Transaction, horizonResult error)
LogFailedTx is 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) MasterAccountDetails ¶
func (*Test) MustGetAccount ¶
MustGetAccount panics on any error retrieves an account's details from its key. This means it must have previously been funded.
func (*Test) MustSubmitMultiSigOperations ¶
func (*Test) MustSubmitMultiSigTransaction ¶
func (i *Test) MustSubmitMultiSigTransaction( signers []*keypair.Full, txParams txnbuild.TransactionParams, ) proto.Transaction
func (*Test) MustSubmitOperations ¶
func (i *Test) MustSubmitOperations( source txnbuild.Account, signer *keypair.Full, ops ...txnbuild.Operation, ) proto.Transaction
MustSubmitOperations 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) MustSubmitTransaction ¶
func (i *Test) MustSubmitTransaction(signer *keypair.Full, txParams txnbuild.TransactionParams, ) proto.Transaction
func (*Test) Shutdown ¶
func (i *Test) Shutdown()
Shutdown stops the integration tests and destroys all its associated resources. It will be implicitly called when the calling test (i.e. the `testing.Test` passed to `New()`) is finished if it hasn't been explicitly called before.
func (*Test) StartStarbridge ¶
func (*Test) StopStarbridge ¶
func (i *Test) StopStarbridge()
StopStarbridge shuts down the running starbridge processes
func (*Test) SubmitMultiSigOperations ¶
func (*Test) SubmitMultiSigTransaction ¶
func (i *Test) SubmitMultiSigTransaction( signers []*keypair.Full, txParams txnbuild.TransactionParams, ) (proto.Transaction, error)
func (*Test) SubmitOperations ¶
func (*Test) SubmitTransaction ¶
func (i *Test) SubmitTransaction( signer *keypair.Full, txParams txnbuild.TransactionParams, ) (proto.Transaction, error)