diff --git a/Cargo.lock b/Cargo.lock index 921a40e8..ec91a1c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "991984e3fd003e7ba02eb724f87a0f997b78677c46c0e91f8424ad7394c9886a" +dependencies = [ + "getrandom 0.2.3", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.18" @@ -59,6 +70,12 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" +[[package]] +name = "bech32" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b" + [[package]] name = "bip39" version = "0.1.0" @@ -96,7 +113,7 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cardano-legacy-address" version = "0.1.1" -source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#988528564f6e11db28709b8995587cc499f7c1d2" +source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#39e1f7f4e3d76df61bfbc24d8ce4b72a02c9ecc4" dependencies = [ "cbor_event", "chain-ser", @@ -137,9 +154,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chain-addr" version = "0.1.0" -source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#988528564f6e11db28709b8995587cc499f7c1d2" +source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#39e1f7f4e3d76df61bfbc24d8ce4b72a02c9ecc4" dependencies = [ - "bech32", + "bech32 0.8.1", "chain-core", "chain-crypto", "cryptoxide", @@ -148,7 +165,7 @@ dependencies = [ [[package]] name = "chain-core" version = "0.1.0" -source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#988528564f6e11db28709b8995587cc499f7c1d2" +source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#39e1f7f4e3d76df61bfbc24d8ce4b72a02c9ecc4" dependencies = [ "chain-ser", ] @@ -156,9 +173,9 @@ dependencies = [ [[package]] name = "chain-crypto" version = "0.1.0" -source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#988528564f6e11db28709b8995587cc499f7c1d2" +source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#39e1f7f4e3d76df61bfbc24d8ce4b72a02c9ecc4" dependencies = [ - "bech32", + "bech32 0.8.1", "cryptoxide", "curve25519-dalek-ng", "digest", @@ -175,7 +192,7 @@ dependencies = [ [[package]] name = "chain-impl-mockchain" version = "0.1.0" -source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#988528564f6e11db28709b8995587cc499f7c1d2" +source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#39e1f7f4e3d76df61bfbc24d8ce4b72a02c9ecc4" dependencies = [ "cardano-legacy-address", "chain-addr", @@ -209,14 +226,13 @@ dependencies = [ [[package]] name = "chain-ser" version = "0.1.0" -source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#988528564f6e11db28709b8995587cc499f7c1d2" +source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#39e1f7f4e3d76df61bfbc24d8ce4b72a02c9ecc4" [[package]] name = "chain-time" version = "0.1.0" -source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#988528564f6e11db28709b8995587cc499f7c1d2" +source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#39e1f7f4e3d76df61bfbc24d8ce4b72a02c9ecc4" dependencies = [ - "cfg-if 1.0.0", "chain-core", "chain-ser", ] @@ -224,7 +240,7 @@ dependencies = [ [[package]] name = "chain-vote" version = "0.1.0" -source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#988528564f6e11db28709b8995587cc499f7c1d2" +source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#39e1f7f4e3d76df61bfbc24d8ce4b72a02c9ecc4" dependencies = [ "cfg-if 1.0.0", "chain-core", @@ -481,6 +497,24 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashlink" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +dependencies = [ + "hashbrown", +] + [[package]] name = "hdkeygen" version = "0.2.0" @@ -526,7 +560,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "imhamt" version = "0.1.0" -source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#988528564f6e11db28709b8995587cc499f7c1d2" +source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#39e1f7f4e3d76df61bfbc24d8ce4b72a02c9ecc4" dependencies = [ "thiserror", ] @@ -652,6 +686,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "once_cell" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" + [[package]] name = "opaque-debug" version = "0.3.0" @@ -908,7 +948,7 @@ checksum = "c19772be3c4dd2ceaacf03cb41d5885f2a02c4d8804884918e3a258480803335" [[package]] name = "sparse-array" version = "0.1.0" -source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#988528564f6e11db28709b8995587cc499f7c1d2" +source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#39e1f7f4e3d76df61bfbc24d8ce4b72a02c9ecc4" [[package]] name = "strum" @@ -1011,7 +1051,7 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "typed-bytes" version = "0.1.0" -source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#988528564f6e11db28709b8995587cc499f7c1d2" +source = "git+https://github.com/input-output-hk/chain-libs.git?branch=master#39e1f7f4e3d76df61bfbc24d8ce4b72a02c9ecc4" [[package]] name = "typenum" @@ -1087,6 +1127,7 @@ dependencies = [ "chain-time", "cryptoxide", "ed25519-bip32", + "hashlink", "hdkeygen", "hex", "imhamt", @@ -1100,7 +1141,7 @@ dependencies = [ name = "wallet-core" version = "0.7.0-pre3" dependencies = [ - "bech32", + "bech32 0.7.3", "bip39", "chain-addr", "chain-core", @@ -1131,7 +1172,7 @@ dependencies = [ name = "wallet-js" version = "0.7.0-pre3" dependencies = [ - "bech32", + "bech32 0.7.3", "chain-crypto", "chain-impl-mockchain", "chain-vote", diff --git a/bindings/wallet-core/src/wallet.rs b/bindings/wallet-core/src/wallet.rs index 240d1cef..f6f420e2 100644 --- a/bindings/wallet-core/src/wallet.rs +++ b/bindings/wallet-core/src/wallet.rs @@ -131,7 +131,7 @@ impl Wallet { Block::read(&mut block0_bytes).map_err(|e| Error::invalid_input("block0").with(e))?; let settings = wallet::Settings::new(&block0).unwrap(); - for fragment in block0.contents.iter() { + for fragment in block0.contents().iter() { self.free_keys.check_fragment(&fragment.hash(), fragment); self.account.check_fragment(&fragment.hash(), fragment); diff --git a/wallet/src/blockchain.rs b/wallet/src/blockchain.rs index 5a33f006..69358e8c 100644 --- a/wallet/src/blockchain.rs +++ b/wallet/src/blockchain.rs @@ -23,8 +23,8 @@ pub struct Settings { impl Settings { pub fn new(block: &Block) -> Result { - let header_id = block.header.id(); - let ledger = Ledger::new(header_id, block.contents.iter())?; + let header_id = block.header().id(); + let ledger = Ledger::new(header_id, block.contents().iter())?; let static_parameters = ledger.get_static_parameters().clone(); let parameters = ledger.get_ledger_parameters(); @@ -37,7 +37,7 @@ impl Settings { // fixed in Ledger::new (or at least checked). let mut slot_duration = None; - for fragment in block.contents.iter() { + for fragment in block.contents().iter() { if let Fragment::Initial(initials) = fragment { for initial in initials.iter() { match initial { diff --git a/wallet/tests/utils/mod.rs b/wallet/tests/utils/mod.rs index f8c1be2d..e409a1d2 100644 --- a/wallet/tests/utils/mod.rs +++ b/wallet/tests/utils/mod.rs @@ -19,7 +19,7 @@ impl State { { let mut block0_bytes = ReadBuf::from(block0_bytes.as_ref()); let block0 = Block::read(&mut block0_bytes).expect("valid block0"); - let hh = block0.header.id(); + let hh = block0.header().id(); let ledger = Ledger::new(hh, block0.fragments()).unwrap(); Self { block0, ledger } @@ -27,7 +27,7 @@ impl State { #[allow(dead_code)] pub fn initial_contents(&self) -> impl Iterator { - self.block0.contents.iter() + self.block0.contents().iter() } pub fn settings(&self) -> Result {