From 077d083b7026652766bcf155f4d85cfdca2258be Mon Sep 17 00:00:00 2001 From: cong-or Date: Fri, 8 Dec 2023 12:01:25 +0000 Subject: [PATCH] refactor(rm witness check for testing): different clients --- chain-impl-mockchain/Cargo.toml | 2 +- chain-impl-mockchain/src/ledger/ledger.rs | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/chain-impl-mockchain/Cargo.toml b/chain-impl-mockchain/Cargo.toml index da5c5cdd1..e6e768c2f 100644 --- a/chain-impl-mockchain/Cargo.toml +++ b/chain-impl-mockchain/Cargo.toml @@ -32,7 +32,7 @@ rand_chacha = { version = "0.3", optional = true } criterion = { version = "0.3.0", optional = true } rand = "0.8" cryptoxide = "0.4" -ed25519-dalek = "1.0.1" + [features] property-test-api = [ diff --git a/chain-impl-mockchain/src/ledger/ledger.rs b/chain-impl-mockchain/src/ledger/ledger.rs index f5bb7bdb3..90fa47510 100644 --- a/chain-impl-mockchain/src/ledger/ledger.rs +++ b/chain-impl-mockchain/src/ledger/ledger.rs @@ -37,7 +37,7 @@ use crate::{ use chain_addr::{Address, Discrimination, Kind}; use chain_crypto::Verification; use chain_time::{Epoch as TimeEpoch, SlotDuration, TimeEra, TimeFrame, Timeline}; -use ed25519_dalek::{PublicKey, Signature}; + use std::collections::HashSet; use std::mem::swap; use std::sync::Arc; @@ -1879,9 +1879,9 @@ fn match_identifier_witness<'a>( fn input_single_account_verify<'a>( mut ledger: account::Ledger, _block0_hash: &HeaderId, - sign_data_hash: &TransactionSignDataHash, + _sign_data_hash: &TransactionSignDataHash, account: &account::Identifier, - witness: &'a account::Witness, + _witness: &'a account::Witness, spending_counter: account::SpendingCounter, value: Value, ) -> Result { @@ -1889,15 +1889,6 @@ fn input_single_account_verify<'a>( let new_ledger = ledger.remove_value(account, spending_counter, value)?; ledger = new_ledger; - let mut sig = witness.as_ref().to_vec(); - sig.drain(0..5); - let witness_sig = Signature::from_bytes(&sig).unwrap(); - - let pk = PublicKey::from_bytes(account.as_ref().as_ref()).unwrap(); - - pk.verify_strict(sign_data_hash.as_ref(), &witness_sig) - .unwrap(); - Ok(ledger) }