Skip to content

Commit

Permalink
triple_masking dependencies to develop (#926)
Browse files Browse the repository at this point in the history
* dependencies to develop

* update wasm-bindgen

* remove noah

* strike build_record_and_get_blinds

---------

Co-authored-by: shaorongqiang <shaorongqiang@aliyun.com>
Co-authored-by: weikengchen <w.k@berkeley.edu>
  • Loading branch information
3 people committed Apr 23, 2023
1 parent 9a94ff1 commit 66b1d4e
Show file tree
Hide file tree
Showing 56 changed files with 437 additions and 575 deletions.
2 changes: 1 addition & 1 deletion container/Dockerfile-wallet_mobile-lib_android
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ FROM rust:1.66.0-slim
RUN apt update -y && apt upgrade -y && apt install -y unzip wget make pkg-config
RUN wget -nc -P /opt/ https://www.openssl.org/source/openssl-1.1.1s.tar.gz
RUN wget -nc -P /opt/ https://dl.google.com/android/repository/android-ndk-r25c-linux.zip && unzip /opt/android-ndk-r25c-linux.zip -d /opt/
ENV PATH="/opt/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATHTMP"

ENV PATHTMP="$PATH"
ENV PATH="/opt/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATHTMP"
ENV WORK_DIR /platform

ENV ANDROID_NDK_HOME /opt/android-ndk-r25c/
Expand Down
8 changes: 3 additions & 5 deletions src/components/abciapp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,14 @@ percent-encoding = "2.1.0"

nix = "0.22.1"

noah = { git = "https://github.com/FindoraNetwork/noah", tag = "v0.4.3" }
noah-algebra = { git = "https://github.com/FindoraNetwork/noah", tag = "v0.4.3" }
ruc = { version = "1.0.5", default-features = false, features = ["compact"] }
abci = { git = "https://github.com/FindoraNetwork/tendermint-abci", tag = "0.7.6" }
config = { path = "../config"}
ledger = { path = "../../ledger" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }

globutils = { git = "https://github.com/shaorongqiang/platform-lib-utils", branch = "main" }
cryptohash = { git = "https://github.com/shaorongqiang/platform-lib-cryptohash", branch = "main" }
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "develop" }
cryptohash = { git = "https://github.com/FindoraNetwork/platform-lib-cryptohash", branch = "develop" }

finutils = { path = "../finutils" }

Expand Down
2 changes: 1 addition & 1 deletion src/components/abciapp/src/abci/server/callback/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
use {
abci::{Event, Pair},
ledger::data_model::{Operation, Transaction, TxnSID},
noah::xfr::structs::{XfrAmount, XfrAssetType},
protobuf::RepeatedField,
serde::Serialize,
std::time::SystemTime,
zei::noah_api::xfr::structs::{XfrAmount, XfrAssetType},
};

/// generate attr(tags) for index-ops of tendermint
Expand Down
8 changes: 4 additions & 4 deletions src/components/abciapp/src/abci/staking/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ use {
store::LedgerState,
utils::fra_gen_initial_tx,
},
noah::xfr::{
asset_record::{open_blind_asset_record, AssetRecordType},
structs::{AssetRecordTemplate, XfrAmount},
},
rand::random,
rand_chacha::ChaChaRng,
rand_core::SeedableRng,
ruc::*,
zei::noah_api::xfr::{
asset_record::{open_blind_asset_record, AssetRecordType},
structs::{AssetRecordTemplate, XfrAmount},
},
zei::{XfrKeyPair, XfrPublicKey},
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/abciapp/src/api/query_server/query_api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ use {
},
},
ledger_api::*,
noah::anon_xfr::structs::{AxfrOwnerMemo, Commitment, MTLeafInfo},
noah_algebra::serialization::NoahFromToBytes,
parking_lot::RwLock,
ruc::*,
serde::{Deserialize, Serialize},
Expand All @@ -35,6 +33,8 @@ use {
sync::Arc,
},
tracing::info,
zei::noah_algebra::serialization::NoahFromToBytes,
zei::noah_api::anon_xfr::structs::{AxfrOwnerMemo, Commitment, MTLeafInfo},
zei::{OwnerMemo, XfrPublicKey},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ use {
staking::{ops::mint_fra::MintEntry, BlockHeight},
store::LedgerState,
},
noah::anon_xfr::structs::{AxfrOwnerMemo, Commitment, MTLeafInfo},
parking_lot::{Condvar, Mutex, RwLock},
ruc::*,
std::{collections::HashSet, sync::Arc},
zei::noah_api::anon_xfr::structs::{AxfrOwnerMemo, Commitment, MTLeafInfo},
zei::OwnerMemo,
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ serde_json = "1.0"
serde-strz = "1.1.1"
toml = "0.5.8"

globutils = { git = "https://github.com/shaorongqiang/platform-lib-utils", branch = "main" }
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "develop" }

[target.'cfg(target_os= "linux")'.dependencies]
btm = "0.1.6"
Expand Down
3 changes: 1 addition & 2 deletions src/components/contracts/modules/account/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ fp-traits = { path = "../../primitives/traits" }
fp-types = { path = "../../primitives/types" }
enterprise-web3 = { path = "../../primitives/enterprise-web3" }
config = { path = "../../../config"}
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }

[dev-dependencies]
rand_chacha = "0.3"
parking_lot = "0.12"
noah = { git = "https://github.com/FindoraNetwork/noah", tag = "v0.4.3" }
fin_db = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.4" }
storage = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.4" }
4 changes: 1 addition & 3 deletions src/components/contracts/modules/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ serde_json = "1.0.64"
sha3 = { version = "0.10", default-features = false }
hex = "0.4.2"
ethabi = "17.1.0"
noah = { git = "https://github.com/FindoraNetwork/noah", tag = "v0.4.3" }
noah-algebra = { git = "https://github.com/FindoraNetwork/noah", tag = "v0.4.3" }

# primitives, don't depend on any modules
fp-core = { path = "../../primitives/core" }
Expand All @@ -39,7 +37,7 @@ storage = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.4
fin_db = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.4" }
ledger = { path = "../../../../ledger" }
enterprise-web3 = { path = "../../primitives/enterprise-web3" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }

[dev-dependencies]
baseapp = { path = "../../baseapp" }
Expand Down
2 changes: 1 addition & 1 deletion src/components/contracts/modules/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ use fp_types::{
actions::evm::Action,
crypto::{Address, HA160},
};
use noah_algebra::serialization::NoahFromToBytes;
use precompile::PrecompileSet;
use ruc::*;
use runtime::runner::ActionRunner;
use std::marker::PhantomData;
use std::str::FromStr;
use system_contracts::{SystemContracts, SYSTEM_ADDR};
use zei::noah_algebra::serialization::NoahFromToBytes;
use zei::XfrPublicKey;

pub use runtime::*;
Expand Down
6 changes: 3 additions & 3 deletions src/components/contracts/modules/evm/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use ethabi::{Event, EventParam, ParamType, RawLog};
use fp_traits::evm::{DecimalsMapping, EthereumDecimalsMapping};
use fp_types::actions::xhub::NonConfidentialOutput;
use ledger::data_model::ASSET_TYPE_FRA;
use noah::xfr::structs::AssetType;
use noah::xfr::structs::ASSET_TYPE_LENGTH;
use noah_algebra::serialization::NoahFromToBytes;
use ruc::*;
use zei::noah_algebra::serialization::NoahFromToBytes;
use zei::noah_api::xfr::structs::AssetType;
use zei::noah_api::xfr::structs::ASSET_TYPE_LENGTH;
use zei::XfrPublicKey;

pub fn deposit_asset_event() -> Event {
Expand Down
3 changes: 1 addition & 2 deletions src/components/contracts/primitives/mocks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ rand_chacha = "0.3"
rlp = "0.5"
serde_json = "1.0"
sha3 = "0.10"
noah = { git = "https://github.com/FindoraNetwork/noah", tag = "v0.4.3" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }

# primitives
fp-traits = { path = "../traits" }
Expand Down
6 changes: 2 additions & 4 deletions src/components/contracts/primitives/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ bech32 = "0.7.2"
ethereum = { version = "0.12.0", default-features = false, features = ["with-serde"] }
fixed-hash = "0.8.0"
hex = "0.4.2"
globutils = { git = "https://github.com/shaorongqiang/platform-lib-utils", branch = "main" }
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "develop" }
libsecp256k1 = { version = "0.7", features = ["static-context", "hmac"] }
primitive-types = { version = "0.11.1", default-features = false, features = ["rlp", "byteorder", "serde"] }
ruc = "1.0"
serde = { version = "1.0.124", features = ["derive"] }
serde_json = "1.0"
serde-big-array = "0.4"
sha3 = "0.10"
noah = { git = "https://github.com/FindoraNetwork/noah", tag = "v0.4.3" }
noah-algebra = { git = "https://github.com/FindoraNetwork/noah", tag = "v0.4.3" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }

# primitives
fp-utils = { path = "../utils" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use noah::xfr::structs::AssetType;
use zei::noah_api::xfr::structs::AssetType;
use serde::{Deserialize, Serialize};
use zei::XfrPublicKey;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use noah::xfr::structs::AssetType;
use serde::{Deserialize, Serialize};
use zei::noah_api::xfr::structs::AssetType;
use zei::XfrPublicKey;

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion src/components/contracts/primitives/types/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use {
fp_utils::{ecdsa, hashing::keccak_256},
globutils::wallet,
hex::FromHex,
noah_algebra::serialization::NoahFromToBytes,
primitive_types::{H160, H256},
ruc::{d, eg, RucResult},
serde::{Deserialize, Serialize},
sha3::{Digest, Keccak256},
std::ops::{Deref, DerefMut},
zei::noah_algebra::serialization::NoahFromToBytes,
zei::{XfrPublicKey, XfrSignature},
};

Expand Down
9 changes: 3 additions & 6 deletions src/components/finutils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ parking_lot = "0.12"

getrandom = "0.2"

noah = { git = "https://github.com/FindoraNetwork/noah", tag = "v0.4.3" }
noah-crypto = { git = "https://github.com/FindoraNetwork/noah", tag = "v0.4.3" }
noah-algebra = { git = "https://github.com/FindoraNetwork/noah", tag = "v0.4.3" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }

ruc = "1.0"
rucv3 = { package = "ruc", version = "3.0" }
nix = "0.25"

ledger = { path = "../../ledger", default-features = false }
globutils = { git = "https://github.com/shaorongqiang/platform-lib-utils", branch = "main" }
credentials = { git = "https://github.com/shaorongqiang/platform-lib-credentials", branch = "main" }
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "develop" }
credentials = { git = "https://github.com/FindoraNetwork/platform-lib-credentials", branch = "develop" }

eth_checksum = { version = "0.1.2", optional = true }
fp-core = { path = "../contracts/primitives/core", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion src/components/finutils/src/bins/fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ use {
data_model::{AssetTypeCode, ASSET_TYPE_FRA, FRA_DECIMALS},
staking::{StakerMemo, VALIDATORS_MIN},
},
noah::anon_xfr::structs::OpenAnonAssetRecordBuilder,
ruc::*,
std::{fmt, fs},
zei::noah_api::anon_xfr::structs::OpenAnonAssetRecordBuilder,
zei::XfrSecretKey,
};

Expand Down
10 changes: 5 additions & 5 deletions src/components/finutils/src/bins/stt/stt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,13 @@ mod issue {
},
staking::FRA_PRE_ISSUE_AMOUNT,
},
noah::xfr::{
rand_chacha::rand_core::SeedableRng,
rand_chacha::ChaChaRng,
zei::noah_algebra::ristretto::PedersenCommitmentRistretto,
zei::noah_api::xfr::{
asset_record::{build_blind_asset_record, AssetRecordType},
structs::AssetRecordTemplate,
},
noah_algebra::ristretto::PedersenCommitmentRistretto,
rand_chacha::rand_core::SeedableRng,
rand_chacha::ChaChaRng,
};

pub fn issue() -> Result<()> {
Expand Down Expand Up @@ -271,7 +271,7 @@ mod issue {
}

mod delegate {
use {super::*, noah::xfr::asset_record::AssetRecordType};
use {super::*, zei::noah_api::xfr::asset_record::AssetRecordType};

pub fn gen_tx(
user: NameRef,
Expand Down
2 changes: 1 addition & 1 deletion src/components/finutils/src/common/ddev/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ use ledger::{
staking::{td_addr_to_bytes, Validator as StakingValidator, ValidatorKind, FRA},
utils::fra_gen_initial_tx,
};
use noah::xfr::asset_record::AssetRecordType;
use ruc::*;
use serde::{Deserialize, Serialize};
use zei::noah_api::xfr::asset_record::AssetRecordType;
use zei::{XfrKeyPair, XfrPublicKey, XfrSecretKey};

#[derive(Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion src/components/finutils/src/common/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ use fp_utils::tx::EvmRawTxWrapper;
use ledger::data_model::AssetTypeCode;
use ledger::data_model::ASSET_TYPE_FRA;
use ledger::data_model::BLACK_HOLE_PUBKEY_STAKING;
use noah::xfr::asset_record::AssetRecordType;
use ruc::*;
use std::str::FromStr;
use tendermint::block::Height;
use tendermint_rpc::endpoint::abci_query::AbciQuery;
use tendermint_rpc::{Client, HttpClient};
use tokio::runtime::Runtime;
use zei::noah_api::xfr::asset_record::AssetRecordType;
use zei::XfrKeyPair;
use zei::XfrPublicKey;

Expand Down
20 changes: 10 additions & 10 deletions src/components/finutils/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ use {
TendermintAddrRef,
},
},
noah::{
rand_chacha::ChaChaRng,
rand_core::SeedableRng,
ruc::*,
std::{env, fs},
tendermint::PrivateKey,
utils::{
get_block_height, get_local_block_height, get_validator_detail,
parse_td_validator_keys,
},
zei::noah_api::{
anon_xfr::{
nullify,
structs::{
Expand All @@ -50,15 +59,6 @@ use {
structs::{XfrAmount, XfrAssetType},
},
},
rand_chacha::ChaChaRng,
rand_core::SeedableRng,
ruc::*,
std::{env, fs},
tendermint::PrivateKey,
utils::{
get_block_height, get_local_block_height, get_validator_detail,
parse_td_validator_keys,
},
zei::{XfrKeyPair, XfrPublicKey, XfrSecretKey},
};

Expand Down
20 changes: 12 additions & 8 deletions src/components/finutils/src/common/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ use {
},
staking::{init::get_inital_validators, TendermintAddrRef, FRA_TOTAL_AMOUNT},
},
noah::{
ruc::*,
serde::{self, Deserialize, Serialize},
sha2::Digest,
std::collections::HashMap,
tendermint::{PrivateKey, PublicKey},
zei::noah_api::{
anon_xfr::structs::{
AnonAssetRecord, AxfrOwnerMemo, Commitment, MTLeafInfo, OpenAnonAssetRecord,
},
Expand All @@ -28,11 +33,6 @@ use {
structs::{AssetRecordTemplate, OpenAssetRecord, OwnerMemo},
},
},
ruc::*,
serde::{self, Deserialize, Serialize},
sha2::Digest,
std::collections::HashMap,
tendermint::{PrivateKey, PublicKey},
zei::{BlindAssetRecord, XfrKeyPair, XfrPublicKey},
};

Expand Down Expand Up @@ -584,7 +584,11 @@ pub fn get_asset_all(kp: &XfrKeyPair) -> Result<BTreeMap<AssetTypeCode, u64>> {
let mut set = BTreeMap::new();

for (_k, v) in info {
let res = open_blind_asset_record(&v.0 .0.record, &v.1, kp)?;
let res = open_blind_asset_record(
&v.0 .0.record.into_noah()?,
&v.1,
&kp.into_noah()?,
)?;

let code = AssetTypeCode {
val: res.asset_type,
Expand All @@ -601,7 +605,7 @@ pub fn get_asset_all(kp: &XfrKeyPair) -> Result<BTreeMap<AssetTypeCode, u64>> {
}

#[allow(missing_docs)]
fn get_owned_utxos(
pub fn get_owned_utxos(
addr: &XfrPublicKey,
) -> Result<HashMap<TxoSID, (Utxo, Option<OwnerMemo>)>> {
get_owned_utxos_x(None, addr).c(d!())
Expand Down
Loading

0 comments on commit 66b1d4e

Please sign in to comment.