fix: Resolve cargo clippy errors and add CI workflow plan

## Changes

### Clippy Fixes
- Fixed deprecated `cargo_bin` usage in 27 test files (added #![allow(deprecated)])
- Fixed uninlined_format_args in zombienet-sdk-tests
- Fixed subxt API changes in revive/rpc/tests.rs (fetch signature, StorageValue)
- Fixed dead_code warnings in validator-pool and identity-kyc mocks
- Fixed field name `i` -> `_i` in tasks example

### CI Infrastructure
- Added .claude/WORKFLOW_PLAN.md for tracking CI fix progress
- Updated lychee.toml and taplo.toml configs

### Files Modified
- 27 test files with deprecated cargo_bin fix
- bizinikiwi/pezframe/revive/rpc/src/tests.rs (subxt API)
- pezkuwi/pezpallets/validator-pool/src/{mock,tests}.rs
- pezcumulus/teyrchains/pezpallets/identity-kyc/src/mock.rs
- bizinikiwi/pezframe/examples/tasks/src/tests.rs

## Status
- cargo clippy: PASSING
- Next: cargo fmt, zepter, workspace checks
This commit is contained in:
2025-12-22 16:36:14 +03:00
parent 8acf59c6aa
commit 65b7f5e640
1393 changed files with 17834 additions and 179151 deletions
+81 -80
View File
@@ -24,7 +24,6 @@ alloy-trie = { workspace = true }
codec = { features = ["derive", "max-encoded-len"], workspace = true }
derive_more = { workspace = true, features = ["from", "try_into"] }
environmental = { workspace = true }
pez-ethereum-standards = { workspace = true }
ethereum-types = { workspace = true, features = ["codec", "rlp", "serialize"] }
hex-literal = { workspace = true }
humantime-serde = { optional = true, workspace = true }
@@ -35,9 +34,10 @@ num-bigint = { workspace = true }
num-integer = { workspace = true }
num-traits = { workspace = true }
paste = { workspace = true }
pez-ethereum-standards = { workspace = true }
polkavm = { version = "0.29.1", default-features = false }
polkavm-common = { version = "0.29.0", default-features = false, features = [
"alloc",
"alloc",
] }
rand = { workspace = true }
rand_pcg = { workspace = true }
@@ -55,11 +55,10 @@ pezframe-system = { workspace = true }
pezpallet-revive-fixtures = { workspace = true, optional = true }
pezpallet-revive-proc-macro = { workspace = true }
pezpallet-revive-uapi = { workspace = true, features = [
"precompiles-sol-interfaces",
"scale",
"precompiles-sol-interfaces",
"scale",
] }
pezpallet-transaction-payment = { workspace = true }
ripemd = { workspace = true }
pezsp-api = { workspace = true }
pezsp-arithmetic = { workspace = true }
pezsp-consensus-aura = { workspace = true, optional = true }
@@ -69,8 +68,10 @@ pezsp-core = { workspace = true }
pezsp-io = { workspace = true }
pezsp-runtime = { workspace = true }
pezsp-version = { workspace = true }
subxt-signer = { workspace = true, optional = true, features = [
"unstable-eth",
ripemd = { workspace = true }
pezkuwi-subxt-signer = { workspace = true, optional = true, features = [
"unstable-eth",
"subxt",
] }
[dev-dependencies]
@@ -88,88 +89,88 @@ pezpallet-proxy = { workspace = true, default-features = true }
pezpallet-revive-fixtures = { workspace = true, default-features = true }
pezpallet-timestamp = { workspace = true, default-features = true }
pezpallet-utility = { workspace = true, default-features = true }
proptest = { workspace = true }
pezsp-keystore = { workspace = true, default-features = true }
pezsp-state-machine = { workspace = true }
pezsp-tracing = { workspace = true, default-features = true }
proptest = { workspace = true }
[features]
default = ["std"]
std = [
"alloy-consensus/serde",
"alloy-consensus/std",
"alloy-core/std",
"alloy-trie/std",
"codec/std",
"environmental/std",
"ethereum-types/std",
"pezframe-benchmarking?/std",
"pezframe-support/std",
"pezframe-system/std",
"humantime-serde",
"k256?/std",
"log/std",
"num-bigint/std",
"num-integer/std",
"num-traits/std",
"pezpallet-proxy/std",
"pezpallet-revive-fixtures?/std",
"pezpallet-timestamp/std",
"pezpallet-transaction-payment/std",
"pezpallet-utility/std",
"polkavm-common/std",
"polkavm/std",
"rand/std",
"revm/std",
"ripemd/std",
"rlp/std",
"scale-info/std",
"secp256k1/std",
"serde/std",
"serde_json/std",
"pezsp-api/std",
"pezsp-arithmetic/std",
"pezsp-consensus-aura/std",
"pezsp-consensus-babe/std",
"pezsp-consensus-slots/std",
"pezsp-core/std",
"pezsp-io/std",
"pezsp-keystore/std",
"pezsp-runtime/std",
"pezsp-state-machine/std",
"pezsp-version/std",
"subxt-signer",
"alloy-consensus/serde",
"alloy-consensus/std",
"alloy-core/std",
"alloy-trie/std",
"codec/std",
"environmental/std",
"ethereum-types/std",
"humantime-serde",
"k256?/std",
"log/std",
"num-bigint/std",
"num-integer/std",
"num-traits/std",
"pezframe-benchmarking?/std",
"pezframe-support/std",
"pezframe-system/std",
"pezpallet-proxy/std",
"pezpallet-revive-fixtures?/std",
"pezpallet-timestamp/std",
"pezpallet-transaction-payment/std",
"pezpallet-utility/std",
"pezsp-api/std",
"pezsp-arithmetic/std",
"pezsp-consensus-aura/std",
"pezsp-consensus-babe/std",
"pezsp-consensus-slots/std",
"pezsp-core/std",
"pezsp-io/std",
"pezsp-keystore/std",
"pezsp-runtime/std",
"pezsp-state-machine/std",
"pezsp-version/std",
"polkavm-common/std",
"polkavm/std",
"rand/std",
"revm/std",
"ripemd/std",
"rlp/std",
"scale-info/std",
"secp256k1/std",
"serde/std",
"serde_json/std",
"pezkuwi-subxt-signer",
]
runtime-benchmarks = [
"pezframe-benchmarking/runtime-benchmarks",
"pezframe-support/runtime-benchmarks",
"pezframe-system/runtime-benchmarks",
"k256",
"pezpallet-balances/runtime-benchmarks",
"pezpallet-proxy/runtime-benchmarks",
"pezpallet-revive-fixtures",
"pezpallet-timestamp/runtime-benchmarks",
"pezpallet-transaction-payment/runtime-benchmarks",
"pezpallet-utility/runtime-benchmarks",
"pezsp-api/runtime-benchmarks",
"pezsp-consensus-aura",
"pezsp-consensus-aura?/runtime-benchmarks",
"pezsp-consensus-babe",
"pezsp-consensus-babe?/runtime-benchmarks",
"pezsp-consensus-slots",
"pezsp-consensus-slots?/runtime-benchmarks",
"pezsp-io/runtime-benchmarks",
"pezsp-runtime/runtime-benchmarks",
"pezsp-state-machine/runtime-benchmarks",
"pezsp-version/runtime-benchmarks",
"k256",
"pezframe-benchmarking/runtime-benchmarks",
"pezframe-support/runtime-benchmarks",
"pezframe-system/runtime-benchmarks",
"pezpallet-balances/runtime-benchmarks",
"pezpallet-proxy/runtime-benchmarks",
"pezpallet-revive-fixtures",
"pezpallet-timestamp/runtime-benchmarks",
"pezpallet-transaction-payment/runtime-benchmarks",
"pezpallet-utility/runtime-benchmarks",
"pezsp-api/runtime-benchmarks",
"pezsp-consensus-aura",
"pezsp-consensus-aura?/runtime-benchmarks",
"pezsp-consensus-babe",
"pezsp-consensus-babe?/runtime-benchmarks",
"pezsp-consensus-slots",
"pezsp-consensus-slots?/runtime-benchmarks",
"pezsp-io/runtime-benchmarks",
"pezsp-runtime/runtime-benchmarks",
"pezsp-state-machine/runtime-benchmarks",
"pezsp-version/runtime-benchmarks",
]
try-runtime = [
"pezframe-support/try-runtime",
"pezframe-system/try-runtime",
"pezpallet-balances/try-runtime",
"pezpallet-proxy/try-runtime",
"pezpallet-timestamp/try-runtime",
"pezpallet-transaction-payment/try-runtime",
"pezpallet-utility/try-runtime",
"pezsp-runtime/try-runtime",
"pezframe-support/try-runtime",
"pezframe-system/try-runtime",
"pezpallet-balances/try-runtime",
"pezpallet-proxy/try-runtime",
"pezpallet-timestamp/try-runtime",
"pezpallet-transaction-payment/try-runtime",
"pezpallet-utility/try-runtime",
"pezsp-runtime/try-runtime",
]
@@ -27,24 +27,24 @@ jsonrpsee = { features = ["server"], workspace = true }
# Direct dependency needed (not through umbrella due to macro visibility issues)
pezsp-runtime = { workspace = true }
pezkuwi-sdk = { workspace = true, features = [
"experimental",
"node",
"pezsp-core",
"pezsp-io",
"pezsp-genesis-builder",
"pezsp-block-builder",
"pezsp-timestamp",
] }
pez-revive-dev-runtime = { workspace = true }
pezkuwi-sdk = { workspace = true, features = [
"experimental",
"node",
"pezsp-block-builder",
"pezsp-core",
"pezsp-genesis-builder",
"pezsp-io",
"pezsp-timestamp",
] }
[build-dependencies]
pezkuwi-sdk = { workspace = true, features = ["bizinikiwi-build-script-utils"] }
[features]
default = ["std"]
std = ["pezkuwi-sdk/std", "pez-revive-dev-runtime/std"]
std = ["pez-revive-dev-runtime/std", "pezkuwi-sdk/std"]
runtime-benchmarks = [
"pezkuwi-sdk/runtime-benchmarks",
"pez-revive-dev-runtime/runtime-benchmarks",
"pez-revive-dev-runtime/runtime-benchmarks",
"pezkuwi-sdk/runtime-benchmarks",
]
@@ -13,40 +13,40 @@ documentation = "https://docs.rs/pez-revive-dev-runtime"
array-bytes = { workspace = true }
codec = { workspace = true }
pezkuwi-sdk = { workspace = true, features = [
"pezpallet-balances",
"pezpallet-revive",
"pezpallet-sudo",
"pezpallet-timestamp",
"pezpallet-transaction-payment",
"pezpallet-transaction-payment-rpc-runtime-api",
"pezkuwi-runtime-common",
"pezsp-api",
"pezsp-keyring",
"pezsp-weights",
"runtime",
"teyrchains-common",
"with-tracing",
"pezkuwi-runtime-common",
"pezpallet-balances",
"pezpallet-revive",
"pezpallet-sudo",
"pezpallet-timestamp",
"pezpallet-transaction-payment",
"pezpallet-transaction-payment-rpc-runtime-api",
"pezsp-api",
"pezsp-keyring",
"pezsp-weights",
"runtime",
"teyrchains-common",
"with-tracing",
] }
pezsp-debug-derive = { workspace = true, features = ["force-debug"] }
pezsp-runtime = { workspace = true }
scale-info = { workspace = true }
serde_json = { workspace = true, default-features = false, features = [
"alloc",
"alloc",
] }
pezsp-debug-derive = { workspace = true, features = ["force-debug"] }
[build-dependencies]
pezkuwi-sdk = { optional = true, workspace = true, features = [
"bizinikiwi-wasm-builder",
"bizinikiwi-wasm-builder",
] }
[features]
default = ["std"]
std = [
"codec/std",
"pezkuwi-sdk/std",
"pezsp-runtime/std",
"scale-info/std",
"serde_json/std",
"pezsp-debug-derive/std",
"codec/std",
"pezkuwi-sdk/std",
"pezsp-debug-derive/std",
"pezsp-runtime/std",
"scale-info/std",
"serde_json/std",
]
runtime-benchmarks = ["pezkuwi-sdk/runtime-benchmarks"]
@@ -79,23 +79,23 @@ pub mod genesis_config_presets {
Sr25519Keyring::well_known()
.map(|k| k.to_account_id())
.chain([
// subxt_signer::eth::dev::alith()
// pezkuwi_subxt_signer::eth::dev::alith()
array_bytes::hex_n_into_unchecked(
"f24ff3a9cf04c71dbc94d0b566f7a27b94566caceeeeeeeeeeeeeeeeeeeeeeee",
),
// subxt_signer::eth::dev::baltathar()
// pezkuwi_subxt_signer::eth::dev::baltathar()
array_bytes::hex_n_into_unchecked(
"3cd0a705a2dc65e5b1e1205896baa2be8a07c6e0eeeeeeeeeeeeeeeeeeeeeeee",
),
// subxt_signer::eth::dev::charleth()
// pezkuwi_subxt_signer::eth::dev::charleth()
array_bytes::hex_n_into_unchecked(
"798d4ba9baf0064ec19eb4f0a1a45785ae9d6dfceeeeeeeeeeeeeeeeeeeeeeee",
),
// subxt_signer::eth::dev::dorothy()
// pezkuwi_subxt_signer::eth::dev::dorothy()
array_bytes::hex_n_into_unchecked(
"773539d4ac0e786233d90a233654ccee26a613d9eeeeeeeeeeeeeeeeeeeeeeee",
),
// subxt_signer::eth::dev::ethan()
// pezkuwi_subxt_signer::eth::dev::ethan()
array_bytes::hex_n_into_unchecked(
"ff64d3f6efe2317ee2807d223a0bdc4c0c49dfdbeeeeeeeeeeeeeeeeeeeeeeee",
),
@@ -19,7 +19,7 @@ workspace = true
[dependencies]
alloy-core = { workspace = true, default-features = true, features = [
"sol-types",
"sol-types",
], optional = true }
anyhow = { workspace = true, default-features = true, optional = true }
pezsp-core = { workspace = true, default-features = true, optional = true }
@@ -38,10 +38,10 @@ toml = { workspace = true }
default = ["std"]
# only when std is enabled all fixtures are available
std = [
"alloy-core",
"anyhow",
"hex/std",
"serde_json/std",
"pezsp-core",
"pezsp-io",
"alloy-core",
"anyhow",
"hex/std",
"pezsp-core",
"pezsp-io",
"serde_json/std",
]
@@ -13,7 +13,7 @@ edition = "2021"
# All paths are injected dynamically by the build script.
[dependencies]
uapi = { package = 'pezpallet-revive-uapi', features = [
"unstable-hostfn",
"unstable-hostfn",
], default-features = false }
hex-literal = { version = "0.4.1", default-features = false }
polkavm-derive = { version = "0.27.0" }
+23 -23
View File
@@ -28,18 +28,14 @@ futures = { workspace = true, features = ["thread-pool"] }
hex = { workspace = true }
jsonrpsee = { workspace = true, features = ["full"] }
log = { workspace = true }
pezkuwi-subxt = { workspace = true, default-features = true, features = [
"reconnecting-rpc-client",
] }
pezpallet-revive = { workspace = true, default-features = true }
prometheus-endpoint = { workspace = true, default-features = true }
rlp = { workspace = true }
pezsc-cli = { workspace = true, default-features = true }
pezsc-rpc = { workspace = true, default-features = true }
pezsc-rpc-api = { workspace = true, default-features = true }
pezsc-service = { workspace = true, default-features = true }
serde = { workspace = true, default-features = true, features = [
"alloc",
"derive",
] }
serde_json = { workspace = true }
pezsp-arithmetic = { workspace = true, default-features = true }
pezsp-core = { workspace = true, default-features = true }
pezsp-crypto-hashing = { workspace = true }
@@ -47,20 +43,24 @@ pezsp-rpc = { workspace = true, default-features = true }
pezsp-runtime = { workspace = true, default-features = true }
pezsp-timestamp = { workspace = true }
pezsp-weights = { workspace = true, default-features = true }
sqlx = { workspace = true, features = ["macros", "runtime-tokio", "sqlite"] }
pezkuwi-subxt = { workspace = true, default-features = true, features = [
"reconnecting-rpc-client",
prometheus-endpoint = { workspace = true, default-features = true }
rlp = { workspace = true }
serde = { workspace = true, default-features = true, features = [
"alloc",
"derive",
] }
subxt-signer = { workspace = true, features = ["unstable-eth"] }
serde_json = { workspace = true }
sqlx = { workspace = true, features = ["macros", "runtime-tokio", "sqlite"] }
pezkuwi-subxt-signer = { workspace = true, features = ["unstable-eth"] }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["full"] }
[dev-dependencies]
env_logger = { workspace = true }
pezpallet-revive-fixtures = { workspace = true, default-features = true }
pretty_assertions = { workspace = true }
pez-revive-dev-node = { workspace = true }
pezpallet-revive-fixtures = { workspace = true, default-features = true }
pezsp-io = { workspace = true, default-features = true }
pretty_assertions = { workspace = true }
[build-dependencies]
git2 = { workspace = true }
@@ -70,14 +70,14 @@ pezsp-runtime = { workspace = true, default-features = true }
[features]
runtime-benchmarks = [
"pezpallet-revive/runtime-benchmarks",
"pez-revive-dev-node/runtime-benchmarks",
"pez-revive-dev-runtime/runtime-benchmarks",
"pezsc-cli/runtime-benchmarks",
"pezsc-rpc-api/runtime-benchmarks",
"pezsc-rpc/runtime-benchmarks",
"pezsc-service/runtime-benchmarks",
"pezsp-io/runtime-benchmarks",
"pezsp-runtime/runtime-benchmarks",
"pezsp-timestamp/runtime-benchmarks",
"pez-revive-dev-node/runtime-benchmarks",
"pez-revive-dev-runtime/runtime-benchmarks",
"pezpallet-revive/runtime-benchmarks",
"pezsc-cli/runtime-benchmarks",
"pezsc-rpc-api/runtime-benchmarks",
"pezsc-rpc/runtime-benchmarks",
"pezsc-service/runtime-benchmarks",
"pezsp-io/runtime-benchmarks",
"pezsp-runtime/runtime-benchmarks",
"pezsp-timestamp/runtime-benchmarks",
]
@@ -18,8 +18,8 @@ use pezpallet_revive_eth_rpc::subxt_client::{
self, revive::calls::types::InstantiateWithCode, SrcChainConfig,
};
use pezsp_weights::Weight;
use subxt::OnlineClient;
use subxt_signer::sr25519::dev;
use pezkuwi_subxt::OnlineClient;
use pezkuwi_subxt_signer::sr25519::dev;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -15,8 +15,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use pezpallet_revive_eth_rpc::subxt_client::{self, system::calls::types::Remark, SrcChainConfig};
use subxt::OnlineClient;
use subxt_signer::sr25519::dev;
use pezkuwi_subxt::OnlineClient;
use pezkuwi_subxt_signer::sr25519::dev;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -25,7 +25,7 @@ async fn main() -> anyhow::Result<()> {
let alith = Account::default();
let alith_address = alith.address();
let ethan = Account::from(subxt_signer::eth::dev::ethan());
let ethan = Account::from(pezkuwi_subxt_signer::eth::dev::ethan());
let value = 1_000_000_000_000_000_000_000u128.into();
let print_balance = || async {
@@ -21,9 +21,9 @@ use crate::{
ClientError,
};
use jsonrpsee::core::async_trait;
use pezkuwi_subxt::{backend::legacy::LegacyRpcMethods, OnlineClient};
use pezsp_core::H256;
use std::sync::Arc;
use pezkuwi_subxt::{backend::legacy::LegacyRpcMethods, OnlineClient};
use tokio::sync::RwLock;
/// BlockInfoProvider cache and retrieves information about blocks.
+5 -5
View File
@@ -254,11 +254,11 @@ fn rpc_module(is_dev: bool, client: Client) -> Result<RpcModule<()>, pezsc_servi
let eth_api = EthRpcServerImpl::new(client.clone())
.with_accounts(if is_dev {
vec![
crate::Account::from(subxt_signer::eth::dev::alith()),
crate::Account::from(subxt_signer::eth::dev::baltathar()),
crate::Account::from(subxt_signer::eth::dev::charleth()),
crate::Account::from(subxt_signer::eth::dev::dorothy()),
crate::Account::from(subxt_signer::eth::dev::ethan()),
crate::Account::from(pezkuwi_subxt_signer::eth::dev::alith()),
crate::Account::from(pezkuwi_subxt_signer::eth::dev::baltathar()),
crate::Account::from(pezkuwi_subxt_signer::eth::dev::charleth()),
crate::Account::from(pezkuwi_subxt_signer::eth::dev::dorothy()),
crate::Account::from(pezkuwi_subxt_signer::eth::dev::ethan()),
]
} else {
vec![]
+14 -13
View File
@@ -26,6 +26,18 @@ use crate::{
TracerType, TransactionInfo,
};
use jsonrpsee::types::{error::CALL_EXECUTION_FAILED_CODE, ErrorObjectOwned};
use pezkuwi_subxt::{
backend::{
legacy::{rpc_methods::SystemHealth, LegacyRpcMethods},
rpc::{
reconnecting_rpc_client::{ExponentialBackoff, RpcClient as ReconnectingRpcClient},
RpcClient,
},
},
config::{HashFor, Header},
ext::pezkuwi_subxt_rpcs::rpc_params,
Config, OnlineClient,
};
use pezpallet_revive::{
evm::{
decode_revert_reason, Block, BlockNumberOrTag, BlockNumberOrTagOrHash, FeeHistoryResult,
@@ -39,23 +51,12 @@ use pezsp_weights::Weight;
use runtime_api::RuntimeApi;
use std::{ops::Range, sync::Arc, time::Duration};
use storage_api::StorageApi;
use pezkuwi_subxt::{
backend::{
legacy::{rpc_methods::SystemHealth, LegacyRpcMethods},
rpc::{
reconnecting_rpc_client::{ExponentialBackoff, RpcClient as ReconnectingRpcClient},
RpcClient,
},
},
config::{HashFor, Header},
ext::pezkuwi_subxt_rpcs::rpc_params,
Config, OnlineClient,
};
use thiserror::Error;
use tokio::sync::Mutex;
/// The bizinikiwi block type.
pub type BizinikiwiBlock = pezkuwi_subxt::blocks::Block<SrcChainConfig, OnlineClient<SrcChainConfig>>;
pub type BizinikiwiBlock =
pezkuwi_subxt::blocks::Block<SrcChainConfig, OnlineClient<SrcChainConfig>>;
/// The bizinikiwi block header.
pub type BizinikiwiBlockHeader = <SrcChainConfig as Config>::Header;
@@ -21,6 +21,7 @@ use crate::{
ClientError,
};
use futures::TryFutureExt;
use pezkuwi_subxt::{error::RuntimeApiError, OnlineClient};
use pezpallet_revive::{
evm::{
Block as EthBlock, BlockNumberOrTagOrHash, BlockTag, GenericTransaction, ReceiptGasInfo,
@@ -30,16 +31,14 @@ use pezpallet_revive::{
};
use pezsp_core::H256;
use pezsp_timestamp::Timestamp;
use pezkuwi_subxt::{
error::RuntimeApiError,
OnlineClient,
};
const LOG_TARGET: &str = "eth-rpc::runtime_api";
/// A Wrapper around subxt Runtime API
#[derive(Clone)]
pub struct RuntimeApi(pezkuwi_subxt::runtime_api::RuntimeApi<SrcChainConfig, OnlineClient<SrcChainConfig>>);
pub struct RuntimeApi(
pezkuwi_subxt::runtime_api::RuntimeApi<SrcChainConfig, OnlineClient<SrcChainConfig>>,
);
impl RuntimeApi {
/// Create a new instance.
@@ -28,11 +28,14 @@ use pezsp_core::H256;
/// A wrapper around the Bizinikiwi Storage API.
#[derive(Clone)]
pub struct StorageApi(StorageClientAt<SrcChainConfig, OnlineClient<SrcChainConfig>>, H256);
pub struct StorageApi(StorageClientAt<SrcChainConfig, OnlineClient<SrcChainConfig>>, #[expect(dead_code)] H256);
impl StorageApi {
/// Create a new instance of the StorageApi.
pub fn new(api: StorageClientAt<SrcChainConfig, OnlineClient<SrcChainConfig>>, block_hash: H256) -> Self {
pub fn new(
api: StorageClientAt<SrcChainConfig, OnlineClient<SrcChainConfig>>,
block_hash: H256,
) -> Self {
Self(api, block_hash)
}
@@ -45,12 +48,16 @@ impl StorageApi {
let contract_address: pezkuwi_subxt::utils::H160 = contract_address.0.into();
let query = subxt_client::storage().revive().account_info_of();
let Some(storage_value) = self.0.try_fetch(query, (contract_address,)).await
let Some(storage_value) = self
.0
.try_fetch(query, (contract_address,))
.await
.map_err(|e| ClientError::SubxtError(e.into()))?
else {
return Err(ClientError::ContractNotFound);
};
let info = storage_value.decode()
let info = storage_value
.decode()
.map_err(|e| ClientError::SubxtError(pezkuwi_subxt::Error::from(e)))?;
let AccountType::Contract(contract_info) = info.account_type else {
@@ -208,7 +208,7 @@ impl<Client: EthRpcClient + Send + Sync> TransactionBuilder<Client> {
#[test]
fn test_dummy_payload_has_correct_len() {
let signer = Account::from(subxt_signer::eth::dev::ethan());
let signer = Account::from(pezkuwi_subxt_signer::eth::dev::ethan());
let unsigned_tx: TransactionUnsigned =
TransactionLegacyUnsigned { input: vec![42u8; 100].into(), ..Default::default() }.into();
@@ -27,13 +27,13 @@ use crate::{
};
use futures::{stream, StreamExt};
use pezkuwi_subxt::{blocks::ExtrinsicDetails, OnlineClient};
use pezpallet_revive::{
create1,
evm::{GenericTransaction, Log, ReceiptGasInfo, ReceiptInfo, TransactionSigned, H256, U256},
};
use pezsp_core::keccak_256;
use std::{future::Future, pin::Pin, sync::Arc};
use pezkuwi_subxt::{blocks::ExtrinsicDetails, OnlineClient};
type FetchReceiptDataFn = Arc<
dyn Fn(H256) -> Pin<Box<dyn Future<Output = Option<Vec<ReceiptGasInfo>>> + Send>> + Send + Sync,
@@ -147,7 +147,10 @@ impl ReceiptExtractor {
&self,
bizinikiwi_block: &BizinikiwiBlock,
eth_block_hash: H256,
ext: pezkuwi_subxt::blocks::ExtrinsicDetails<SrcChainConfig, pezkuwi_subxt::OnlineClient<SrcChainConfig>>,
ext: pezkuwi_subxt::blocks::ExtrinsicDetails<
SrcChainConfig,
pezkuwi_subxt::OnlineClient<SrcChainConfig>,
>,
call: EthTransact,
receipt_gas_info: ReceiptGasInfo,
transaction_index: usize,
@@ -17,7 +17,7 @@
//! The generated subxt client.
//! Generated against a bizinikiwi chain configured with [`pezpallet_revive`] using:
//! subxt metadata --url ws://localhost:9944 -o rpc/revive_chain.scale
pub use pezkuwi_subxt::config::PolkadotConfig as SrcChainConfig;
pub use pezkuwi_subxt::PezkuwiConfig as SrcChainConfig;
#[pezkuwi_subxt::subxt(
runtime_metadata_path = "revive_chain.scale",
+23 -21
View File
@@ -30,6 +30,12 @@ use crate::{
use anyhow::anyhow;
use clap::Parser;
use jsonrpsee::ws_client::{WsClient, WsClientBuilder};
use pezkuwi_subxt::{
backend::rpc::RpcClient,
ext::pezkuwi_subxt_rpcs::rpc_params,
tx::{SubmittableTransaction, TxStatus},
OnlineClient,
};
use pezpallet_revive::{
create1,
evm::{
@@ -38,12 +44,6 @@ use pezpallet_revive::{
},
};
use std::{sync::Arc, thread};
use pezkuwi_subxt::{
backend::rpc::RpcClient,
ext::pezkuwi_subxt_rpcs::rpc_params,
tx::{SubmittableTransaction, TxStatus},
OnlineClient,
};
const LOG_TARGET: &str = "eth-rpc-tests";
@@ -148,7 +148,7 @@ async fn prepare_evm_transactions<Client: EthRpcClient + Sync + Send>(
/// Prepare multiple Bizinikiwi transfer transactions with sequential nonces
async fn prepare_bizinikiwi_transactions(
node_client: &OnlineClient<SrcChainConfig>,
signer: &subxt_signer::sr25519::Keypair,
signer: &pezkuwi_subxt_signer::sr25519::Keypair,
count: usize,
) -> anyhow::Result<Vec<SubmittableTransaction<SrcChainConfig, OnlineClient<SrcChainConfig>>>> {
let mut nonce = node_client.tx().account_nonce(&signer.public_key().into()).await?;
@@ -161,8 +161,8 @@ async fn prepare_bizinikiwi_transactions(
vec![pezkuwi_subxt::dynamic::Value::from_bytes(remark_data.as_bytes())],
);
// Note: Using polkadot config from subxt (external crate)
let params = pezkuwi_subxt::config::polkadot::PolkadotExtrinsicParamsBuilder::new()
// Note: Using pezkuwi config from subxt (external crate)
let params = pezkuwi_subxt::config::pezkuwi::PezkuwiExtrinsicParamsBuilder::new()
.nonce(nonce)
.build();
@@ -305,7 +305,7 @@ async fn run_all_eth_rpc_tests() -> anyhow::Result<()> {
}
async fn test_transfer(client: Arc<WsClient>) -> anyhow::Result<()> {
let ethan = Account::from(subxt_signer::eth::dev::ethan());
let ethan = Account::from(pezkuwi_subxt_signer::eth::dev::ethan());
let initial_balance = client.get_balance(ethan.address(), BlockTag::Latest.into()).await?;
let value = 1_000_000_000_000_000_000_000u128.into();
@@ -332,7 +332,7 @@ async fn test_deploy_and_call(client: Arc<WsClient>) -> anyhow::Result<()> {
let account = Account::default();
// Balance transfer
let ethan = Account::from(subxt_signer::eth::dev::ethan());
let ethan = Account::from(pezkuwi_subxt_signer::eth::dev::ethan());
let initial_balance = client.get_balance(ethan.address(), BlockTag::Latest.into()).await?;
let value = 1_000_000_000_000_000_000_000u128.into();
let tx = TransactionBuilder::new(&client).value(value).to(ethan.address()).send().await?;
@@ -446,7 +446,7 @@ async fn test_runtime_api_dry_run_addr_works(client: Arc<WsClient>) -> anyhow::R
}
async fn test_invalid_transaction(client: Arc<WsClient>) -> anyhow::Result<()> {
let ethan = Account::from(subxt_signer::eth::dev::ethan());
let ethan = Account::from(pezkuwi_subxt_signer::eth::dev::ethan());
let err = TransactionBuilder::new(&client)
.value(U256::from(1_000_000_000_000u128))
@@ -473,8 +473,9 @@ async fn get_evm_block_from_storage(
.unwrap();
let query = subxt_client::storage().revive().ethereum_block();
let Some(block) = node_client.storage().at(block_hash).fetch(&query).await.unwrap() else {
return Err(anyhow!("EVM block {block_hash:?} not found"));
let block = match node_client.storage().at(block_hash).fetch(&query, ()).await {
Ok(value) => value.decode()?,
Err(_) => return Err(anyhow!("EVM block {block_hash:?} not found")),
};
Ok(block.0)
}
@@ -664,7 +665,7 @@ async fn test_block_hash_for_tag_with_block_tags_works(
async fn test_multiple_transactions_in_block(client: Arc<WsClient>) -> anyhow::Result<()> {
let num_transactions = 20;
let alith = Account::default();
let ethan = Account::from(subxt_signer::eth::dev::ethan());
let ethan = Account::from(pezkuwi_subxt_signer::eth::dev::ethan());
let amount = U256::from(1_000_000_000_000_000_000u128);
// Prepare EVM transfer transactions
@@ -689,7 +690,7 @@ async fn test_mixed_evm_bizinikiwi_transactions(client: Arc<WsClient>) -> anyhow
let num_bizinikiwi_txs = 7;
let alith = Account::default();
let ethan = Account::from(subxt_signer::eth::dev::ethan());
let ethan = Account::from(pezkuwi_subxt_signer::eth::dev::ethan());
let amount = U256::from(500_000_000_000_000_000u128);
// Prepare EVM transactions
@@ -699,7 +700,7 @@ async fn test_mixed_evm_bizinikiwi_transactions(client: Arc<WsClient>) -> anyhow
// Prepare bizinikiwi transactions (simple remarks)
log::trace!(target: LOG_TARGET, "Creating {num_bizinikiwi_txs} bizinikiwi remark transactions");
let alice_signer = subxt_signer::sr25519::dev::alice();
let alice_signer = pezkuwi_subxt_signer::sr25519::dev::alice();
let (node_client, _, _) = client::connect(SharedResources::pez_node_rpc_url()).await.unwrap();
let bizinikiwi_txs =
@@ -777,11 +778,12 @@ async fn test_runtime_pallets_address_upload_code(client: Arc<WsClient>) -> anyh
// Step 5: Verify the code was actually uploaded
let code_hash = H256(pezsp_io::hashing::keccak_256(&bytecode));
let query = subxt_client::storage().revive().pristine_code(code_hash);
let query = subxt_client::storage().revive().pristine_code();
let block_hash: pezsp_core::H256 = get_bizinikiwi_block_hash(receipt.block_number).await?;
let stored_code = node_client.storage().at(block_hash).fetch(&query).await?;
assert!(stored_code.is_some(), "Code with hash {code_hash:?} should exist in storage");
assert_eq!(stored_code.unwrap(), bytecode, "Stored code should match the uploaded bytecode");
let stored_code: Vec<u8> = node_client.storage().at(block_hash).fetch(&query, (code_hash,)).await
.expect("Code with hash should exist in storage")
.decode()?;
assert_eq!(stored_code, bytecode, "Stored code should match the uploaded bytecode");
Ok(())
}
@@ -23,16 +23,16 @@ use pezsp_runtime::AccountId32;
/// A simple account that can sign transactions
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Account(subxt_signer::eth::Keypair);
pub struct Account(pezkuwi_subxt_signer::eth::Keypair);
impl Default for Account {
fn default() -> Self {
Self(subxt_signer::eth::dev::alith())
Self(pezkuwi_subxt_signer::eth::dev::alith())
}
}
impl From<subxt_signer::eth::Keypair> for Account {
fn from(kp: subxt_signer::eth::Keypair) -> Self {
impl From<pezkuwi_subxt_signer::eth::Keypair> for Account {
fn from(kp: pezkuwi_subxt_signer::eth::Keypair) -> Self {
Self(kp)
}
}
@@ -40,7 +40,7 @@ impl From<subxt_signer::eth::Keypair> for Account {
impl Account {
/// Create a new account from a secret
pub fn from_secret_key(secret_key: [u8; 32]) -> Self {
subxt_signer::eth::Keypair::from_secret_key(secret_key).unwrap().into()
pezkuwi_subxt_signer::eth::Keypair::from_secret_key(secret_key).unwrap().into()
}
/// Get the [`H160`] address of the account.
@@ -682,7 +682,7 @@ mod test {
gas: U256::from(21000),
nonce: U256::from(1),
gas_price: U256::from("0x640000006a"),
to: Some(Account::from(subxt_signer::eth::dev::baltathar()).address()),
to: Some(Account::from(pezkuwi_subxt_signer::eth::dev::baltathar()).address()),
value: U256::from(123123),
input: Bytes(vec![]),
r#type: TypeLegacy,
+2 -2
View File
@@ -20,8 +20,8 @@ targets = ["riscv64imac-unknown-none-elf"]
alloy-core = { workspace = true, optional = true, features = ["sol-types"] }
bitflags = { workspace = true }
codec = { features = [
"derive",
"max-encoded-len",
"derive",
"max-encoded-len",
], optional = true, workspace = true }
const-crypto = { version = "0.3.0", default-features = false }
hex-literal = { version = "0.4.1", default-features = false }