Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shaorongqiang committed Nov 1, 2023
1 parent 4e971d5 commit fa96233
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 49 deletions.
4 changes: 2 additions & 2 deletions src/components/abciapp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ percent-encoding = "2.1.0"

nix = "0.22.1"

zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
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" }

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

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/FindoraNetwork/platform-lib-utils", branch = "develop" }
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "fix_dep" }

[target.'cfg(target_os= "linux")'.dependencies]
btm = "0.1.6"
Expand Down
2 changes: 1 addition & 1 deletion src/components/contracts/baseapp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ serde_json = "1.0.40"
storage = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.9" }
fin_db = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.9" }
sha3 = "0.10"
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }

config = { path = "../../config"}

Expand Down
2 changes: 1 addition & 1 deletion src/components/contracts/modules/account/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ 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 = "develop" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }

[dev-dependencies]
rand_chacha = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion src/components/contracts/modules/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ serde_json = "1.0.64"
sha3 = { version = "0.10", default-features = false }
hex = "0.4.3"
ethabi = "17.1.0"
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
protobuf = "2.16"

# primitives, don't depend on any modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ evm-precompile-utils = { path = "../utils"}
tracing = "0.1"
module-evm = { path = "../../../../modules/evm"}
num_enum = { version = "0.5.4", default-features = false }
platform-lib-noah = { git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
platform-lib-noah = { git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }

[dev-dependencies]
baseapp = { path = "../../../../baseapp" }
Expand Down
2 changes: 1 addition & 1 deletion src/components/contracts/primitives/mocks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rand_chacha = "0.3"
rlp = "0.5"
serde_json = "1.0"
sha3 = "0.10"
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }

# primitives
fp-traits = { path = "../traits" }
Expand Down
4 changes: 2 additions & 2 deletions src/components/contracts/primitives/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bech32 = "0.7.2"
ethereum = { version = "0.12.0", default-features = false, features = ["with-serde"] }
hex = "0.4.3"

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

libsecp256k1 = { version = "0.7", features = ["static-context", "hmac"] }
primitive-types = { version = "0.11.1", default-features = false, features = ["rlp", "byteorder", "serde"] }
Expand All @@ -22,7 +22,7 @@ serde = { version = "1.0.124", features = ["derive"] }
serde_json = "1.0"
serde-big-array = "0.4"
sha3 = "0.10"
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
fixed-hash = "0.8.0"

# primitives
Expand Down
6 changes: 3 additions & 3 deletions src/components/finutils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ digest = '0.10'
parking_lot = "0.12"
getrandom = "0.2"

zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
ruc = "1.0"
rucv4 = { package = "ruc", version = "4.0" }
nix = "0.25"
ledger = { path = "../../ledger", default-features = false }
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "develop" }
credentials = { git = "https://github.com/FindoraNetwork/platform-lib-credentials", branch = "develop" }
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "fix_dep" }
credentials = { git = "https://github.com/FindoraNetwork/platform-lib-credentials", branch = "fix_dep" }

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/common/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ pub fn get_claim_on_contract_address(url: &str, staking_address: H160) -> Result

#[allow(missing_docs)]
pub fn mapping_address(pk: &XfrPublicKey) -> H160 {
let result = <Keccak256 as sha3::Digest>::digest(pk.as_bytes());
let result = <Keccak256 as sha3::Digest>::digest(pk.to_bytes());
H160::from_slice(&result.as_slice()[..20])
}

Expand Down
11 changes: 5 additions & 6 deletions src/components/finutils/src/txn_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#![allow(clippy::needless_borrow)]

use {
credentials::CredUserSecretKey,
curve25519_dalek::scalar::Scalar,
digest::Digest,
fp_types::{crypto::MultiSigner, H160},
Expand Down Expand Up @@ -53,7 +52,7 @@ use {
noah_api::{
anon_creds::{
ac_confidential_open_commitment, ACCommitment, ACCommitmentKey,
ConfidentialAC, Credential,
ACUserSecretKey, ConfidentialAC, Credential,
},
anon_xfr::{
abar_to_abar::{finish_anon_xfr_note, init_anon_xfr_note, AXfrPreNote},
Expand Down Expand Up @@ -1303,7 +1302,7 @@ impl TransferOperationBuilder {
asset_record_template: &AssetRecordTemplate,
tracing_policies: Option<TracingPolicies>,
identity_commitment: Option<ACCommitment>,
credential_record: Option<(&CredUserSecretKey, &Credential, &ACCommitmentKey)>,
credential_record: Option<(&ACUserSecretKey, &Credential, &ACCommitmentKey)>,
) -> Result<&mut Self> {
let prng = &mut ChaChaRng::from_entropy();
if self.transfer.is_some() {
Expand All @@ -1318,7 +1317,7 @@ impl TransferOperationBuilder {
AssetRecord::from_template_with_identity_tracing(
prng,
asset_record_template,
user_secret_key.get_ref(),
user_secret_key,
credential,
commitment_key,
)
Expand All @@ -1337,7 +1336,7 @@ impl TransferOperationBuilder {
pub fn add_output_and_store_blinds<R: CryptoRng + RngCore>(
&mut self,
asset_record_template: &AssetRecordTemplate,
credential_record: Option<(&CredUserSecretKey, &Credential, &ACCommitmentKey)>,
credential_record: Option<(&ACUserSecretKey, &Credential, &ACCommitmentKey)>,
prng: &mut R,
blinds: &mut ((Scalar, Scalar), Scalar),
) -> Result<&mut Self> {
Expand All @@ -1364,7 +1363,7 @@ impl TransferOperationBuilder {
Some(reveal_policy) => {
let conf_ac = ac_confidential_open_commitment(
prng,
user_secret_key.get_ref(),
user_secret_key,
credential,
commitment_key,
&policy.enc_keys.attrs_enc_key,
Expand Down
6 changes: 3 additions & 3 deletions src/components/wallet_mobile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ ruc = "1.0"
serde = { version = "1.0.124", features = ["derive"] }
serde_derive = "^1.0.59"
serde_json = "1.0"
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }

finutils = { path = "../finutils", default-features = false, features = []}
fp-types = { path = "../contracts/primitives/types" }
fp-utils = { path = "../contracts/primitives/utils" }
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "develop" }
credentials = { git = "https://github.com/FindoraNetwork/platform-lib-credentials", branch = "develop" }
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "fix_dep" }
credentials = { git = "https://github.com/FindoraNetwork/platform-lib-credentials", branch = "fix_dep" }
cryptohash = { git = "https://github.com/FindoraNetwork/platform-lib-cryptohash", branch = "develop" }

ledger = { path = "../../ledger" }
Expand Down
6 changes: 3 additions & 3 deletions src/components/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ bs58 = "0.4"
# OR the compiling will fail.
getrandom = { version = "0.2", features = ["js"] }

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

finutils = { path = "../finutils", default-features = false }

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

ledger = { path = "../../ledger" }
Expand Down
12 changes: 6 additions & 6 deletions src/ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ config = { path = "../components/config" }
fp-types = { path = "../components/contracts/primitives/types" }
fp-utils = { path = "../components/contracts/primitives/utils" }
ruc = "1.0"
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
bulletproofs = { package = "bulletproofs", git = "https://github.com/FindoraNetwork/bp", rev = "57633a", features = ["yoloproofs"] }
itertools = "0.10"
fbnc = { version = "0.2.9", default-features = false}
once_cell = "1"
num-bigint = "0.4.3"

globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "develop" }
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "fix_dep" }
bitmap = { git = "https://github.com/FindoraNetwork/platform-lib-bitmap", branch = "develop" }
cryptohash = { git = "https://github.com/FindoraNetwork/platform-lib-cryptohash", branch = "develop" }
credentials = { git = "https://github.com/FindoraNetwork/platform-lib-credentials", branch = "develop" }
credentials = { git = "https://github.com/FindoraNetwork/platform-lib-credentials", branch = "fix_dep" }
merkle_tree = { git = "https://github.com/FindoraNetwork/platform-lib-merkle", branch = "develop" }
sliding_set = { git = "https://github.com/FindoraNetwork/platform-lib-slidingset", branch = "develop" }

Expand All @@ -63,9 +63,9 @@ features = ["f16", "serde"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
parking_lot = "0.12"
fs2 = "0.4"
storage = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.6", optional = true }
fin_db = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.6", optional = true }
sparse_merkle_tree = { git = "https://github.com/FindoraNetwork/platform-lib-sparse-merkle", branch = "develop" }
storage = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.9", optional = true }
fin_db = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.9", optional = true }
sparse_merkle_tree = { git = "https://github.com/FindoraNetwork/platform-lib-sparse-merkle", branch = "main" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
parking_lot = { version = "0.11.1", features = ["wasm-bindgen"] }
Expand Down
36 changes: 19 additions & 17 deletions src/ledger/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ impl LedgerState {
fdb,
"abar_db".to_string(),
VERSION_WINDOW,
false,
)));
Ok(State::new(cs, false))
}
Expand Down Expand Up @@ -1547,22 +1548,22 @@ impl LedgerStatus {
// Asset issuance should match the currently registered key
}

let get_effect_asset =
|derived_asset_code: &AssetTypeCode| -> Option<AssetType> {
for (code, asset) in &txn_effect.new_asset_codes {
let dc = AssetTypeCode::from_prefix_and_raw_asset_type_code(
AssetTypePrefix::UserDefined,
&code,
&CFG.checkpoint,
self.td_commit_height,
);
if dc == *derived_asset_code {
return Some(asset.clone());
}
}
None
};
// let get_effect_asset =
// |derived_asset_code: &AssetTypeCode| -> Option<AssetType> {
// for (code, asset) in &txn_effect.new_asset_codes {
// let dc = AssetTypeCode::from_prefix_and_raw_asset_type_code(
// AssetTypePrefix::UserDefined,
// &code,
// &CFG.checkpoint,
// self.td_commit_height,
// );
// if dc == *derived_asset_code {
// return Some(asset.clone());
// }
// }
// None
// };

// New issuance numbers
// (1) Must refer to a created asset type
// - NOTE: if the asset type is created in this transaction, this
Expand All @@ -1576,7 +1577,8 @@ impl LedgerStatus {
let asset_type = self
.asset_types
.get(&code)
.or_else(|| get_effect_asset(&code))
.or_else(|| txn_effect.new_asset_codes.get(&code).cloned())
// .or_else(|| get_effect_asset(&code))
.c(d!())?;
let proper_key = asset_type.properties.issuer;
if *iss_key != proper_key {
Expand Down

0 comments on commit fa96233

Please sign in to comment.