Skip to content

Latest commit

 

History

History
118 lines (77 loc) · 2.67 KB

test_contract.md

File metadata and controls

118 lines (77 loc) · 2.67 KB

aea.test_tools.test_contract

This module contains test case classes based on pytest for AEA contract testing.

BaseContractTestCase Objects

class BaseContractTestCase(ABC)

A class to test a contract.

contract

@property
def contract() -> Contract

Get the contract.

setup

@classmethod
def setup(cls, **kwargs: Any) -> None

Set up the contract test case.

finish_contract_deployment

@classmethod
@abstractmethod
def finish_contract_deployment(cls) -> str

Finish deploying contract.

Returns:

contract address

refill_from_faucet

@staticmethod
def refill_from_faucet(ledger_api: LedgerApi, faucet_api: FaucetApi,
                       address: str) -> None

Refill from faucet.

sign_send_confirm_receipt_multisig_transaction

@staticmethod
def sign_send_confirm_receipt_multisig_transaction(
        tx: JSONLike,
        ledger_api: LedgerApi,
        cryptos: List[Crypto],
        sleep_time: float = 2.0) -> JSONLike

Sign, send and confirm settlement of a transaction with multiple signatures.

Arguments:

  • tx: the transaction
  • ledger_api: the ledger api
  • cryptos: Cryptos to sign transaction with
  • sleep_time: the time to sleep between transaction submission and receipt request

Returns:

The transaction receipt

sign_send_confirm_receipt_transaction

@classmethod
def sign_send_confirm_receipt_transaction(cls,
                                          tx: JSONLike,
                                          ledger_api: LedgerApi,
                                          crypto: Crypto,
                                          sleep_time: float = 2.0) -> JSONLike

Sign, send and confirm settlement of a transaction with multiple signatures.

Arguments:

  • tx: the transaction
  • ledger_api: the ledger api
  • crypto: Crypto to sign transaction with
  • sleep_time: the time to sleep between transaction submission and receipt request

Returns:

The transaction receipt