Skip to content

Commit

Permalink
improve transfer_v1, simplify the default builder, and provide a lowe…
Browse files Browse the repository at this point in the history
…r level API for constructing more complex calls
  • Loading branch information
xxxxxxxxxxxxx committed Nov 18, 2023
1 parent c54cc71 commit 929b6d0
Show file tree
Hide file tree
Showing 9 changed files with 200 additions and 302 deletions.
2 changes: 1 addition & 1 deletion src/contract/dao/src/client/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use log::debug;
use rand::rngs::OsRng;

use darkfi::{
zk::{export_witness_json, Proof, ProvingKey, Witness, ZkCircuit},
zk::{Proof, ProvingKey, Witness, ZkCircuit},
zkas::ZkBinary,
Result,
};
Expand Down
2 changes: 1 addition & 1 deletion src/contract/dao/src/entrypoint/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ pub(crate) fn dao_exec_get_metadata(
DAO_CONTRACT_ZKAS_DAO_EXEC_NS.to_string(),
vec![
dao_exec_params.proposal.inner(),
money_xfer_params.outputs[1].coin.inner(),
money_xfer_params.outputs[0].coin.inner(),
money_xfer_params.outputs[1].coin.inner(),
*yes_vote_coords.x(),
*yes_vote_coords.y(),
*all_vote_coords.x(),
Expand Down
6 changes: 2 additions & 4 deletions src/contract/dao/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ fn integration_test() -> Result<()> {
&Holder::Dao,
Some(DAO_CONTRACT_ID.inner()), // spend_hook
Some(dao_mint_params.dao_bulla.inner()), // user_data
None,
None,
)?;

for holder in &HOLDERS {
Expand Down Expand Up @@ -317,8 +315,8 @@ fn integration_test() -> Result<()> {
th.assert_trees(&HOLDERS);

// Gather the coins
th.gather_owncoin(&Holder::Dao, &xfer_params.outputs[0], None)?;
th.gather_owncoin(&Holder::Rachel, &xfer_params.outputs[1], None)?;
th.gather_owncoin(&Holder::Rachel, &xfer_params.outputs[0], None)?;
th.gather_owncoin(&Holder::Dao, &xfer_params.outputs[1], None)?;

let rachel_wallet = th.holders.get(&Holder::Rachel).unwrap();
assert!(rachel_wallet.unspent_money_coins[0].note.value == PROPOSAL_AMOUNT);
Expand Down
Loading

0 comments on commit 929b6d0

Please sign in to comment.