integration_test_util

package
v0.0.0-...-23cc077 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IT_VAL_1_MNEMONIC = "" /* 141-byte string literal not displayed */

	IT_VAL_2_MNEMONIC = "" /* 162-byte string literal not displayed */

	IT_VAL_3_MNEMONIC = "" /* 148-byte string literal not displayed */

	IT_VAL_4_MNEMONIC = "" /* 160-byte string literal not displayed */

	IT_VAL_5_MNEMONIC = "" /* 149-byte string literal not displayed */
)
View Source
const (
	IT_WAL_1_ETH_ADDR = "0x89760f514DCfCCCf1E4c5eDC6Bf6041931c4c183"
	IT_WAL_1_MNEMONIC = "" /* 147-byte string literal not displayed */

	IT_WAL_2_ETH_ADDR = "0x21b661c8A270ed83D2826aD49b1E3B78F515E25C"
	IT_WAL_2_MNEMONIC = "" /* 151-byte string literal not displayed */

	IT_WAL_3_ETH_ADDR = "0x6479D25261A74B1b058778d3F69Ad7cC557341A8"
	IT_WAL_3_MNEMONIC = "" /* 155-byte string literal not displayed */

	IT_WAL_4_ETH_ADDR = "0x141B22B20ead6d6AE93B9DBBeB7b50DC3A645F41"
	IT_WAL_4_MNEMONIC = "" /* 153-byte string literal not displayed */

	IT_WAL_5_ETH_ADDR = "0x3E958191BC1AB01939DAD36e91630Ad111F60f10"
	IT_WAL_5_MNEMONIC = "" /* 163-byte string literal not displayed */
)

Variables

This section is empty.

Functions

func AcquireMultiTestSuitesLock

func AcquireMultiTestSuitesLock(t *testing.T) (releaser func())

AcquireMultiTestSuitesLock prevents multiple test suites from running at the same time. It returns a function that must be called at the end of the test suite to release the lock.

Use case: generally used when multiple test suites are running in parallel and accessing the same resources that couldn't be shared. So we need this test suite lock to prevent multiple test suites from running at the same time.

func NewTestAccount

func NewTestAccount(t *testing.T, nilAblePrivKey *ethsecp256k1.PrivKey) *itutiltypes.TestAccount

NewTestAccount creates a new test account. If the private key is not provided, a new one will be generated.

Types

type DatabaseIntegrationTestSuite

type DatabaseIntegrationTestSuite struct {
	Database *sql.DB

	Chains            itutiltypes.TestChains
	ValidatorAccounts itutiltypes.TestAccounts
	WalletAccounts    itutiltypes.TestAccounts
	// contains filtered or unexported fields
}

DatabaseIntegrationTestSuite is a helper for Database integration test.

func NewDatabaseIntegrationTestSuite

func NewDatabaseIntegrationTestSuite(
	t *testing.T, r *require.Assertions,
) *DatabaseIntegrationTestSuite

NewDatabaseIntegrationTestSuite creates a new database integration test suite with default configuration

func (*DatabaseIntegrationTestSuite) CleanupSuite

func (suite *DatabaseIntegrationTestSuite) CleanupSuite()

CleanupSuite performs some cleaning tasks upon shutting down of test suite.

func (*DatabaseIntegrationTestSuite) CountRows

func (suite *DatabaseIntegrationTestSuite) CountRows(tableName string) int

CountRows returns the number of rows of the given table. Beware of commit state while working with database transaction.

func (*DatabaseIntegrationTestSuite) CreateTransaction

func (suite *DatabaseIntegrationTestSuite) CreateTransaction() *sql.Tx

CreateTransaction begins a new database-level transaction.

func (*DatabaseIntegrationTestSuite) ReadAccountRecord

func (suite *DatabaseIntegrationTestSuite) ReadAccountRecord(chainId, bech32Address string, optionalTx *sql.Tx) itutildbtypes.AccountRecord

ReadAccountRecord reads a specific account record from `account` table in database.

func (*DatabaseIntegrationTestSuite) ReadChainInfoRecord

func (suite *DatabaseIntegrationTestSuite) ReadChainInfoRecord(chainId string, optionalTx *sql.Tx) itutildbtypes.ChainInfoRecord

ReadChainInfoRecord reads a specific chain info record from `chain_info` table in database.

func (*DatabaseIntegrationTestSuite) ReadFailedBlockRecord

func (suite *DatabaseIntegrationTestSuite) ReadFailedBlockRecord(chainId string, height int64, optionalTx *sql.Tx) itutildbtypes.FailedBlockRecord

ReadFailedBlockRecord reads a specific failed block record from `failed_block` table in database.

func (*DatabaseIntegrationTestSuite) ReadRecentAccountTransactionRecord

func (suite *DatabaseIntegrationTestSuite) ReadRecentAccountTransactionRecord(hash string, height int64, chainId string, optionalTx *sql.Tx) itutildbtypes.RecentAccountTransactionRecord

ReadRecentAccountTransactionRecord reads a specific transaction record from `recent_account_transaction` table in database.

func (*DatabaseIntegrationTestSuite) ReadReducedRefCountRecentAccountTransactionRecord

func (suite *DatabaseIntegrationTestSuite) ReadReducedRefCountRecentAccountTransactionRecord(hash string, height int64, chainId string, optionalTx *sql.Tx) itutildbtypes.ReducedRefCountRecentAccountTransactionRecord

ReadReducedRefCountRecentAccountTransactionRecord reads a specific transaction record from `reduced_ref_count_recent_account_transaction` table in database.

func (*DatabaseIntegrationTestSuite) ReadRefAccountToRecentTxRecord

func (suite *DatabaseIntegrationTestSuite) ReadRefAccountToRecentTxRecord(bech32Address, hash string, height int64, chainId string, optionalTx *sql.Tx) itutildbtypes.RefAccountToRecentTxRecord

ReadRefAccountToRecentTxRecord reads a specific ref account to recent tx record from `ref_account_to_recent_tx` table in database.

func (*DatabaseIntegrationTestSuite) ReadTransactionRecord

func (suite *DatabaseIntegrationTestSuite) ReadTransactionRecord(hash string, height int64, chainId string, optionalTx *sql.Tx) itutildbtypes.TransactionRecord

ReadTransactionRecord reads a specific transaction record from `transaction` table in database.

func (*DatabaseIntegrationTestSuite) Require

func (*DatabaseIntegrationTestSuite) T

func (*DatabaseIntegrationTestSuite) Truncate

func (suite *DatabaseIntegrationTestSuite) Truncate(tableName string)

Truncate does remove all existing records of a given table.

func (*DatabaseIntegrationTestSuite) TruncateAll

func (suite *DatabaseIntegrationTestSuite) TruncateAll()

TruncateAll does remove all existing records of all tables.

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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