Skip to content

Commit

Permalink
fix precompile tests
Browse files Browse the repository at this point in the history
  • Loading branch information
koushiro committed May 12, 2023
1 parent 62086ce commit c5c0ab8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions frame/evm/precompile/curve25519/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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..];
}
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/dispatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down

0 comments on commit c5c0ab8

Please sign in to comment.