mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
create zk module
This commit is contained in:
@@ -18,7 +18,7 @@ use darkfi::{
|
||||
util::pedersen_commitment_u64,
|
||||
},
|
||||
serial::Decodable,
|
||||
vm,
|
||||
zk::vm,
|
||||
};
|
||||
|
||||
fn main() -> std::result::Result<(), failure::Error> {
|
||||
|
||||
@@ -27,7 +27,7 @@ use darkfi::{
|
||||
util::pedersen_commitment_u64,
|
||||
},
|
||||
serial::Decodable,
|
||||
vm,
|
||||
zk::vm,
|
||||
};
|
||||
|
||||
fn root(path: [pallas::Base; 32], leaf_pos: u32, leaf: pallas::Base) -> pallas::Base {
|
||||
|
||||
@@ -2,14 +2,12 @@ pub mod blockchain;
|
||||
pub mod circuit;
|
||||
pub mod cli;
|
||||
pub mod crypto;
|
||||
pub mod endian;
|
||||
pub mod net;
|
||||
pub mod rpc;
|
||||
pub mod system;
|
||||
pub mod tx;
|
||||
pub mod types;
|
||||
pub mod vm;
|
||||
pub mod vm_serial;
|
||||
pub mod zk;
|
||||
|
||||
pub mod node;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use futures::prelude::*;
|
||||
|
||||
use crate::{endian, serial::VarInt, Error, Result};
|
||||
use super::{endian, serial::VarInt, Error, Result};
|
||||
|
||||
impl VarInt {
|
||||
pub async fn encode_async<W: AsyncWrite + Unpin>(&self, stream: &mut W) -> Result<usize> {
|
||||
|
||||
@@ -3,10 +3,11 @@ use std::{fs::*, path::PathBuf, time::Instant};
|
||||
use crate::{
|
||||
circuit::MintContract,
|
||||
crypto::proof::{ProvingKey, VerifyingKey},
|
||||
serial::Decodable,
|
||||
vm, Result,
|
||||
zk::vm,
|
||||
};
|
||||
|
||||
use super::{serial::Decodable, Result};
|
||||
|
||||
pub struct ContractLoader {}
|
||||
|
||||
impl ContractLoader {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
pub mod address;
|
||||
pub mod async_serial;
|
||||
pub mod async_util;
|
||||
pub mod endian;
|
||||
pub mod error;
|
||||
pub mod loader;
|
||||
pub mod net_name;
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::{
|
||||
|
||||
use num_bigint::BigUint;
|
||||
|
||||
use crate::{
|
||||
use super::{
|
||||
endian,
|
||||
error::{Error, Result},
|
||||
};
|
||||
|
||||
2
src/zk/mod.rs
Normal file
2
src/zk/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
pub mod vm;
|
||||
pub mod vm_serial;
|
||||
@@ -1,10 +1,10 @@
|
||||
use std::io;
|
||||
|
||||
use super::vm::{ZkBinary, ZkContract, ZkFunctionCall, ZkType};
|
||||
use crate::{
|
||||
error::{Error, Result},
|
||||
impl_vec,
|
||||
serial::{Decodable, Encodable, ReadExt, VarInt},
|
||||
vm::{ZkBinary, ZkContract, ZkFunctionCall, ZkType},
|
||||
};
|
||||
|
||||
impl_vec!((String, ZkType));
|
||||
Reference in New Issue
Block a user