Struct near_sdk_sim::runtime::RuntimeStandalone [−][src]
pub struct RuntimeStandalone { pub genesis: GenesisConfig, pub cur_block: Block, pub last_outcomes: Vec<CryptoHash>, // some fields omitted }
Fields
genesis: GenesisConfig
cur_block: Block
last_outcomes: Vec<CryptoHash>
Implementations
impl RuntimeStandalone
[src]
impl RuntimeStandalone
[src]pub fn new(genesis: GenesisConfig, store: Arc<Store>) -> Self
[src]
pub fn new_with_store(genesis: GenesisConfig) -> Self
[src]
pub fn resolve_tx(
&mut self,
tx: SignedTransaction
) -> Result<(CryptoHash, ExecutionOutcome), RuntimeError>
[src]
&mut self,
tx: SignedTransaction
) -> Result<(CryptoHash, ExecutionOutcome), RuntimeError>
Processes blocks until the final value is produced
pub fn send_tx(&mut self, tx: SignedTransaction) -> CryptoHash
[src]
Just puts tx into the transaction pool
pub fn outcome(&self, hash: &CryptoHash) -> Option<ExecutionOutcome>
[src]
pub fn profile_of_outcome(&self, hash: &CryptoHash) -> Option<ProfileData>
[src]
pub fn process_all(&mut self) -> Result<(), RuntimeError>
[src]
Processes all transactions and pending receipts until there is no pending_receipts left
pub fn produce_block(&mut self) -> Result<(), RuntimeError>
[src]
Processes one block. Populates outcomes and producining new pending_receipts.
pub fn produce_blocks(&mut self, num_of_blocks: u64) -> Result<(), RuntimeError>
[src]
Produce num_of_blocks blocks.
Examples
use near_sdk_sim::runtime::init_runtime; let (mut runtime, _, _) = init_runtime(None); runtime.produce_blocks(5); assert_eq!(runtime.current_block().block_height, 5); assert_eq!(runtime.current_block().epoch_height, 1);
pub fn force_account_update(&mut self, account_id: AccountId, account: &Account)
[src]
Force alter account and change state_root.
pub fn view_account(&self, account_id: &str) -> Option<Account>
[src]
pub fn view_access_key(
&self,
account_id: &str,
public_key: &PublicKey
) -> Option<AccessKey>
[src]
&self,
account_id: &str,
public_key: &PublicKey
) -> Option<AccessKey>
pub fn view_method_call(
&self,
account_id: &str,
method_name: &str,
args: &[u8]
) -> ViewResult
[src]
&self,
account_id: &str,
method_name: &str,
args: &[u8]
) -> ViewResult
Returns a ViewResult containing the value or error and any logs
pub fn current_block(&self) -> &Block
[src]
Returns a reference to the current block.
Examples
use near_sdk_sim::runtime::init_runtime; let (mut runtime, _, _) = init_runtime(None); runtime.produce_block().unwrap(); runtime.current_block(); assert_eq!(runtime.current_block().block_height, 1); runtime.produce_blocks(4).unwrap(); assert_eq!(runtime.current_block().block_height, 5);
pub fn pending_receipts(&self) -> &[Receipt]
[src]
Auto Trait Implementations
impl !RefUnwindSafe for RuntimeStandalone
impl !RefUnwindSafe for RuntimeStandalone
impl !Send for RuntimeStandalone
impl !Send for RuntimeStandalone
impl !Sync for RuntimeStandalone
impl !Sync for RuntimeStandalone
impl Unpin for RuntimeStandalone
impl Unpin for RuntimeStandalone
impl !UnwindSafe for RuntimeStandalone
impl !UnwindSafe for RuntimeStandalone
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,