Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle error condition in node service #2528

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1249,18 +1249,17 @@ where
_phantom: Default::default(),
})),
create_inherent_data_providers: move |block: H256, ()| {
let current_para_block = client_set_aside_for_cidp
.number(block)
.expect("Header lookup should succeed")
.expect("Header passed in as parent should be present in backend.");

let maybe_current_para_block = client_set_aside_for_cidp.number(block);
let downward_xcm_receiver = downward_xcm_receiver.clone();
let hrmp_xcm_receiver = hrmp_xcm_receiver.clone();

let client_for_xcm = client_set_aside_for_cidp.clone();
async move {
let time = sp_timestamp::InherentDataProvider::from_system_time();

let current_para_block = maybe_current_para_block?
.ok_or(sp_blockchain::Error::UnknownBlock(block.to_string()))?;

let mocked_parachain = MockValidationDataInherentDataProvider {
current_para_block,
relay_offset: 1000,
Expand Down
Loading