From c5c0ab8ffe7bcc5d7d39afb4c8f8ada4d44a2a8c Mon Sep 17 00:00:00 2001 From: koushiro Date: Fri, 12 May 2023 22:52:34 +0800 Subject: [PATCH] fix precompile tests --- frame/evm/precompile/curve25519/src/lib.rs | 6 ++---- frame/evm/precompile/dispatch/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/frame/evm/precompile/curve25519/src/lib.rs b/frame/evm/precompile/curve25519/src/lib.rs index 5b6561fb1f..7728e8be0a 100644 --- a/frame/evm/precompile/curve25519/src/lib.rs +++ b/frame/evm/precompile/curve25519/src/lib.rs @@ -55,8 +55,7 @@ impl LinearCostPrecompile for Curve25519Add { while !temp_buf.is_empty() { let mut buf = [0; 32]; buf.copy_from_slice(&temp_buf[0..32]); - let point = CompressedRistretto::from_slice(&buf) - .expect("buf is 32 byte vector so should never fail."); + let point = CompressedRistretto(buf); points.push(point); temp_buf = &temp_buf[32..]; } @@ -96,8 +95,7 @@ impl LinearCostPrecompile for Curve25519ScalarMul { // second 32 bytes is for the compressed ristretto point bytes let mut pt_buf = [0; 32]; pt_buf.copy_from_slice(&input[32..64]); - let point = CompressedRistretto::from_slice(&pt_buf) - .expect("pt_buf is 32 byte vector so should never fail.") + let point = CompressedRistretto(pt_buf) .decompress() .unwrap_or_else(RistrettoPoint::identity); diff --git a/frame/evm/precompile/dispatch/Cargo.toml b/frame/evm/precompile/dispatch/Cargo.toml index 782f3b404f..06ab329ce9 100644 --- a/frame/evm/precompile/dispatch/Cargo.toml +++ b/frame/evm/precompile/dispatch/Cargo.toml @@ -19,7 +19,7 @@ scale-codec = { package = "parity-scale-codec", workspace = true } scale-info = { workspace = true } # Substrate frame-system = { workspace = true, features = ["default"] } -pallet-balances = { workspace = true, features = ["default"] } +pallet-balances = { workspace = true, features = ["default", "insecure_zero_ed"] } pallet-timestamp = { workspace = true, features = ["default"] } pallet-utility = { workspace = true, features = ["default"] } sp-core = { workspace = true, features = ["default"] }