|
@@ -22,10 +22,9 @@ use darkfi::{
|
|
|
zk::circuit::lead_contract::LeadContract,
|
|
zk::circuit::lead_contract::LeadContract,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-
|
|
|
|
|
fn main() {
|
|
fn main() {
|
|
|
let k: u32 = 13;
|
|
let k: u32 = 13;
|
|
|
-
|
|
|
|
|
|
|
+ //
|
|
|
//let lead_pk = ProvingKey::build(k, &LeadContract::default());
|
|
//let lead_pk = ProvingKey::build(k, &LeadContract::default());
|
|
|
//let lead_vk = VerifyingKey::build(k, &LeadContract::default());
|
|
//let lead_vk = VerifyingKey::build(k, &LeadContract::default());
|
|
|
//
|
|
//
|
|
@@ -33,12 +32,7 @@ fn main() {
|
|
|
let epoch_item = EpochItem {
|
|
let epoch_item = EpochItem {
|
|
|
value: 0, //static stake value
|
|
value: 0, //static stake value
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
- //TODO to read eta you need an access to the blockchain proof transaction.
|
|
|
|
|
- //need an emulation of the stakeholder as a node
|
|
|
|
|
- //TODO who should have view of the blockchain if not the stakeholder?
|
|
|
|
|
- // or should the blockchain be a node in itself?
|
|
|
|
|
- // but that doesn't make sense, since each stakeholder might end up with different view of it.
|
|
|
|
|
|
|
+ //
|
|
|
let genesis_data = blake3::hash(b"");
|
|
let genesis_data = blake3::hash(b"");
|
|
|
let db = sled::open("/tmp/darkfi.db").unwrap();
|
|
let db = sled::open("/tmp/darkfi.db").unwrap();
|
|
|
let oc = Blockchain::new(&db, Timestamp::current_time(), genesis_data).unwrap();
|
|
let oc = Blockchain::new(&db, Timestamp::current_time(), genesis_data).unwrap();
|
|
@@ -60,7 +54,7 @@ fn main() {
|
|
|
|
|
|
|
|
// calculate public inputs
|
|
// calculate public inputs
|
|
|
let public_inputs = coin.public_inputs();
|
|
let public_inputs = coin.public_inputs();
|
|
|
-
|
|
|
|
|
|
|
+ //
|
|
|
let prover = MockProver::run(k, &contract, vec![public_inputs]).unwrap();
|
|
let prover = MockProver::run(k, &contract, vec![public_inputs]).unwrap();
|
|
|
//
|
|
//
|
|
|
assert_eq!(prover.verify(), Ok(()));
|
|
assert_eq!(prover.verify(), Ok(()));
|