inkpad_sandbox/chain.rs
1//! Chain state
2use crate::{util::al, Sandbox};
3use inkpad_std::Vec;
4use parity_scale_codec::Encode;
5
6impl Sandbox {
7 pub fn deposit_event(&mut self, topics: Vec<[u8; 32]>, data: Vec<u8>) {
8 self.events.push((topics, data));
9 }
10
11 pub fn block_number(&self) -> [u8; 32] {
12 [0; 32]
13 }
14
15 pub fn max_value_size(&self) -> u32 {
16 16_384
17 }
18
19 pub fn get_weight_price(&self, weight: u64) -> Vec<u8> {
20 al(1312_u64.saturating_mul(weight).encode(), 16)
21 }
22}