Skip to main content

TestEnvironment

Methods

new

TestEnvironment::new();

Takes no parameters.

block_number

TestEnvironment::block_number(_self);

Parameters

NameType
_selfSelf

contract_address

TestEnvironment::contract_address(_self);

Parameters

NameType
_selfSelf

impersonate

TestEnvironment::impersonate(_self, address);

Parameters

NameType
_selfSelf
addressAztecAddress

advance_block_to

TestEnvironment::advance_block_to(&mut self, block_number);

Parameters

NameType
&mut self
block_numberu32

advance_block_by

TestEnvironment::advance_block_by(_self, blocks);

Parameters

NameType
_self&mut Self
blocksu32

public

TestEnvironment::public(_self);

Parameters

NameType
_selfSelf

private

TestEnvironment::private(&mut self);

Parameters

NameType
&mut self

unkonstrained

unconstrained is a key word, so we mis-spell purposefully here, like we do with contrakt

TestEnvironment::unkonstrained(_self);

Parameters

NameType
_selfSelf

private_at

TestEnvironment::private_at(&mut self, historical_block_number);

Parameters

NameType
&mut self
historical_block_numberu32

create_account

TestEnvironment::create_account(_self);

Parameters

NameType
_selfSelf

create_account_contract

TestEnvironment::create_account_contract(&mut self, secret);

Parameters

NameType
&mut self
secretField

deploy

TestEnvironment::deploy(self, path, name);

Parameters

NameType
self
pathstr<N>
namestr<M>

deploy_self

TestEnvironment::deploy_self(self, name);

Parameters

NameType
self
namestr<M>

call_private

TestEnvironment::call_private(_self, call_interface);

Parameters

NameType
_selfSelf
call_interfaceC

call_private_void

TestEnvironment::call_private_void(_self, call_interface);

Parameters

NameType
_selfSelf
call_interfaceC

call_public

TestEnvironment::call_public(_self, call_interface);

Parameters

NameType
_selfSelf
call_interfaceC

assert_public_call_fails

TestEnvironment::assert_public_call_fails(_self, call_interface);

Parameters

NameType
_selfSelf
call_interfaceC

assert_private_call_fails

TestEnvironment::assert_private_call_fails(_self, call_interface);

Parameters

NameType
_selfSelf
call_interfaceC

add_note

/ Manually adds a note to TXE. This needs to be called if you want to work with a note in your test with the note / not having an encrypted log emitted. TXE alternative to PXE.addNote(...).

TestEnvironment::add_note(_self, note, storage_slot, contract_address);

Parameters

NameType
_selfSelf
note&mut Note
storage_slotField
contract_addressAztecAddress