Skip to content

Commit 836d661

Browse files
Joonmo Yangmergify[bot]
authored andcommitted
Populate the seal in OpenBlock for external blocks
1 parent e391d03 commit 836d661

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

core/src/block.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ impl<'x> OpenBlock<'x> {
213213
self.block.header.set_author(*header.author());
214214
self.block.header.set_transactions_root(*header.transactions_root());
215215
self.block.header.set_extra_data(header.extra_data().clone());
216+
self.block.header.set_seal(header.seal().to_vec());
216217
}
217218

218219
/// Turn this into a `ClosedBlock`.

test/src/e2e.dynval/dv.oneblockoneterm.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ import { withNodes } from "./setup";
2323

2424
chai.use(chaiAsPromised);
2525

26-
const alice = originalDynValidators[0];
26+
// Verifying external blocks take different code path with internal blocks.
27+
// We need both a proposer and a verifier to test them.
28+
const [alice, bob] = originalDynValidators;
2729

2830
describe("one block one term test", function() {
2931
const promiseExpect = new PromiseExpect();
@@ -34,7 +36,10 @@ describe("one block one term test", function() {
3436
overrideParams: {
3537
termSeconds: 1
3638
},
37-
validators: [{ signer: alice, delegation: 5000, deposit: 100000 }]
39+
validators: [
40+
{ signer: alice, delegation: 5000, deposit: 100000 },
41+
{ signer: bob }
42+
]
3843
});
3944

4045
it("Alice should success creating terms", async function() {

0 commit comments

Comments
 (0)