Skip to content

Commit

Permalink
Merge pull request #194 from input-output-hk/update-chainlibs
Browse files Browse the repository at this point in the history
update chain-libs
  • Loading branch information
ecioppettini committed Oct 12, 2021
2 parents b8c883e + 13f1940 commit ed63c5e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 22 deletions.
73 changes: 57 additions & 16 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion bindings/wallet-core/src/wallet.rs
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions wallet/src/blockchain.rs
Expand Up @@ -23,8 +23,8 @@ pub struct Settings {

impl Settings {
pub fn new(block: &Block) -> Result<Self, Error> {
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();
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions wallet/tests/utils/mod.rs
Expand Up @@ -19,15 +19,15 @@ 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 }
}

#[allow(dead_code)]
pub fn initial_contents(&self) -> impl Iterator<Item = &'_ Fragment> {
self.block0.contents.iter()
self.block0.contents().iter()
}

pub fn settings(&self) -> Result<Settings, LedgerError> {
Expand Down

0 comments on commit ed63c5e

Please sign in to comment.