mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 22:57:59 -05:00
contract/test-harness: consensus_stake and consensus_unstake use TransactionBuilder properly, updated vks/pks hashes
This commit is contained in:
@@ -30,6 +30,7 @@ use darkfi_money_contract::{
|
||||
};
|
||||
use darkfi_sdk::{
|
||||
crypto::{MerkleNode, SecretKey, CONSENSUS_CONTRACT_ID, MONEY_CONTRACT_ID},
|
||||
dark_tree::DarkTree,
|
||||
pasta::pallas,
|
||||
ContractCall,
|
||||
};
|
||||
@@ -110,10 +111,13 @@ impl TestHarness {
|
||||
|
||||
let mut stake_tx_builder = TransactionBuilder::new(
|
||||
ContractCallLeaf { call: consensus_call, proofs: consensus_stake_proofs },
|
||||
vec![],
|
||||
vec![DarkTree::new(
|
||||
ContractCallLeaf { call: money_call, proofs: money_stake_proofs },
|
||||
vec![],
|
||||
None,
|
||||
None,
|
||||
)],
|
||||
)?;
|
||||
stake_tx_builder
|
||||
.append(ContractCallLeaf { call: money_call, proofs: money_stake_proofs }, vec![])?;
|
||||
let mut stake_tx = stake_tx_builder.build()?;
|
||||
let money_sigs = stake_tx.create_sigs(&mut OsRng, &[money_stake_secret_key])?;
|
||||
let consensus_sigs = stake_tx.create_sigs(&mut OsRng, &[consensus_stake_secret_key])?;
|
||||
|
||||
@@ -32,6 +32,7 @@ use darkfi_money_contract::{
|
||||
};
|
||||
use darkfi_sdk::{
|
||||
crypto::{MerkleNode, SecretKey, CONSENSUS_CONTRACT_ID, MONEY_CONTRACT_ID},
|
||||
dark_tree::DarkTree,
|
||||
ContractCall,
|
||||
};
|
||||
use darkfi_serial::{serialize, Encodable};
|
||||
@@ -104,11 +105,12 @@ impl TestHarness {
|
||||
|
||||
let mut unstake_tx_builder = TransactionBuilder::new(
|
||||
ContractCallLeaf { call: money_call, proofs: money_unstake_proofs },
|
||||
vec![],
|
||||
)?;
|
||||
unstake_tx_builder.append(
|
||||
ContractCallLeaf { call: consensus_call, proofs: consensus_unstake_proofs },
|
||||
vec![],
|
||||
vec![DarkTree::new(
|
||||
ContractCallLeaf { call: consensus_call, proofs: consensus_unstake_proofs },
|
||||
vec![],
|
||||
None,
|
||||
None,
|
||||
)],
|
||||
)?;
|
||||
let mut unstake_tx = unstake_tx_builder.build()?;
|
||||
let consensus_sigs = unstake_tx.create_sigs(&mut OsRng, &[consensus_unstake_secret_key])?;
|
||||
|
||||
@@ -49,8 +49,8 @@ use darkfi_serial::{deserialize, serialize};
|
||||
use log::debug;
|
||||
|
||||
/// Update this if any circuits are changed
|
||||
const VKS_HASH: &str = "da690bdbf157a3e30abc173c69b74400bb032daf0ce6c0cab4c567fe9f0b361e";
|
||||
const PKS_HASH: &str = "a1c446da1c4df1ef26ff3abc41fe010a90452d9063dbf87789a20cdb900b487a";
|
||||
const VKS_HASH: &str = "3f47adca36cd4e17c625d838425793ad7d9ac4ddcc3ed6739add3adb4dfbab8c";
|
||||
const PKS_HASH: &str = "0d3fef220868380aeb9146a9530bd4e9cbe3b7c1d05b20bfe5c8335741367bc8";
|
||||
|
||||
fn pks_path(typ: &str) -> Result<PathBuf> {
|
||||
let output = Command::new("git").arg("rev-parse").arg("--show-toplevel").output()?.stdout;
|
||||
|
||||
Reference in New Issue
Block a user