chore: regenerate umbrella crate, fix feature propagation

This commit is contained in:
2025-12-16 11:28:32 +03:00
parent dd6d48f528
commit 620b0e3aa0
1358 changed files with 9464 additions and 7656 deletions
@@ -15,11 +15,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use pez_revive_dev_runtime::WASM_BINARY;
use pezkuwi_sdk::{
pezsc_service::{ChainType, Properties},
*,
};
use pez_revive_dev_runtime::WASM_BINARY;
/// This is a specialization of the general Bizinikiwi ChainSpec type.
pub type ChainSpec = pezsc_service::GenericChainSpec;
@@ -141,12 +141,17 @@ pub fn run_with_args(args: Vec<String>) -> pezsc_cli::Result<()> {
runner.run_node_until_exit(|config| async move {
match config.network.network_backend {
pezsc_network::config::NetworkBackendType::Libp2p =>
service::new_full::<pezsc_network::NetworkWorker<_, _>>(config, cli.consensus)
.map_err(pezsc_cli::Error::Service),
pezsc_network::config::NetworkBackendType::Libp2p => service::new_full::<
pezsc_network::NetworkWorker<_, _>,
>(
config, cli.consensus
)
.map_err(pezsc_cli::Error::Service),
pezsc_network::config::NetworkBackendType::Litep2p => service::new_full::<
pezsc_network::Litep2pNetworkBackend,
>(config, cli.consensus)
>(
config, cli.consensus
)
.map_err(pezsc_cli::Error::Service),
}
})
@@ -24,12 +24,12 @@
use crate::cli::Consensus;
use jsonrpsee::{core::RpcResult, proc_macros::rpc, RpcModule};
use pez_revive_dev_runtime::{AccountId, Nonce, OpaqueBlock};
use pezkuwi_sdk::{
pezsc_transaction_pool_api::TransactionPool,
pezsp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata},
*,
};
use pez_revive_dev_runtime::{AccountId, Nonce, OpaqueBlock};
use std::sync::Arc;
/// Full client dependencies.
@@ -16,6 +16,7 @@
// limitations under the License.
use crate::cli::Consensus;
use pez_revive_dev_runtime::{OpaqueBlock as Block, Runtime, RuntimeApi};
use pezkuwi_sdk::{
pezsc_client_api::StorageProvider,
pezsc_executor::WasmExecutor,
@@ -24,7 +25,6 @@ use pezkuwi_sdk::{
pezsp_runtime::traits::Block as BlockT,
*,
};
use pez_revive_dev_runtime::{OpaqueBlock as Block, Runtime, RuntimeApi};
use std::sync::Arc;
type HostFunctions = pezsp_io::BizinikiwiHostFunctions;
@@ -221,7 +221,8 @@ pub fn new_full<Network: pezsc_network::NetworkBackend<Block, <Block as BlockT>:
create_inherent_data_providers: timestamp_provider,
};
let authorship_future = pezsc_consensus_manual_seal::run_instant_seal_and_finalize(params);
let authorship_future =
pezsc_consensus_manual_seal::run_instant_seal_and_finalize(params);
task_manager.spawn_essential_handle().spawn_blocking(
"instant-seal",
@@ -30,14 +30,6 @@ use pezframe_support::weights::{
Weight,
};
use pezframe_system::limits::BlockWeights;
use pezpallet_revive::{
evm::{
fees::{BlockRatioFee, Info as FeeInfo},
runtime::EthExtra,
},
AccountId32Mapper,
};
use pezpallet_transaction_payment::{ConstFeeMultiplier, FeeDetails, Multiplier, RuntimeDispatchInfo};
use pezkuwi_sdk::{
pezkuwi_sdk_frame::{
deps::pezsp_genesis_builder,
@@ -46,6 +38,16 @@ use pezkuwi_sdk::{
},
*,
};
use pezpallet_revive::{
evm::{
fees::{BlockRatioFee, Info as FeeInfo},
runtime::EthExtra,
},
AccountId32Mapper,
};
use pezpallet_transaction_payment::{
ConstFeeMultiplier, FeeDetails, Multiplier, RuntimeDispatchInfo,
};
use pezsp_weights::ConstantMultiplier;
pub use pezkuwi_sdk::{
@@ -302,7 +304,8 @@ impl pezframe_system::Config for Runtime {
type AccountId = AccountId;
type Hash = Hash;
type Nonce = Nonce;
type AccountData = pezpallet_balances::AccountData<<Runtime as pezpallet_balances::Config>::Balance>;
type AccountData =
pezpallet_balances::AccountData<<Runtime as pezpallet_balances::Config>::Balance>;
}
parameter_types! {
+3 -6
View File
@@ -179,7 +179,8 @@ fn invoke_build(current_dir: &Path) -> Result<()> {
// Note: panic_immediate_abort is now a real panic strategy in newer Rust nightlies
// Use -Cpanic=immediate-abort instead of -Zbuild-std-features=panic_immediate_abort
// -Zunstable-options must be in RUSTFLAGS as well for the rustc probe
let encoded_rustflags = ["-Dwarnings", "-Zunstable-options", "-Cpanic=immediate-abort"].join("\x1f");
let encoded_rustflags =
["-Dwarnings", "-Zunstable-options", "-Cpanic=immediate-abort"].join("\x1f");
let mut build_command = Command::new("cargo");
build_command
@@ -190,11 +191,7 @@ fn invoke_build(current_dir: &Path) -> Result<()> {
.env("RUSTUP_HOME", env::var("RUSTUP_HOME").unwrap_or_default())
// Support compilation on stable rust
.env("RUSTC_BOOTSTRAP", "1")
.args([
"build",
"--release",
"-Zbuild-std=core",
])
.args(["build", "--release", "-Zbuild-std=core"])
.arg("--target")
.arg(polkavm_linker::target_json_path(polkavm_linker::TargetJsonArgs::default()).unwrap());
@@ -16,7 +16,7 @@
// limitations under the License.
use crate::{
client::{SubscriptionType, BizinikiwiBlock, BizinikiwiBlockNumber},
client::{BizinikiwiBlock, BizinikiwiBlockNumber, SubscriptionType},
subxt_client::SrcChainConfig,
ClientError,
};
@@ -50,7 +50,8 @@ pub trait BlockInfoProvider: Send + Sync {
) -> Result<Option<Arc<BizinikiwiBlock>>, ClientError>;
/// Get block by block hash.
async fn block_by_hash(&self, hash: &H256) -> Result<Option<Arc<BizinikiwiBlock>>, ClientError>;
async fn block_by_hash(&self, hash: &H256)
-> Result<Option<Arc<BizinikiwiBlock>>, ClientError>;
}
/// Provides information about blocks.
@@ -86,7 +87,11 @@ impl SubxtBlockInfoProvider {
#[async_trait]
impl BlockInfoProvider for SubxtBlockInfoProvider {
async fn update_latest(&self, block: Arc<BizinikiwiBlock>, subscription_type: SubscriptionType) {
async fn update_latest(
&self,
block: Arc<BizinikiwiBlock>,
subscription_type: SubscriptionType,
) {
let mut latest = match subscription_type {
SubscriptionType::FinalizedBlocks => self.latest_finalized_block.write().await,
SubscriptionType::BestBlocks => self.latest_block.write().await,
@@ -127,7 +132,10 @@ impl BlockInfoProvider for SubxtBlockInfoProvider {
}
}
async fn block_by_hash(&self, hash: &H256) -> Result<Option<Arc<BizinikiwiBlock>>, ClientError> {
async fn block_by_hash(
&self,
hash: &H256,
) -> Result<Option<Arc<BizinikiwiBlock>>, ClientError> {
let latest = self.latest_block().await;
if hash == &latest.hash() {
return Ok(Some(latest));
+7 -3
View File
@@ -16,7 +16,7 @@
// limitations under the License.
//! The Ethereum JSON-RPC server.
use crate::{
client::{connect, Client, SubscriptionType, BizinikiwiBlockNumber},
client::{connect, BizinikiwiBlockNumber, Client, SubscriptionType},
DebugRpcServer, DebugRpcServerImpl, EthRpcServer, EthRpcServerImpl, ReceiptExtractor,
ReceiptProvider, SubxtBlockInfoProvider, SystemHealthRpcServer, SystemHealthRpcServerImpl,
LOG_TARGET,
@@ -270,7 +270,11 @@ fn rpc_module(is_dev: bool, client: Client) -> Result<RpcModule<()>, pezsc_servi
let mut module = RpcModule::new(());
module.merge(eth_api).map_err(|e| pezsc_service::Error::Application(e.into()))?;
module.merge(health_api).map_err(|e| pezsc_service::Error::Application(e.into()))?;
module.merge(debug_api).map_err(|e| pezsc_service::Error::Application(e.into()))?;
module
.merge(health_api)
.map_err(|e| pezsc_service::Error::Application(e.into()))?;
module
.merge(debug_api)
.map_err(|e| pezsc_service::Error::Application(e.into()))?;
Ok(module)
}
+7 -4
View File
@@ -34,9 +34,9 @@ use pezpallet_revive::{
},
EthTransactError,
};
use runtime_api::RuntimeApi;
use pezsp_runtime::traits::Block as BlockT;
use pezsp_weights::Weight;
use runtime_api::RuntimeApi;
use std::{ops::Range, sync::Arc, time::Duration};
use storage_api::StorageApi;
use subxt::{
@@ -514,7 +514,10 @@ impl Client {
}
/// Get receipts count per block.
pub async fn receipts_count_per_block(&self, block_hash: &BizinikiwiBlockHash) -> Option<usize> {
pub async fn receipts_count_per_block(
&self,
block_hash: &BizinikiwiBlockHash,
) -> Option<usize> {
self.receipt_provider.receipts_count_per_block(block_hash).await
}
@@ -710,8 +713,8 @@ impl Client {
// This could potentially fail under below circumstances:
// - state has been pruned
// - the block author cannot be obtained from the digest logs (highly unlikely)
// - the node we are targeting has an outdated revive pezpallet (or ETH block functionality is
// disabled)
// - the node we are targeting has an outdated revive pezpallet (or ETH block functionality
// is disabled)
match self.runtime_api(block.hash()).eth_block().await {
Ok(mut eth_block) => {
log::trace!(target: LOG_TARGET, "Ethereum block from runtime API hash {:?}", eth_block.hash);
@@ -611,8 +611,8 @@ mod tests {
use super::*;
use crate::test::{MockBlockInfo, MockBlockInfoProvider};
use pezpallet_revive::evm::{ReceiptInfo, TransactionSigned};
use pretty_assertions::assert_eq;
use pezsp_core::{H160, H256};
use pretty_assertions::assert_eq;
use sqlx::SqlitePool;
async fn count(pool: &SqlitePool, table: &str, block_hash: Option<H256>) -> usize {
+1 -1
View File
@@ -278,8 +278,8 @@ mod test {
assert_err,
traits::fungible::{InspectHold, Mutate},
};
use pretty_assertions::assert_eq;
use pezsp_core::{hex2array, H160};
use pretty_assertions::assert_eq;
#[test]
fn create1_works() {
+22 -9
View File
@@ -46,6 +46,7 @@ use crate::{
use alloc::{vec, vec::Vec};
use alloy_core::sol_types::{SolInterface, SolValue};
use codec::{Encode, MaxEncodedLen};
use k256::ecdsa::SigningKey;
use pezframe_benchmarking::v2::*;
use pezframe_support::{
self, assert_ok,
@@ -55,13 +56,11 @@ use pezframe_support::{
weights::{Weight, WeightMeter},
};
use pezframe_system::RawOrigin;
use k256::ecdsa::SigningKey;
use pezpallet_revive_uapi::{
pack_hi_lo,
precompiles::{storage::IStorage, system::ISystem},
CallFlags, ReturnErrorCode, StorageFlags,
};
use revm::bytecode::Bytecode;
use pezsp_consensus_aura::AURA_ENGINE_ID;
use pezsp_consensus_babe::{
digests::{PreDigest, PrimaryPreDigest},
@@ -69,6 +68,7 @@ use pezsp_consensus_babe::{
};
use pezsp_consensus_slots::Slot;
use pezsp_runtime::{generic::DigestItem, traits::Zero};
use revm::bytecode::Bytecode;
/// How many runs we do per API benchmark.
///
@@ -938,7 +938,8 @@ mod benchmarks {
input_bytes,
);
}
let min: U256 = crate::Pezpallet::<T>::convert_native_to_evm(T::Currency::minimum_balance());
let min: U256 =
crate::Pezpallet::<T>::convert_native_to_evm(T::Currency::minimum_balance());
let min =
crate::precompiles::alloy::primitives::aliases::U256::abi_decode(&min.to_big_endian())
.unwrap();
@@ -1042,7 +1043,10 @@ mod benchmarks {
[i, i, i, i],
vec![i; 128],
));
pezframe_system::Pezpallet::<T>::deposit_log(DigestItem::Seal([i, i, i, i], vec![i; 128]));
pezframe_system::Pezpallet::<T>::deposit_log(DigestItem::Seal(
[i, i, i, i],
vec![i; 128],
));
pezframe_system::Pezpallet::<T>::deposit_log(DigestItem::Other(vec![i; 128]));
}
@@ -1069,7 +1073,10 @@ mod benchmarks {
AURA_ENGINE_ID,
slot.encode(),
));
pezframe_system::Pezpallet::<T>::deposit_log(DigestItem::Seal(AURA_ENGINE_ID, slot.encode()));
pezframe_system::Pezpallet::<T>::deposit_log(DigestItem::Seal(
AURA_ENGINE_ID,
slot.encode(),
));
let result;
#[block]
@@ -1225,7 +1232,10 @@ mod benchmarks {
assert!(PristineCode::<T>::get(code_hash).is_some());
T::Currency::set_balance(&instance.account_id, Pezpallet::<T>::min_balance() * 10u32.into());
T::Currency::set_balance(
&instance.account_id,
Pezpallet::<T>::min_balance() * 10u32.into(),
);
let result;
#[block]
@@ -1248,7 +1258,10 @@ mod benchmarks {
// Check that the beneficiary received the balance
let balance = <T as Config>::Currency::balance(&beneficiary);
assert_eq!(balance, Pezpallet::<T>::min_balance() + Pezpallet::<T>::min_balance() * 9u32.into());
assert_eq!(
balance,
Pezpallet::<T>::min_balance() + Pezpallet::<T>::min_balance() * 9u32.into()
);
Ok(())
}
@@ -2274,8 +2287,8 @@ mod benchmarks {
let key_type = pezsp_core::crypto::KeyTypeId(*b"code");
let pub_key = pezsp_io::crypto::sr25519_generate(key_type, None);
let sig =
pezsp_io::crypto::sr25519_sign(key_type, &pub_key, &message).expect("Generates signature");
let sig = pezsp_io::crypto::sr25519_sign(key_type, &pub_key, &message)
.expect("Generates signature");
let sig = AsRef::<[u8; 64]>::as_ref(&sig).to_vec();
let sig_len = sig.len() as u32;
+2 -2
View File
@@ -17,10 +17,10 @@
use crate::{Config, DebugSettingsOf};
use codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use pezsp_core::Get;
use pezsp_runtime::RuntimeDebug;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
/// Debugging settings that can be configured when DebugEnabled config is true.
#[derive(
@@ -19,13 +19,13 @@ use crate::evm::Bytes;
use alloc::{collections::BTreeMap, string::String, vec::Vec};
use codec::{Decode, Encode};
use derive_more::From;
use pezsp_core::{H160, H256, U256};
use scale_info::TypeInfo;
use serde::{
de::{Error, MapAccess, Visitor},
ser::{SerializeMap, Serializer},
Deserialize, Serialize,
};
use pezsp_core::{H160, H256, U256};
/// The type of tracer to use.
#[derive(TypeInfo, Debug, Clone, Encode, Decode, Serialize, Deserialize, PartialEq)]
@@ -19,8 +19,8 @@ use super::*;
use alloc::vec::Vec;
use codec::{Decode, Encode};
use pezframe_support::DefaultNoBound;
use scale_info::TypeInfo;
use pezsp_core::{H160, U256};
use scale_info::TypeInfo;
/// Configuration specific to a dry-run execution.
#[derive(Debug, Encode, Decode, TypeInfo, Clone, DefaultNoBound)]
@@ -33,8 +33,8 @@ use alloc::vec::Vec;
use alloy_core::primitives::{bytes::BufMut, B256};
use codec::{Decode, Encode};
use scale_info::TypeInfo;
use pezsp_core::{H256, U256};
use scale_info::TypeInfo;
/// Details needed to reconstruct the receipt info in the RPC
/// layer without losing accuracy.
@@ -32,17 +32,17 @@ use alloc::{vec, vec::Vec};
use codec::{Decode, Encode};
use pezframe_support::traits::Time;
use scale_info::TypeInfo;
use pezsp_arithmetic::traits::Saturating;
use pezsp_core::{keccak_256, H160, H256, U256};
use pezsp_runtime::traits::{One, Zero};
use scale_info::TypeInfo;
const LOG_TARGET: &str = "runtime::revive::block_builder";
/// Ethereum block builder designed to incrementally build the transaction and receipt trie roots.
///
/// This builder is optimized to minimize memory usage and pezpallet storage by leveraging the internal
/// structure of the Ethereum trie and the RLP encoding of receipts.
/// This builder is optimized to minimize memory usage and pezpallet storage by leveraging the
/// internal structure of the Ethereum trie and the RLP encoding of receipts.
#[cfg_attr(test, derive(pezframe_support::DefaultNoBound))]
pub struct EthereumBlockBuilder<T> {
pub(crate) transaction_root_builder: IncrementalHashBuilder,
+3 -1
View File
@@ -26,7 +26,9 @@ use alloc::{boxed::Box, vec::Vec};
use codec::DecodeLimit;
use pezframe_support::MAX_EXTRINSIC_DEPTH;
use pezsp_core::Get;
use pezsp_runtime::{transaction_validity::InvalidTransaction, FixedPointNumber, SaturatedConversion};
use pezsp_runtime::{
transaction_validity::InvalidTransaction, FixedPointNumber, SaturatedConversion,
};
/// Result of decoding an eth transaction into a dispatchable call.
pub struct CallInfo<T: Config> {
+1 -1
View File
@@ -27,6 +27,7 @@ use crate::{
};
use codec::Encode;
use core::marker::PhantomData;
use num_traits::Zero;
use pezframe_support::{
dispatch::{DispatchClass, DispatchInfo, GetDispatchInfo},
pezpallet_prelude::Weight,
@@ -34,7 +35,6 @@ use pezframe_support::{
weights::WeightToFee,
};
use pezframe_system::Config as SysConfig;
use num_traits::Zero;
use pezpallet_transaction_payment::{
Config as TxConfig, MultiplierUpdate, NextFeeMultiplier, Pezpallet as TxPallet, TxCreditHold,
};
@@ -33,7 +33,6 @@ use pezframe_support::{
},
};
use pezpallet_transaction_payment::Config as TxConfig;
use scale_info::{StaticTypeInfo, TypeInfo};
use pezsp_core::U256;
use pezsp_runtime::{
generic::{self, CheckedExtrinsic, ExtrinsicFormat},
@@ -44,6 +43,7 @@ use pezsp_runtime::{
transaction_validity::{InvalidTransaction, TransactionValidityError},
OpaqueExtrinsic, RuntimeDebug, Weight,
};
use scale_info::{StaticTypeInfo, TypeInfo};
/// Used to set the weight limit argument of a `eth_call` or `eth_instantiate_with_code` call.
pub trait SetWeightLimit {
@@ -23,12 +23,12 @@ use pezframe_support::{
pezpallet_prelude::{InvalidTransaction, TransactionSource},
DebugNoBound, DefaultNoBound,
};
use scale_info::TypeInfo;
use pezsp_runtime::{
impl_tx_ext_default,
traits::{DispatchInfoOf, TransactionExtension, ValidateResult},
Weight,
};
use scale_info::TypeInfo;
/// An extension that sets the origin to [`Origin::EthTransaction`] in case it originated from an
/// eth transaction.
+3 -2
View File
@@ -83,8 +83,9 @@ type VarSizedKey = BoundedVec<u8, ConstU32<{ limits::STORAGE_KEY_BYTES }>>;
const FRAME_ALWAYS_EXISTS_ON_INSTANTIATE: &str = "The return value is only `None` if no contract exists at the specified address. This cannot happen on instantiate or delegate; qed";
/// Code hash of existing account without code (keccak256 hash of empty data).
pub const EMPTY_CODE_HASH: H256 =
H256(pezsp_core::hex2array!("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"));
pub const EMPTY_CODE_HASH: H256 = H256(pezsp_core::hex2array!(
"c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
));
/// Combined key type for both fixed and variable sized storage keys.
#[derive(Debug)]
+1 -1
View File
@@ -36,9 +36,9 @@ use assert_matches::assert_matches;
use pezframe_support::{assert_err, assert_ok, parameter_types};
use pezframe_system::AccountInfo;
use pezpallet_revive_uapi::ReturnFlags;
use pretty_assertions::assert_eq;
use pezsp_io::hashing::keccak_256;
use pezsp_runtime::DispatchError;
use pretty_assertions::assert_eq;
use std::{cell::RefCell, collections::hash_map::HashMap, rc::Rc};
type System = pezframe_system::Pezpallet<Test>;
@@ -42,7 +42,9 @@ use pezframe_support::{
use pezsp_core::{H160, U256};
use pezsp_runtime::{traits::AccountIdConversion, DispatchError};
use super::{address::AddressMapper, pezpallet, Config, ContractResult, ExecConfig, Pezpallet, Weight};
use super::{
address::AddressMapper, pezpallet, Config, ContractResult, ExecConfig, Pezpallet, Weight,
};
use pez_ethereum_standards::IERC20;
const GAS_LIMIT: Weight = Weight::from_parts(500_000_000_000, 10 * 1024 * 1024);
+10 -9
View File
@@ -84,11 +84,11 @@ use pezframe_system::{
pezpallet_prelude::{BlockNumberFor, OriginFor},
Pezpallet as System,
};
use scale_info::TypeInfo;
use pezsp_runtime::{
traits::{BadOrigin, Bounded, Convert, Dispatchable, Saturating, UniqueSaturatedInto, Zero},
AccountId32, DispatchError, FixedPointNumber, FixedU128,
};
use scale_info::TypeInfo;
pub use crate::{
address::{
@@ -107,9 +107,9 @@ pub use crate::{
pub use codec;
pub use pezframe_support::{self, dispatch::DispatchInfo, traits::Time, weights::Weight};
pub use pezframe_system::{self, limits::BlockWeights};
pub use primitives::*;
pub use pezsp_core::{keccak_256, H160, H256, U256};
pub use pezsp_runtime;
pub use primitives::*;
pub use weights::WeightInfo;
#[cfg(doc)]
@@ -171,7 +171,8 @@ pub mod pezpallet {
/// The overarching event type.
#[pezpallet::no_default_bounds]
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
type RuntimeEvent: From<Event<Self>>
+ IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
/// The overarching call type.
#[pezpallet::no_default_bounds]
@@ -950,8 +951,8 @@ pub mod pezpallet {
// for transactions. Transactions are bounded to `MAX_TRANSACTION_PAYLOAD_SIZE`.
//
// To determine the maximum size of the receipts, we know the following:
// - (I) first receipt is stored into pezpallet storage and not given to the hasher until
// finalization.
// - (I) first receipt is stored into pezpallet storage and not given to the hasher
// until finalization.
// - (II) the hasher will not consume more memory than the receipts we are giving it.
// - (III) the hasher is capped by 3 x maximum entry for 3 or more transactions.
//
@@ -1042,8 +1043,8 @@ pub mod pezpallet {
///
/// This call cannot be dispatched directly; attempting to do so will result in a failed
/// transaction. It serves as a wrapper for an Ethereum transaction. When submitted, the
/// runtime converts it into a [`pezsp_runtime::generic::CheckedExtrinsic`] by recovering the
/// signer and validating the transaction.
/// runtime converts it into a [`pezsp_runtime::generic::CheckedExtrinsic`] by recovering
/// the signer and validating the transaction.
#[allow(unused_variables)]
#[pezpallet::call_index(0)]
#[pezpallet::weight(Weight::MAX)]
@@ -2597,8 +2598,8 @@ pezsp_api::decl_runtime_apis! {
}
}
/// This macro wraps bizinikiwi's `impl_runtime_apis!` and implements `pezpallet_revive` runtime APIs
/// and other required traits.
/// This macro wraps bizinikiwi's `impl_runtime_apis!` and implements `pezpallet_revive` runtime
/// APIs and other required traits.
///
/// # Note
///
@@ -108,8 +108,10 @@ impl<T: Config> SteppedMigration for Migration<T> {
}
if !pezframe_system::Pezpallet::<T>::account_exists(&Pezpallet::<T>::account_id()) {
let _ =
T::Currency::mint_into(&Pezpallet::<T>::account_id(), T::Currency::minimum_balance());
let _ = T::Currency::mint_into(
&Pezpallet::<T>::account_id(),
T::Currency::minimum_balance(),
);
}
loop {
+1 -1
View File
@@ -25,12 +25,12 @@ use alloc::{boxed::Box, fmt::Debug, string::String, vec::Vec};
use codec::{Decode, Encode, MaxEncodedLen};
use pezframe_support::weights::Weight;
use pezpallet_revive_uapi::ReturnFlags;
use scale_info::TypeInfo;
use pezsp_core::Get;
use pezsp_runtime::{
traits::{One, Saturating, Zero},
DispatchError, RuntimeDebug,
};
use scale_info::TypeInfo;
/// Result type of a `bare_call` or `bare_instantiate` call as well as `ContractsApi::call` and
/// `ContractsApi::instantiate`.
+3 -2
View File
@@ -39,13 +39,13 @@ use pezframe_support::{
weights::{Weight, WeightMeter},
CloneNoBound, DebugNoBound, DefaultNoBound,
};
use scale_info::TypeInfo;
use pezsp_core::{Get, H160};
use pezsp_io::KillStorageResult;
use pezsp_runtime::{
traits::{Hash, Saturating, Zero},
DispatchError, RuntimeDebug,
};
use scale_info::TypeInfo;
pub enum AccountIdOrAddress<T: Config> {
/// An account that is a contract.
@@ -573,7 +573,8 @@ impl<T: Config> DeletionQueueManager<T> {
///
/// Note:
/// we use the delete counter to get the next value to read from the queue and thus don't pay
/// the cost of an extra call to `pezsp_io::storage::next_key` to lookup the next entry in the map
/// the cost of an extra call to `pezsp_io::storage::next_key` to lookup the next entry in the
/// map
fn next(&mut self) -> Option<DeletionQueueEntry<'_, T>> {
if self.is_empty() {
return None;
+1 -1
View File
@@ -23,8 +23,8 @@ pub mod builder;
pub use pezsp_runtime::AccountId32;
use crate::{BalanceOf, Config};
use pezframe_support::weights::Weight;
use hex_literal::hex;
use pezframe_support::weights::Weight;
use pezsp_core::H160;
const fn ee_suffix(mut account: [u8; 32]) -> AccountId32 {
@@ -18,12 +18,12 @@
use super::{deposit_limit, GAS_LIMIT};
use crate::{
address::AddressMapper, evm::TransactionSigned, AccountIdOf, BalanceOf, Code, Config,
ContractResult, ExecConfig, ExecReturnValue, InstantiateReturnValue, OriginFor, Pezpallet, Weight,
U256,
ContractResult, ExecConfig, ExecReturnValue, InstantiateReturnValue, OriginFor, Pezpallet,
Weight, U256,
};
use alloc::{vec, vec::Vec};
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
use paste::paste;
use pezframe_support::pezpallet_prelude::DispatchResultWithPostInfo;
use pezsp_core::H160;
/// Helper macro to generate a builder for contract API calls.
+1 -2
View File
@@ -37,9 +37,8 @@ use crate::{
PristineCode,
};
use pezframe_support::{
assert_ok, derive_impl,
assert_ok, derive_impl, parameter_types,
pezpallet_prelude::EnsureOrigin,
parameter_types,
traits::{ConstU32, ConstU64, FindAuthor, OriginTrait, StorageVersion},
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, FixedFee, Weight},
};
@@ -86,8 +86,9 @@ fn transactions_are_captured() {
builder::bare_instantiate(Code::Upload(binary.clone())).build_and_unwrap_contract();
let Contract { addr: addr2, .. } =
builder::bare_instantiate(Code::Upload(gas_binary.clone())).build_and_unwrap_contract();
let balance =
Pezpallet::<Test>::convert_native_to_evm(BalanceWithDust::new_unchecked::<Test>(100, 10));
let balance = Pezpallet::<Test>::convert_native_to_evm(BalanceWithDust::new_unchecked::<
Test,
>(100, 10));
<Test as Config>::FeeInfo::deposit_txfee(<Test as Config>::Currency::issue(5_000_000_000));
@@ -144,8 +145,9 @@ fn events_are_captured() {
// Bare call must not be captured.
builder::bare_instantiate(Code::Existing(code_hash)).build_and_unwrap_contract();
let balance =
Pezpallet::<Test>::convert_native_to_evm(BalanceWithDust::new_unchecked::<Test>(100, 10));
let balance = Pezpallet::<Test>::convert_native_to_evm(BalanceWithDust::new_unchecked::<
Test,
>(100, 10));
<Test as Config>::FeeInfo::deposit_txfee(<Test as Config>::Currency::issue(
500_000_000_000,
+11 -7
View File
@@ -59,12 +59,12 @@ use pezframe_support::{
use pezframe_system::{EventRecord, Phase};
use pezpallet_revive_fixtures::compile_module;
use pezpallet_revive_uapi::{ReturnErrorCode as RuntimeReturnCode, ReturnFlags};
use pretty_assertions::{assert_eq, assert_ne};
use pezsp_core::U256;
use pezsp_io::hashing::blake2_256;
use pezsp_runtime::{
testing::H256, AccountId32, BoundedVec, DispatchError, SaturatedConversion, TokenError,
};
use pretty_assertions::{assert_eq, assert_ne};
#[test]
fn eth_call_transfer_with_dust_works() {
@@ -76,8 +76,9 @@ fn eth_call_transfer_with_dust_works() {
<Test as Config>::FeeInfo::deposit_txfee(<Test as Config>::Currency::issue(5_000_000_000));
let balance =
Pezpallet::<Test>::convert_native_to_evm(BalanceWithDust::new_unchecked::<Test>(100, 10));
let balance = Pezpallet::<Test>::convert_native_to_evm(BalanceWithDust::new_unchecked::<
Test,
>(100, 10));
assert_ok!(builder::eth_call(addr)
.origin(Origin::EthTransaction(ALICE).into())
.value(balance)
@@ -127,8 +128,9 @@ fn contract_call_transfer_with_dust_works() {
let Contract { addr: addr_callee, .. } =
builder::bare_instantiate(Code::Upload(binary_callee)).build_and_unwrap_contract();
let balance =
Pezpallet::<Test>::convert_native_to_evm(BalanceWithDust::new_unchecked::<Test>(100, 10));
let balance = Pezpallet::<Test>::convert_native_to_evm(BalanceWithDust::new_unchecked::<
Test,
>(100, 10));
assert_ok!(builder::call(addr_caller).data((balance, addr_callee).encode()).build());
assert_eq!(Pezpallet::<Test>::evm_balance(&addr_callee), balance);
@@ -3296,7 +3298,8 @@ fn read_only_call_cannot_transfer() {
assert_err_ignore_postinfo!(
builder::call(addr_caller)
.data(
(addr_callee, pezpallet_revive_uapi::CallFlags::READ_ONLY.bits(), 100u64).encode()
(addr_callee, pezpallet_revive_uapi::CallFlags::READ_ONLY.bits(), 100u64)
.encode()
)
.build(),
<Error<Test>>::StateChangeDenied
@@ -5203,7 +5206,8 @@ fn get_set_immutables_works() {
let new_data = [0xdeu8; 8].to_vec();
Pezpallet::<Test>::set_immutables(addr, BoundedVec::truncate_from(new_data.clone())).unwrap();
Pezpallet::<Test>::set_immutables(addr, BoundedVec::truncate_from(new_data.clone()))
.unwrap();
let immutable_data = Pezpallet::<Test>::get_immutables(addr).unwrap();
assert_eq!(immutable_data, new_data);
});
+2 -1
View File
@@ -27,7 +27,8 @@ use crate::{
AllowEvmBytecode, DebugFlag, ExtBuilder, RuntimeOrigin, Test,
},
tracing::trace,
Code, Config, Error, EthBlockBuilderFirstValues, GenesisConfig, Origin, Pezpallet, PristineCode,
Code, Config, Error, EthBlockBuilderFirstValues, GenesisConfig, Origin, Pezpallet,
PristineCode,
};
use alloy_core::sol_types::{SolCall, SolInterface};
use pezframe_support::{
@@ -27,8 +27,8 @@ use crate::{
use alloy_core::sol_types::{SolCall, SolInterface};
use pezframe_support::traits::fungible::Mutate;
use pezpallet_revive_fixtures::{compile_module_with_type, BlockInfo, FixtureType};
use pretty_assertions::assert_eq;
use pezsp_core::H160;
use pretty_assertions::assert_eq;
use test_case::test_case;
/// Tests that the blocknumber opcode works as expected.
@@ -33,8 +33,8 @@ use alloy_core::{
use pezframe_support::{assert_err, traits::fungible::Mutate};
use pezpallet_revive_fixtures::{compile_module_with_type, Callee, Caller, FixtureType};
use pezpallet_revive_uapi::ReturnFlags;
use pretty_assertions::assert_eq;
use pezsp_core::H160;
use pretty_assertions::assert_eq;
use test_case::test_case;
/// Tests that the `CALL` opcode works as expected by having one contract call another.
@@ -28,10 +28,10 @@ use pezframe_support::traits::fungible::{Balanced, Mutate};
use pezpallet_revive_fixtures::{
compile_module_with_type, Callee, FixtureType, System as SystemFixture,
};
use pretty_assertions::assert_eq;
use revm::primitives::Bytes;
use pezsp_core::H160;
use pezsp_io::hashing::keccak_256;
use pretty_assertions::assert_eq;
use revm::primitives::Bytes;
use test_case::test_case;
#[test_case(FixtureType::Solc)]
@@ -25,8 +25,8 @@ use crate::{
use alloy_core::sol_types::{SolCall, SolInterface};
use pezframe_support::traits::fungible::Mutate;
use pezpallet_revive_fixtures::{compile_module_with_type, FixtureType, TransactionInfo};
use pretty_assertions::assert_eq;
use pezsp_core::H160;
use pretty_assertions::assert_eq;
use test_case::test_case;
/// Tests that the gasprice opcode works as expected.
@@ -23,8 +23,8 @@ use crate::{
Error, RuntimeCosts,
};
use core::ops::ControlFlow;
use revm::interpreter::gas::BASE;
use pezsp_core::U256;
use revm::interpreter::gas::BASE;
/// EIP-1344: ChainID opcode
pub fn chainid<E: Ext>(interpreter: &mut Interpreter<E>) -> ControlFlow<Halt> {
@@ -24,8 +24,8 @@ use crate::{
Pezpallet, RuntimeCosts,
};
use core::ops::{ControlFlow, Range};
use revm::interpreter::interpreter_action::CallScheme;
use pezsp_core::{H160, U256};
use revm::interpreter::interpreter_action::CallScheme;
/// Gets memory input and output ranges for call instructions.
pub fn get_memory_in_and_out_ranges<'a, E: Ext>(
@@ -25,9 +25,9 @@ use crate::{
Config, Error, U256,
};
use core::ops::ControlFlow;
use revm::interpreter::gas::{BASE, VERYLOW};
use pezsp_core::H256;
use pezsp_io::hashing::keccak_256;
use revm::interpreter::gas::{BASE, VERYLOW};
// TODO: Fix the gas handling for the memory operations
/// The Keccak-256 hash of the empty string `""`.
+1 -1
View File
@@ -26,8 +26,8 @@ pub use runtime_costs::RuntimeCosts;
use crate::{
exec::{ExecResult, Executable, ExportedFunction, Ext},
pezframe_support::{ensure, error::BadOrigin},
gas::{GasMeter, Token},
pezframe_support::{ensure, error::BadOrigin},
storage::meter::NestedMeter,
weights::WeightInfo,
AccountIdOf, BalanceOf, CodeInfoOf, CodeRemoved, Config, Error, ExecConfig, ExecError,