Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Networking tests and fixes #61

Merged
merged 9 commits into from
Feb 8, 2018
Merged

Networking tests and fixes #61

merged 9 commits into from
Feb 8, 2018

Conversation

arkpar
Copy link
Member

@arkpar arkpar commented Feb 7, 2018

No description provided.

@arkpar arkpar added the A0-please_review Pull request needs code review. label Feb 7, 2018
@@ -176,7 +181,7 @@ impl<B, E> Client<B, E> where
blockchain::BlockStatus::Unknown => return Ok(ImportResult::UnknownParent),
}

let mut transaction = self.backend.begin_transaction(BlockId::Number(header.number))?;
let mut transaction = self.backend.begin_transaction(BlockId::Number(header.number - 1))?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why - 1?

Copy link
Member Author

@arkpar arkpar Feb 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

header is the header being imported. The argument to begin_transaction is the base (parent) block id. Either hash or number.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to parent_hash anyway

};
edit_header(&mut header);

let mut tx = self.begin_transaction(BlockId::Hash(best_hash)).expect("In-memory backend does not fail");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can't see how this could possibly work in general - the polkadot runtime, at least, alters the state regardless of whether there are any transactions; the transaction_root must also be valid for blocks to be executed.

Copy link
Member Author

@arkpar arkpar Feb 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for tests only. And since this is substrate client, the code that uses it should not care. I guess we could have more elaborate testing framework under /polkadot

@arkpar arkpar merged commit d30e4c5 into master Feb 8, 2018
@arkpar arkpar deleted the net-test branch February 8, 2018 16:49
JoshOrndorff referenced this pull request in moonbeam-foundation/substrate Apr 21, 2021
iStrike7 referenced this pull request in gasp-xyz/substrate Aug 3, 2021
iStrike7 referenced this pull request in gasp-xyz/substrate Aug 3, 2021
liuchengxu pushed a commit to autonomys/substrate that referenced this pull request Jun 3, 2022
…k-timeout

Relayer fetch parablock timeout
imstar15 pushed a commit to imstar15/substrate that referenced this pull request Jan 3, 2023
helin6 pushed a commit to boolnetwork/substrate that referenced this pull request Jul 25, 2023
* Do not error if type sizes missing: log warn

* Split out EventsSubscriber, allow updating events decoder

* Format code

* Check missing type sizes after registration

* Add example which for submit and watching events
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants