Skip to content

Commit

Permalink
Merge branch 'master' into v2.0-testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
peilun-conflux committed Dec 14, 2023
2 parents e1e6531 + 622070c commit 82825e0
Show file tree
Hide file tree
Showing 47 changed files with 4,550 additions and 1,225 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ target
.gitmodules
.phabricator*
build/
build_clippy/
**/blockchain_db/
**/sqlite_db/
**/net_config/
Expand Down
52 changes: 26 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ u64-mpt-db-key = ["client/u64_mpt_db_key"]

[patch.crates-io]
sqlite3-sys = { git = "https://github.com/Conflux-Chain/sqlite3-sys.git", rev = "1de8e5998f7c2d919336660b8ef4e8f52ac43844" }
funty = { git = "https://github.com/ferrilab/funty.git", rev = "7ef0d890fbcd8b3def1635ac1a877fc298488446" }
#fff = { git = "https://github.com/Conflux-Chain/ff.git", rev = "c0e8a5911a285526cc79fe14d500e1553d3c9174" }

[profile.test]
debug-assertions = true
Expand Down
2 changes: 1 addition & 1 deletion accounts/cfxstore/src/json/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl_hash!(H256, 32);
// FIXME: find a better hash type.
impl PartialOrd for H160 {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.0.partial_cmp(&other.0)
Some(self.cmp(other))
}
}

Expand Down
12 changes: 6 additions & 6 deletions accounts/cfxstore/src/secret_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ pub struct StoreAccountRef {

impl PartialOrd for StoreAccountRef {
fn partial_cmp(&self, other: &StoreAccountRef) -> Option<Ordering> {
Some(
self.address
.cmp(&other.address)
.then_with(|| self.vault.cmp(&other.vault)),
)
Some(self.cmp(other))
}
}

Expand All @@ -59,7 +55,11 @@ impl PartialEq for StoreAccountRef {
impl Eq for StoreAccountRef {}

impl Ord for StoreAccountRef {
fn cmp(&self, other: &Self) -> Ordering { self.address.cmp(&other.address) }
fn cmp(&self, other: &Self) -> Ordering {
self.address
.cmp(&other.address)
.then_with(|| self.vault.cmp(&other.vault))
}
}

impl Hash for StoreAccountRef {
Expand Down
43 changes: 43 additions & 0 deletions cfx_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,49 @@ impl AddressWithSpace {
pub fn assert_native(&self) { assert_eq!(self.space, Space::Native) }
}

#[derive(Default, Clone)]
pub struct SpaceMap<T> {
pub native: T,
pub evm: T,
}

impl<T> SpaceMap<T> {
#[inline]
pub fn in_space(&self, space: Space) -> &T {
match space {
Space::Native => &self.native,
Space::Ethereum => &self.evm,
}
}

#[inline]
pub fn in_space_mut(&mut self, space: Space) -> &mut T {
match space {
Space::Native => &mut self.native,
Space::Ethereum => &mut self.evm,
}
}

pub fn iter(&self) -> impl Iterator<Item = &T> {
vec![&self.native, &self.evm].into_iter()
}

pub fn map_sum<F: Fn(&T) -> usize>(&self, f: F) -> usize {
f(&self.native) + f(&self.evm)
}

pub const fn size(&self) -> usize { 2 }

pub fn apply_all<U, F: FnMut(&mut T) -> U>(
&mut self, mut f: F,
) -> SpaceMap<U> {
SpaceMap {
native: f(&mut self.native),
evm: f(&mut self.evm),
}
}
}

pub mod space_util {
use super::{Address, AddressWithSpace, Space};

Expand Down
4 changes: 4 additions & 0 deletions changelogs/JSONRPC.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# JSON-RPC CHANGELOG

## v2.3.1

- Return `storagePointProp` in cfx_getParamsFromVote, which is introduced by [CIP-107](https://github.com/Conflux-Chain/CIPs/blob/master/CIPs/cip-107.md#the-voting-of-proportion).

## v2.3.0

- Add `cfx_getCollateralInfo` to return chain collateral info.
Expand Down
2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ rpassword = "5.0.1"
static_assertions = "1.1.0"
parity-version = {path = "../util/version"}
solidity-abi = {path="../util/solidity-abi"}
bls-signatures = {git = "https://github.com/Conflux-Chain/bls-signatures.git", rev = "e7d9119eb285607d5134d40efd89555c41d73160", default-features = false, features = ["multicore"]}
bls-signatures = {git = "https://github.com/Conflux-Chain/bls-signatures.git", rev = "fb52187df92d27c365642cb7e7b2aaf60437cf9c", default-features = false, features = ["multicore"]}

[dev-dependencies]
criterion = "0.3"
Expand Down
4 changes: 1 addition & 3 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ unexpected = { git = "https://github.com/Conflux-Chain/conflux-parity-deps.git",
strum = "0.20"
strum_macros = "0.20"
smart-default = "0.6.0"
#bls-signatures = {path = "/Users/lipeilun/conflux/bls-signatures"}
#bls-signatures = {path = "/Users/lipeilun/conflux/bls-signatures",default-features = false, features = ["blst", "multicore"]}
bls-signatures = {git = "https://github.com/Conflux-Chain/bls-signatures.git", rev = "e7d9119eb285607d5134d40efd89555c41d73160", default-features = false, features = ["multicore"]}
bls-signatures = {git = "https://github.com/Conflux-Chain/bls-signatures.git", rev = "fb52187df92d27c365642cb7e7b2aaf60437cf9c", default-features = false, features = ["multicore"]}
tiny-keccak = {version = "2.0", features = ["keccak"]}
bcs = "0.1.2"
async-trait = "0.1"
Expand Down
Loading

0 comments on commit 82825e0

Please sign in to comment.