Skip to content

Commit 7df6f1a

Browse files
committed
test(chain): LocalChain test for update that is shorter than original
1 parent b486ecc commit 7df6f1a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

crates/chain/tests/test_local_chain.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,27 @@ fn update_local_chain() {
292292
],
293293
},
294294
},
295+
// Allow update that is shorter than original chain
296+
// | 0 | 1 | 2 | 3 | 4 | 5
297+
// chain | A C D E F
298+
// update | A C D'
299+
TestLocalChain {
300+
name: "allow update that is shorter than original chain",
301+
chain: local_chain![(0, h!("_")), (2, h!("C")), (3, h!("D")), (4, h!("E")), (5, h!("F"))],
302+
update: chain_update![(0, h!("_")), (2, h!("C")), (3, h!("D'"))],
303+
exp: ExpectedResult::Ok {
304+
changeset: &[
305+
(3, Some(h!("D'"))),
306+
(4, None),
307+
(5, None),
308+
],
309+
init_changeset: &[
310+
(0, Some(h!("_"))),
311+
(2, Some(h!("C"))),
312+
(3, Some(h!("D'"))),
313+
],
314+
},
315+
},
295316
]
296317
.into_iter()
297318
.for_each(TestLocalChain::run);

0 commit comments

Comments
 (0)