Struct mashina::mashina::Machine [−][src]
An vapory-like state mashina.
Implementations
impl Machine
[src]
pub fn regular(
params: CommonParams,
builtins: BTreeMap<Address, Builtin>
) -> Machine
[src]
params: CommonParams,
builtins: BTreeMap<Address, Builtin>
) -> Machine
Regular vapory mashina.
pub fn with_vapash_extensions(
params: CommonParams,
builtins: BTreeMap<Address, Builtin>,
extensions: VapashExtensions
) -> Machine
[src]
params: CommonParams,
builtins: BTreeMap<Address, Builtin>,
extensions: VapashExtensions
) -> Machine
Vapory mashina with vapash extensions.
pub fn set_schedule_creation_rules(&mut self, rules: Box<ScheduleCreationRules>)
[src]
Attach special rules to the creation of schedule.
pub fn vapash_extensions(&self) -> Option<&VapashExtensions>
[src]
Get a reference to the vapash-specific extensions.
pub fn execute_as_system(
&self,
block: &mut ExecutedBlock,
contract_address: Address,
gas: U256,
data: Option<Vec<u8>>
) -> Result<Vec<u8>, Error>
[src]
&self,
block: &mut ExecutedBlock,
contract_address: Address,
gas: U256,
data: Option<Vec<u8>>
) -> Result<Vec<u8>, Error>
Execute a call as the system address. Block environment information passed to the VM is modified to have its gas limit bounded at the upper limit of possible used gas, including this system call, capped at the maximum value able to be represented by U256. This system call modifies the block state, but discards other information. If suicides, logs or refunds happen within the system call, they will not be executed or recorded. Gas used by this system call will not be counted on the block.
pub fn execute_code_as_system(
&self,
block: &mut ExecutedBlock,
contract_address: Option<Address>,
code: Option<Arc<Vec<u8>>>,
code_hash: Option<H256>,
value: Option<ActionValue>,
gas: U256,
data: Option<Vec<u8>>,
action_type: Option<ActionType>
) -> Result<Vec<u8>, Error>
[src]
&self,
block: &mut ExecutedBlock,
contract_address: Option<Address>,
code: Option<Arc<Vec<u8>>>,
code_hash: Option<H256>,
value: Option<ActionValue>,
gas: U256,
data: Option<Vec<u8>>,
action_type: Option<ActionType>
) -> Result<Vec<u8>, Error>
Same as execute_as_system, but execute code directly. If contract address is None, use the null sender address. If code is None, then this function has no effect. The call is executed without finalization, and does not form a transaction.
pub fn on_new_block(&self, block: &mut ExecutedBlock) -> Result<(), Error>
[src]
Logic to perform on a new block: updating last hashes and the DAO fork, for vapash.
pub fn populate_from_parent(
&self,
header: &mut Header,
parent: &Header,
gas_floor_target: U256,
gas_ceil_target: U256
)
[src]
&self,
header: &mut Header,
parent: &Header,
gas_floor_target: U256,
gas_ceil_target: U256
)
Populate a header’s fields based on its parent’s header. Usually implements the chain scoring rule based on weight. The gas floor target must not be lower than the engine’s minimum gas limit.
pub fn params(&self) -> &CommonParams
[src]
Get the general parameters of the chain.
pub fn schedule(&self, block_number: BlockNumber) -> Schedule
[src]
Get the VVM schedule for the given block number.
pub fn builtins(&self) -> &BTreeMap<Address, Builtin>
[src]
Builtin-contracts for the chain..
pub fn builtin(
&self,
a: &Address,
block_number: BlockNumber
) -> Option<&Builtin>
[src]
&self,
a: &Address,
block_number: BlockNumber
) -> Option<&Builtin>
Attempt to get a handle to a built-in contract. Only returns references to activated built-ins.
pub fn maximum_extra_data_size(&self) -> usize
[src]
Some intrinsic operation parameters; by default they take their value from the spec()
’s engine_params
.
pub fn account_start_nonce(&self, block: u64) -> U256
[src]
The nonce with which accounts begin at given block.
pub fn signing_chain_id(&self, env_info: &EnvInfo) -> Option<u64>
[src]
The network ID that transactions should be signed with.
pub fn verify_transaction_basic(
&self,
t: &UnverifiedTransaction,
header: &Header
) -> Result<(), Error>
[src]
&self,
t: &UnverifiedTransaction,
header: &Header
) -> Result<(), Error>
Does basic verification of the transaction.
pub fn verify_transaction<C: BlockInfo + CallContract>(
&self,
t: &SignedTransaction,
parent: &Header,
client: &C
) -> Result<(), Error>
[src]
&self,
t: &SignedTransaction,
parent: &Header,
client: &C
) -> Result<(), Error>
Does verification of the transaction against the parent state.
pub fn decode_transaction(
&self,
transaction: &[u8]
) -> Result<UnverifiedTransaction, Error>
[src]
&self,
transaction: &[u8]
) -> Result<UnverifiedTransaction, Error>
Performs pre-validation of RLP decoded transaction before other processing
pub fn balance(
&self,
live: &ExecutedBlock,
address: &Address
) -> Result<U256, Error>
[src]
&self,
live: &ExecutedBlock,
address: &Address
) -> Result<U256, Error>
Get the balance, in base units, associated with an account. Extracts data from the live block.
pub fn add_balance(
&self,
live: &mut ExecutedBlock,
address: &Address,
amount: &U256
) -> Result<(), Error>
[src]
&self,
live: &mut ExecutedBlock,
address: &Address,
amount: &U256
) -> Result<(), Error>
Increment the balance of an account in the state of the live block.
Auto Trait Implementations
impl !RefUnwindSafe for Machine
impl Send for Machine
impl Sync for Machine
impl Unpin for Machine
impl !UnwindSafe for Machine
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,