-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Networking tests and fixes #61
Conversation
substrate/client/src/lib.rs
Outdated
@@ -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))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why - 1
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Crystalin add test workflow
…k-timeout Relayer fetch parablock timeout
…-info-rpc Feature/vesting info rpc
* 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
No description provided.