Skip to content

Commit fa96233

Browse files
author
shaorongqiang
committed
fix lint
1 parent 4e971d5 commit fa96233

File tree

15 files changed

+50
-49
lines changed

15 files changed

+50
-49
lines changed

src/components/abciapp/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ percent-encoding = "2.1.0"
4242

4343
nix = "0.22.1"
4444

45-
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
45+
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
4646
ruc = { version = "1.0.5", default-features = false, features = ["compact"] }
4747
abci = { git = "https://github.com/FindoraNetwork/tendermint-abci", tag = "0.7.6" }
4848
config = { path = "../config"}
4949
ledger = { path = "../../ledger" }
5050

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

src/components/config/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ serde_json = "1.0"
1616
serde-strz = "1.1.1"
1717
toml = "0.5.8"
1818

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

2121
[target.'cfg(target_os= "linux")'.dependencies]
2222
btm = "0.1.6"

src/components/contracts/baseapp/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ serde_json = "1.0.40"
2525
storage = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.9" }
2626
fin_db = { git = "https://github.com/FindoraNetwork/storage.git", tag = "v1.1.9" }
2727
sha3 = "0.10"
28-
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
28+
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
2929

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

src/components/contracts/modules/account/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fp-traits = { path = "../../primitives/traits" }
2424
fp-types = { path = "../../primitives/types" }
2525
enterprise-web3 = { path = "../../primitives/enterprise-web3" }
2626
config = { path = "../../../config"}
27-
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
27+
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
2828

2929
[dev-dependencies]
3030
rand_chacha = "0.3"

src/components/contracts/modules/evm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ serde_json = "1.0.64"
2424
sha3 = { version = "0.10", default-features = false }
2525
hex = "0.4.3"
2626
ethabi = "17.1.0"
27-
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
27+
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
2828
protobuf = "2.16"
2929

3030
# primitives, don't depend on any modules

src/components/contracts/modules/evm/precompile/anemoi/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ evm-precompile-utils = { path = "../utils"}
1616
tracing = "0.1"
1717
module-evm = { path = "../../../../modules/evm"}
1818
num_enum = { version = "0.5.4", default-features = false }
19-
platform-lib-noah = { git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
19+
platform-lib-noah = { git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
2020

2121
[dev-dependencies]
2222
baseapp = { path = "../../../../baseapp" }

src/components/contracts/primitives/mocks/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rand_chacha = "0.3"
1818
rlp = "0.5"
1919
serde_json = "1.0"
2020
sha3 = "0.10"
21-
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
21+
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
2222

2323
# primitives
2424
fp-traits = { path = "../traits" }

src/components/contracts/primitives/types/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bech32 = "0.7.2"
1313
ethereum = { version = "0.12.0", default-features = false, features = ["with-serde"] }
1414
hex = "0.4.3"
1515

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

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

2828
# primitives

src/components/finutils/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ digest = '0.10'
2525
parking_lot = "0.12"
2626
getrandom = "0.2"
2727

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

3636
eth_checksum = { version = "0.1.2", optional = true }
3737
fp-core = { path = "../contracts/primitives/core", default-features = false }

src/components/finutils/src/common/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ pub fn get_claim_on_contract_address(url: &str, staking_address: H160) -> Result
11651165

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

src/components/finutils/src/txn_builder/mod.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#![allow(clippy::needless_borrow)]
77

88
use {
9-
credentials::CredUserSecretKey,
109
curve25519_dalek::scalar::Scalar,
1110
digest::Digest,
1211
fp_types::{crypto::MultiSigner, H160},
@@ -53,7 +52,7 @@ use {
5352
noah_api::{
5453
anon_creds::{
5554
ac_confidential_open_commitment, ACCommitment, ACCommitmentKey,
56-
ConfidentialAC, Credential,
55+
ACUserSecretKey, ConfidentialAC, Credential,
5756
},
5857
anon_xfr::{
5958
abar_to_abar::{finish_anon_xfr_note, init_anon_xfr_note, AXfrPreNote},
@@ -1303,7 +1302,7 @@ impl TransferOperationBuilder {
13031302
asset_record_template: &AssetRecordTemplate,
13041303
tracing_policies: Option<TracingPolicies>,
13051304
identity_commitment: Option<ACCommitment>,
1306-
credential_record: Option<(&CredUserSecretKey, &Credential, &ACCommitmentKey)>,
1305+
credential_record: Option<(&ACUserSecretKey, &Credential, &ACCommitmentKey)>,
13071306
) -> Result<&mut Self> {
13081307
let prng = &mut ChaChaRng::from_entropy();
13091308
if self.transfer.is_some() {
@@ -1318,7 +1317,7 @@ impl TransferOperationBuilder {
13181317
AssetRecord::from_template_with_identity_tracing(
13191318
prng,
13201319
asset_record_template,
1321-
user_secret_key.get_ref(),
1320+
user_secret_key,
13221321
credential,
13231322
commitment_key,
13241323
)
@@ -1337,7 +1336,7 @@ impl TransferOperationBuilder {
13371336
pub fn add_output_and_store_blinds<R: CryptoRng + RngCore>(
13381337
&mut self,
13391338
asset_record_template: &AssetRecordTemplate,
1340-
credential_record: Option<(&CredUserSecretKey, &Credential, &ACCommitmentKey)>,
1339+
credential_record: Option<(&ACUserSecretKey, &Credential, &ACCommitmentKey)>,
13411340
prng: &mut R,
13421341
blinds: &mut ((Scalar, Scalar), Scalar),
13431342
) -> Result<&mut Self> {
@@ -1364,7 +1363,7 @@ impl TransferOperationBuilder {
13641363
Some(reveal_policy) => {
13651364
let conf_ac = ac_confidential_open_commitment(
13661365
prng,
1367-
user_secret_key.get_ref(),
1366+
user_secret_key,
13681367
credential,
13691368
commitment_key,
13701369
&policy.enc_keys.attrs_enc_key,

src/components/wallet_mobile/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ ruc = "1.0"
3232
serde = { version = "1.0.124", features = ["derive"] }
3333
serde_derive = "^1.0.59"
3434
serde_json = "1.0"
35-
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
35+
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
3636

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

4444
ledger = { path = "../../ledger" }

src/components/wasm/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ bs58 = "0.4"
3535
# OR the compiling will fail.
3636
getrandom = { version = "0.2", features = ["js"] }
3737

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

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

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

4646
ledger = { path = "../../ledger" }

src/ledger/Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ config = { path = "../components/config" }
3232
fp-types = { path = "../components/contracts/primitives/types" }
3333
fp-utils = { path = "../components/contracts/primitives/utils" }
3434
ruc = "1.0"
35-
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "develop" }
35+
zei = { package="platform-lib-noah", git = "https://github.com/FindoraNetwork/platform-lib-noah", branch = "main" }
3636
bulletproofs = { package = "bulletproofs", git = "https://github.com/FindoraNetwork/bp", rev = "57633a", features = ["yoloproofs"] }
3737
itertools = "0.10"
3838
fbnc = { version = "0.2.9", default-features = false}
3939
once_cell = "1"
4040
num-bigint = "0.4.3"
4141

42-
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "develop" }
42+
globutils = { git = "https://github.com/FindoraNetwork/platform-lib-utils", branch = "fix_dep" }
4343
bitmap = { git = "https://github.com/FindoraNetwork/platform-lib-bitmap", branch = "develop" }
4444
cryptohash = { git = "https://github.com/FindoraNetwork/platform-lib-cryptohash", branch = "develop" }
45-
credentials = { git = "https://github.com/FindoraNetwork/platform-lib-credentials", branch = "develop" }
45+
credentials = { git = "https://github.com/FindoraNetwork/platform-lib-credentials", branch = "fix_dep" }
4646
merkle_tree = { git = "https://github.com/FindoraNetwork/platform-lib-merkle", branch = "develop" }
4747
sliding_set = { git = "https://github.com/FindoraNetwork/platform-lib-slidingset", branch = "develop" }
4848

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

7070
[target.'cfg(target_arch = "wasm32")'.dependencies]
7171
parking_lot = { version = "0.11.1", features = ["wasm-bindgen"] }

src/ledger/src/store/mod.rs

+19-17
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ impl LedgerState {
584584
fdb,
585585
"abar_db".to_string(),
586586
VERSION_WINDOW,
587+
false,
587588
)));
588589
Ok(State::new(cs, false))
589590
}
@@ -1547,22 +1548,22 @@ impl LedgerStatus {
15471548
// Asset issuance should match the currently registered key
15481549
}
15491550

1550-
let get_effect_asset =
1551-
|derived_asset_code: &AssetTypeCode| -> Option<AssetType> {
1552-
for (code, asset) in &txn_effect.new_asset_codes {
1553-
let dc = AssetTypeCode::from_prefix_and_raw_asset_type_code(
1554-
AssetTypePrefix::UserDefined,
1555-
&code,
1556-
&CFG.checkpoint,
1557-
self.td_commit_height,
1558-
);
1559-
if dc == *derived_asset_code {
1560-
return Some(asset.clone());
1561-
}
1562-
}
1563-
None
1564-
};
1565-
1551+
// let get_effect_asset =
1552+
// |derived_asset_code: &AssetTypeCode| -> Option<AssetType> {
1553+
// for (code, asset) in &txn_effect.new_asset_codes {
1554+
// let dc = AssetTypeCode::from_prefix_and_raw_asset_type_code(
1555+
// AssetTypePrefix::UserDefined,
1556+
// &code,
1557+
// &CFG.checkpoint,
1558+
// self.td_commit_height,
1559+
// );
1560+
// if dc == *derived_asset_code {
1561+
// return Some(asset.clone());
1562+
// }
1563+
// }
1564+
// None
1565+
// };
1566+
15661567
// New issuance numbers
15671568
// (1) Must refer to a created asset type
15681569
// - NOTE: if the asset type is created in this transaction, this
@@ -1576,7 +1577,8 @@ impl LedgerStatus {
15761577
let asset_type = self
15771578
.asset_types
15781579
.get(&code)
1579-
.or_else(|| get_effect_asset(&code))
1580+
.or_else(|| txn_effect.new_asset_codes.get(&code).cloned())
1581+
// .or_else(|| get_effect_asset(&code))
15801582
.c(d!())?;
15811583
let proper_key = asset_type.properties.issuer;
15821584
if *iss_key != proper_key {

0 commit comments

Comments
 (0)