Documentation ¶
Index ¶
- Constants
- func GetBaseTransactionParamsWithFee(source txnbuild.Account, fee int64, ops ...txnbuild.Operation) txnbuild.TransactionParams
- func GetCoreMaxSupportedProtocol() uint32
- func MergeMaps(maps ...map[string]string) map[string]string
- type CaptiveConfig
- type Config
- type RPCSimulateHostFunctionResult
- type RPCSimulateTxResponse
- type Test
- func (i *Test) AdminClient() *sdk.AdminClient
- func (i *Test) AdminPort() int
- func (i *Test) AsyncSubmitTransaction(signer *keypair.Full, txParams txnbuild.TransactionParams) (proto.AsyncTransactionSubmissionResponse, error)
- func (i *Test) AsyncTxSubOpenAPISpecURL() string
- func (i *Test) AuroraIngest() *aurora.App
- func (i *Test) AuroraWeb() *aurora.App
- func (i *Test) Client() *sdk.Client
- func (i *Test) Config() Config
- func (i *Test) CoreClient() *hcnetcore.Client
- func (i *Test) CreateAccount(initialBalance string) (*keypair.Full, txnbuild.Account)
- func (i *Test) CreateAccounts(count int, initialBalance string) ([]*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) CreateSignedTransactionFromOpsWithFee(source txnbuild.Account, signers []*keypair.Full, fee int64, ...) (*txnbuild.Transaction, error)
- func (i *Test) CreateUnsignedTransaction(source txnbuild.Account, 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) GetAuroraIngestConfig() aurora.Config
- func (i *Test) GetAuroraWebConfig() aurora.Config
- func (i *Test) GetCurrentCoreLedgerSequence() (int, error)
- func (i *Test) GetEffectiveProtocolVersion() uint32
- func (i *Test) GetPassPhrase() string
- func (i *Test) LogFailedTx(txResponse proto.Transaction, auroraResult error)
- func (i *Test) Master() *keypair.Full
- func (i *Test) MasterAccount() txnbuild.Account
- func (i *Test) MasterAccountDetails() proto.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) 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) MustSubmitOperationsWithFee(source txnbuild.Account, signer *keypair.Full, fee int64, ...) proto.Transaction
- func (i *Test) MustSubmitTransaction(signer *keypair.Full, txParams txnbuild.TransactionParams) proto.Transaction
- func (i *Test) PreflightExtendExpiration(account string, ledgerKeys []xdr.LedgerKey, extendAmt uint32) (proto.Account, txnbuild.ExtendFootprintTtl, int64)
- func (i *Test) PreflightHostFunctions(sourceAccount txnbuild.Account, function txnbuild.InvokeHostFunction) (txnbuild.InvokeHostFunction, int64)
- func (i *Test) RestartAurora() error
- func (i *Test) RestoreFootprint(account string, ledgerKey xdr.LedgerKey) (proto.Account, txnbuild.RestoreFootprint, int64)
- func (i *Test) Shutdown()
- func (i *Test) StartAurora() error
- func (i *Test) StopAurora()
- func (i *Test) SubmitMultiSigOperations(source txnbuild.Account, signers []*keypair.Full, ops ...txnbuild.Operation) (proto.Transaction, error)
- func (i *Test) SubmitMultiSigOperationsWithFee(source txnbuild.Account, signers []*keypair.Full, fee int64, ...) (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) SubmitOperationsWithFee(source txnbuild.Account, signer *keypair.Full, fee int64, ...) (proto.Transaction, error)
- func (i *Test) SubmitTransaction(signer *keypair.Full, txParams txnbuild.TransactionParams) (proto.Transaction, error)
- func (i *Test) UpgradeProtocol(version uint32)
- func (i *Test) WaitForAurora()
- func (i *Test) WaitUntilLedgerEntryTTL(ledgerKey xdr.LedgerKey)
Constants ¶
const AuroraInitErrStr = "cannot initialize Aurora"
const (
StandaloneNetworkPassphrase = "Standalone Network ; February 2017"
)
Variables ¶
This section is empty.
Functions ¶
func GetCoreMaxSupportedProtocol ¶
func GetCoreMaxSupportedProtocol() uint32
Types ¶
type CaptiveConfig ¶
type CaptiveConfig struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct { ProtocolVersion uint32 EnableSorobanRPC bool SkipCoreContainerCreation bool CoreDockerImage string SorobanRPCDockerImage string // Weird naming here because bools default to false, but we want to start // Aurora by default. SkipAuroraStart bool // If you want to override the default parameters passed to Aurora, you can // set this map accordingly. All of them are passed along as --k=v, but if // you pass an empty value, the parameter will be dropped. (Note that you // should exclude the prepending `--` from keys; this is for compatibility // with the constant names in flags.go) // // You can also control the environmental variables in a similar way, but // note that CLI args take precedence over envvars, so set the corresponding // CLI arg empty. AuroraWebParameters map[string]string AuroraIngestParameters map[string]string AuroraEnvironment map[string]string }
func GetTestConfig ¶
func GetTestConfig() *Config
GetTestConfig returns the default test Config required to run NewTest.
type RPCSimulateTxResponse ¶
type RPCSimulateTxResponse struct { Error string `json:"error,omitempty"` TransactionData string `json:"transactionData"` Results []RPCSimulateHostFunctionResult `json:"results"` MinResourceFee int64 `json:"minResourceFee,string"` }
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 Aurora starts ingesting.
Skips the test if HORIZON_INTEGRATION_TESTS env variable is not set.
WARNING: This requires Docker Compose installed.
func (*Test) AdminClient ¶
func (i *Test) AdminClient() *sdk.AdminClient
AdminClient returns aurora.Client connected to started Aurora instance.
func (*Test) AsyncSubmitTransaction ¶
func (i *Test) AsyncSubmitTransaction( signer *keypair.Full, txParams txnbuild.TransactionParams, ) (proto.AsyncTransactionSubmissionResponse, error)
func (*Test) AsyncTxSubOpenAPISpecURL ¶
AsyncTxSubOpenAPISpecURL returns the URL for getting the openAPI spec yaml for async-txsub endpoint.
func (*Test) AuroraIngest ¶
func (*Test) Config ¶
Config returns the testing configuration for the current integration test run.
func (*Test) CoreClient ¶
CoreClient returns a hcnet core client connected to the Hcnet Core instance.
func (*Test) CreateAccount ¶
CreateAccount creates a new account via the master account.
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 (i *Test) CreateSignedTransaction(signers []*keypair.Full, txParams txnbuild.TransactionParams, ) (*txnbuild.Transaction, error)
func (*Test) CreateSignedTransactionFromOps ¶
func (*Test) CreateSignedTransactionFromOpsWithFee ¶
func (*Test) CreateUnsignedTransaction ¶
func (*Test) CurrentTest ¶
func (*Test) EstablishTrustline ¶
func (i *Test) EstablishTrustline( truster *keypair.Full, account txnbuild.Account, asset txnbuild.Asset, ) (proto.Transaction, error)
EstablishTrustline works on a given asset for a particular account.
func (*Test) GetAuroraIngestConfig ¶
func (*Test) GetAuroraWebConfig ¶
func (*Test) GetCurrentCoreLedgerSequence ¶
func (*Test) GetEffectiveProtocolVersion ¶
func (*Test) GetPassPhrase ¶
func (*Test) LogFailedTx ¶
func (i *Test) LogFailedTx(txResponse proto.Transaction, auroraResult 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) MetricsURL ¶
Metrics URL returns Aurora metrics URL.
func (*Test) MustCreateClaimableBalance ¶
func (i *Test) MustCreateClaimableBalance( source *keypair.Full, asset txnbuild.Asset, amount string, claimants ...txnbuild.Claimant, ) (claim proto.ClaimableBalance)
MustCreateClaimableBalance 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 ¶
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) MustSubmitOperationsWithFee ¶
func (*Test) MustSubmitTransaction ¶
func (i *Test) MustSubmitTransaction(signer *keypair.Full, txParams txnbuild.TransactionParams, ) proto.Transaction
func (*Test) PreflightExtendExpiration ¶
func (*Test) PreflightHostFunctions ¶
func (i *Test) PreflightHostFunctions( sourceAccount txnbuild.Account, function txnbuild.InvokeHostFunction, ) (txnbuild.InvokeHostFunction, int64)
func (*Test) RestartAurora ¶
func (*Test) RestoreFootprint ¶
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) StartAurora ¶
StartAurora initializes and starts the Aurora client-facing API server and the ingest server.
func (*Test) StopAurora ¶
func (i *Test) StopAurora()
StopAurora shuts down the running Aurora process
func (*Test) SubmitMultiSigOperations ¶
func (*Test) SubmitMultiSigOperationsWithFee ¶
func (*Test) SubmitMultiSigTransaction ¶
func (i *Test) SubmitMultiSigTransaction( signers []*keypair.Full, txParams txnbuild.TransactionParams, ) (proto.Transaction, error)
func (*Test) SubmitOperations ¶
func (*Test) SubmitOperationsWithFee ¶
func (*Test) SubmitTransaction ¶
func (i *Test) SubmitTransaction( signer *keypair.Full, txParams txnbuild.TransactionParams, ) (proto.Transaction, error)
func (*Test) UpgradeProtocol ¶
UpgradeProtocol arms Core with upgrade and blocks until protocol is upgraded.
func (*Test) WaitForAurora ¶
func (i *Test) WaitForAurora()