remove unused imports

This commit is contained in:
x
2023-01-05 12:06:44 +01:00
parent 155e7473a4
commit f36747728d
7 changed files with 22 additions and 74 deletions

View File

@@ -17,23 +17,12 @@
*/
use darkfi_sdk::{
crypto::{
pedersen::pedersen_commitment_u64, poseidon_hash, MerkleNode, PublicKey, SecretKey, TokenId,
},
incrementalmerkletree,
incrementalmerkletree::{bridgetree::BridgeTree, Hashable, Tree},
pasta::{
arithmetic::CurveAffine,
group::{
ff::{Field, PrimeField},
Curve,
},
pallas,
},
crypto::{pedersen::pedersen_commitment_u64, poseidon_hash, SecretKey},
pasta::{arithmetic::CurveAffine, group::Curve, pallas},
};
use darkfi_serial::{SerialDecodable, SerialEncodable};
use halo2_proofs::circuit::Value;
use log::{debug, info};
use log::debug;
use rand::rngs::OsRng;
use darkfi::{
@@ -43,7 +32,7 @@ use darkfi::{
vm_stack::Witness,
},
zkas::ZkBinary,
Error, Result,
Result,
};
use super::{propose::Proposal, Dao};

View File

@@ -193,7 +193,7 @@ pub fn build_dao_mint_tx(
gov_token_id: TokenId,
dao_pubkey: &PublicKey,
dao_bulla_blind: pallas::Base,
signature_secret: &SecretKey,
_signature_secret: &SecretKey,
dao_mint_zkbin: &ZkBinary,
dao_mint_pk: &ProvingKey,
) -> Result<(DaoMintParams, Vec<Proof>)> {

View File

@@ -21,13 +21,10 @@ use darkfi_sdk::{
pedersen::pedersen_commitment_u64, poseidon_hash, MerkleNode, PublicKey, SecretKey, TokenId,
},
incrementalmerkletree,
incrementalmerkletree::{bridgetree::BridgeTree, Hashable, Tree},
incrementalmerkletree::Hashable,
pasta::{
arithmetic::CurveAffine,
group::{
ff::{Field, PrimeField},
Curve,
},
group::{ff::Field, Curve},
pallas,
},
};
@@ -42,7 +39,7 @@ use darkfi::{
vm_stack::Witness,
},
zkas::ZkBinary,
Error, Result,
Result,
};
use crate::{

View File

@@ -19,22 +19,19 @@
use darkfi_sdk::{
crypto::{
keypair::Keypair, pedersen::pedersen_commitment_u64, poseidon_hash, MerkleNode, Nullifier,
PublicKey, SecretKey, TokenId,
PublicKey, SecretKey,
},
incrementalmerkletree,
incrementalmerkletree::{bridgetree::BridgeTree, Hashable, Tree},
incrementalmerkletree::Hashable,
pasta::{
arithmetic::CurveAffine,
group::{
ff::{Field, PrimeField},
Curve,
},
group::{ff::Field, Curve},
pallas,
},
};
use darkfi_serial::{SerialDecodable, SerialEncodable};
use halo2_proofs::circuit::Value;
use log::{debug, info};
use log::debug;
use rand::rngs::OsRng;
use darkfi::{
@@ -44,7 +41,7 @@ use darkfi::{
vm_stack::Witness,
},
zkas::ZkBinary,
Error, Result,
Result,
};
use super::{propose::Proposal, Dao};

View File

@@ -16,38 +16,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use chacha20poly1305::{AeadInPlace, ChaCha20Poly1305, KeyInit};
use darkfi::{
consensus::leadcoin::LeadCoin,
zk::{
proof::{Proof, ProvingKey},
vm::ZkCircuit,
vm_stack::Witness,
},
zk::proof::{Proof, ProvingKey},
zkas::ZkBinary,
ClientFailed, Error, Result,
Result,
};
use darkfi_sdk::{
crypto::{
constants::MERKLE_DEPTH,
diffie_hellman::{kdf_sapling, sapling_ka_agree},
pedersen::{pedersen_commitment_base, pedersen_commitment_u64, ValueBlind, ValueCommit},
poseidon_hash, Keypair, MerkleNode, Nullifier, PublicKey, SecretKey, TokenId,
},
crypto::{pedersen::ValueBlind, MerkleNode, PublicKey, SecretKey, TokenId},
incrementalmerkletree,
incrementalmerkletree::{bridgetree::BridgeTree, Hashable, Tree},
pasta::{
arithmetic::CurveAffine,
group::{
ff::{Field, PrimeField},
Curve,
},
pallas,
},
pasta::{group::ff::Field, pallas},
};
use darkfi_serial::{serialize, Decodable, Encodable, SerialDecodable, SerialEncodable};
use halo2_proofs::circuit::Value;
use log::{debug, error, info};
use rand::rngs::OsRng;
use darkfi_money_contract::{

View File

@@ -33,7 +33,7 @@ use darkfi::{
use darkfi_sdk::{
crypto::{
contract_id::{DAO_CONTRACT_ID, MONEY_CONTRACT_ID},
ContractId, Keypair, MerkleTree,
ContractId, Keypair,
},
db::SMART_CONTRACT_ZKAS_DB_NAME,
pasta::group::ff::PrimeField,

View File

@@ -20,13 +20,12 @@ use darkfi::{tx::Transaction, Result};
use darkfi_sdk::{
crypto::{
coin::Coin,
constants::MERKLE_DEPTH,
contract_id::{DAO_CONTRACT_ID, MONEY_CONTRACT_ID},
keypair::Keypair,
pedersen::pedersen_commitment_u64,
poseidon_hash, MerkleNode, SecretKey, TokenId,
},
incrementalmerkletree::{bridgetree::BridgeTree, Tree},
incrementalmerkletree::Tree,
pasta::{
arithmetic::CurveAffine,
group::{ff::Field, Curve, Group},
@@ -48,11 +47,7 @@ use darkfi_dao_contract::{
money_client, note, DaoFunction,
};
use darkfi_money_contract::{
client::{build_half_swap_tx, build_transfer_tx, EncryptedNote, OwnCoin},
state::MoneyTransferParams,
MoneyFunction,
};
use darkfi_money_contract::{client::EncryptedNote, state::MoneyTransferParams, MoneyFunction};
mod harness;
use harness::{init_logger, DaoTestHarness};
@@ -97,9 +92,6 @@ async fn integration_test() -> Result<()> {
let dao_bulla_blind = pallas::Base::random(&mut OsRng);
info!(target: "dao", "[Alice] =========================");
info!(target: "dao", "[Alice] Building Dao::Mint params");
info!(target: "dao", "[Alice] =========================");
let (params, proofs) = build_dao_mint_tx(
dao_proposer_limit,
dao_quorum,
@@ -113,9 +105,6 @@ async fn integration_test() -> Result<()> {
&dao_th.dao_mint_pk,
)?;
info!(target: "dao", "[Alice] ==========================================");
info!(target: "dao", "[Alice] Building Dao::Mint transaction with params");
info!(target: "dao", "[Alice] ==========================================");
let mut data = vec![DaoFunction::Mint as u8];
params.encode(&mut data)?;
let calls = vec![ContractCall { contract_id: dao_th.dao_contract_id, data }];
@@ -124,9 +113,6 @@ async fn integration_test() -> Result<()> {
let sigs = tx.create_sigs(&mut OsRng, &[])?;
tx.signatures = vec![sigs];
info!(target: "dao", "[Alice] ===============================");
info!(target: "dao", "[Alice] Executing Dao::Mint transaction");
info!(target: "dao", "[Alice] ===============================");
dao_th.alice_state.read().await.verify_transactions(&[tx.clone()], true).await?;
// TODO: Witness and add to wallet merkle tree?