Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 9 additions & 3 deletions docs/sdk/src/guides/your_first_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,14 @@ mod tests {

let expected_blocks = (10_000 / block_time).saturating_div(2);
assert!(expected_blocks > 0, "test configuration is bad, should give it more time");
assert!(String::from_utf8(output.stderr)
.unwrap()
.contains(format!("Imported #{}", expected_blocks).to_string().as_str()));
let output = String::from_utf8(output.stderr).unwrap();
let want = format!("Imported #{}", expected_blocks);
if !output.contains(&want) {
panic!(
"Output did not contain the pattern:\n\npattern: {}\n\noutput: {}\n",
want, output
);
}
}

#[test]
Expand All @@ -282,6 +287,7 @@ mod tests {
}

#[test]
#[ignore]
fn parachain_runtime_works() {
// TODO: None doesn't work. But maybe it should? it would be misleading as many users might
// use it.
Expand Down
10 changes: 10 additions & 0 deletions prdoc/pr_7786.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: 'pallet revive: rpc build script should not panic'
doc:
- audience: Runtime Dev
description: |-
Fix a build error in the pallet revive RPC build scrip that can occur when using `cargo remote`
or `cargo vendor`.

crates:
- name: pallet-revive-eth-rpc
bump: patch
17 changes: 11 additions & 6 deletions substrate/frame/revive/rpc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ fn main() {
.join("");
let target = std::env::var("TARGET").unwrap_or_else(|_| "unknown".to_string());

let repo = git2::Repository::open("../../../..").expect("should be a repository");
let head = repo.head().expect("should have head");
let commit = head.peel_to_commit().expect("should have commit");
let branch = head.shorthand().unwrap_or("unknown").to_string();
let id = &commit.id().to_string()[..7];
println!("cargo:rustc-env=GIT_REVISION={branch}-{id}");
let (branch, id) = if let Ok(repo) = git2::Repository::open("../../../..") {
let head = repo.head().expect("should have head");
let commit = head.peel_to_commit().expect("should have commit");
let branch = head.shorthand().unwrap_or("unknown").to_string();
let id = &commit.id().to_string()[..7];
(branch, id.to_string())
} else {
("unknown".to_string(), "unknown".to_string())
};

println!("cargo:rustc-env=RUSTC_VERSION={rustc_version}");
println!("cargo:rustc-env=TARGET={target}");
println!("cargo:rustc-env=GIT_REVISION={branch}-{id}");
}
Loading