mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
cargo fmt
This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use darkfi_money_contract::model::CoinParams;
|
||||
use darkfi_sdk::{
|
||||
crypto::{pasta_prelude::*, pedersen_commitment_u64, poseidon_hash, SecretKey},
|
||||
pasta::pallas,
|
||||
};
|
||||
use darkfi_money_contract::model::CoinParams;
|
||||
|
||||
use halo2_proofs::circuit::Value;
|
||||
use log::debug;
|
||||
@@ -32,7 +32,7 @@ use darkfi::{
|
||||
Result,
|
||||
};
|
||||
|
||||
use crate::model::{Dao, DaoProposal, DaoBlindAggregateVote, DaoExecParams, DaoProposalBulla};
|
||||
use crate::model::{Dao, DaoBlindAggregateVote, DaoExecParams, DaoProposal, DaoProposalBulla};
|
||||
|
||||
pub struct DaoExecCall {
|
||||
pub proposal: DaoProposal,
|
||||
@@ -85,8 +85,9 @@ impl DaoExecCall {
|
||||
token_id: self.proposal.token_id,
|
||||
serial: self.user_serial,
|
||||
spend_hook: user_spend_hook,
|
||||
user_data: user_data,
|
||||
}.to_coin();
|
||||
user_data,
|
||||
}
|
||||
.to_coin();
|
||||
debug!("created coin_0 {:?}", coin_0);
|
||||
|
||||
let coin_1 = CoinParams {
|
||||
@@ -96,7 +97,8 @@ impl DaoExecCall {
|
||||
serial: self.dao_serial,
|
||||
spend_hook: self.hook_dao_exec,
|
||||
user_data: dao_bulla.inner(),
|
||||
}.to_coin();
|
||||
}
|
||||
.to_coin();
|
||||
debug!("created coin_1 {:?}", coin_1);
|
||||
|
||||
let yes_vote_commit = pedersen_commitment_u64(self.yes_vote_value, self.yes_vote_blind);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use darkfi_money_contract::model::CoinParams;
|
||||
use darkfi_sdk::{
|
||||
bridgetree,
|
||||
bridgetree::Hashable,
|
||||
@@ -26,7 +27,6 @@ use darkfi_sdk::{
|
||||
pasta::pallas,
|
||||
};
|
||||
use darkfi_serial::{async_trait, SerialDecodable, SerialEncodable};
|
||||
use darkfi_money_contract::model::CoinParams;
|
||||
use rand::rngs::OsRng;
|
||||
|
||||
use darkfi::{
|
||||
@@ -110,7 +110,8 @@ impl DaoProposeCall {
|
||||
serial: note.serial,
|
||||
spend_hook: pallas::Base::ZERO,
|
||||
user_data: pallas::Base::ZERO,
|
||||
}.to_coin();
|
||||
}
|
||||
.to_coin();
|
||||
|
||||
// TODO: We need a generic ZkSet widget to avoid doing this all the time
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use darkfi_money_contract::model::CoinParams;
|
||||
use darkfi_sdk::{
|
||||
bridgetree,
|
||||
bridgetree::Hashable,
|
||||
@@ -26,7 +27,6 @@ use darkfi_sdk::{
|
||||
pasta::pallas,
|
||||
};
|
||||
use darkfi_serial::{async_trait, SerialDecodable, SerialEncodable};
|
||||
use darkfi_money_contract::model::CoinParams;
|
||||
use log::debug;
|
||||
use rand::rngs::OsRng;
|
||||
|
||||
@@ -118,7 +118,8 @@ impl DaoVoteCall {
|
||||
serial: note.serial,
|
||||
spend_hook: pallas::Base::ZERO,
|
||||
user_data: pallas::Base::ZERO,
|
||||
}.to_coin();
|
||||
}
|
||||
.to_coin();
|
||||
|
||||
let merkle_root = {
|
||||
let position: u64 = input.leaf_position.into();
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
use core::str::FromStr;
|
||||
|
||||
use darkfi_sdk::{
|
||||
crypto::{note::AeadEncryptedNote, pasta_prelude::*, MerkleNode, Nullifier, PublicKey, poseidon_hash, TokenId},
|
||||
crypto::{
|
||||
note::AeadEncryptedNote, pasta_prelude::*, poseidon_hash, MerkleNode, Nullifier, PublicKey,
|
||||
TokenId,
|
||||
},
|
||||
error::ContractError,
|
||||
pasta::pallas,
|
||||
};
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
use darkfi::Result;
|
||||
use darkfi_contract_test_harness::{init_logger, Holder, TestHarness};
|
||||
use darkfi_money_contract::model::CoinParams;
|
||||
use darkfi_dao_contract::{
|
||||
client::DaoVoteNote,
|
||||
model::{Dao, DaoBlindAggregateVote},
|
||||
};
|
||||
use darkfi_money_contract::model::CoinParams;
|
||||
use darkfi_sdk::{
|
||||
crypto::{pasta_prelude::Field, pedersen_commitment_u64, DAO_CONTRACT_ID, DARK_TOKEN_ID},
|
||||
pasta::pallas,
|
||||
@@ -179,17 +179,15 @@ fn integration_test() -> Result<()> {
|
||||
info!("[Alice] Building DAO proposal tx");
|
||||
|
||||
// These coins are passed around to all DAO members who verify its validity
|
||||
// They check
|
||||
let coins = vec![
|
||||
CoinParams {
|
||||
public_key: th.holders.get(&Holder::Rachel).unwrap().keypair.public,
|
||||
value: PROPOSAL_AMOUNT,
|
||||
token_id: drk_token_id,
|
||||
serial: pallas::Base::random(&mut OsRng),
|
||||
spend_hook: pallas::Base::ZERO,
|
||||
user_data: pallas::Base::ZERO,
|
||||
}
|
||||
];
|
||||
// They check
|
||||
let coins = vec![CoinParams {
|
||||
public_key: th.holders.get(&Holder::Rachel).unwrap().keypair.public,
|
||||
value: PROPOSAL_AMOUNT,
|
||||
token_id: drk_token_id,
|
||||
serial: pallas::Base::random(&mut OsRng),
|
||||
spend_hook: pallas::Base::ZERO,
|
||||
user_data: pallas::Base::ZERO,
|
||||
}];
|
||||
|
||||
let (propose_tx, propose_params, propose_info) = th.dao_propose(
|
||||
&Holder::Alice,
|
||||
|
||||
Reference in New Issue
Block a user