make getRoot return next session if possible
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
f9015bf9a5
commit
412185b667
@ -69,7 +69,12 @@ abstract contract Weaver is IWeaver {
|
||||
}
|
||||
}
|
||||
|
||||
return (currentLevel[0], _filledEntries[session]);
|
||||
uint256 nextSession = session;
|
||||
if (nextSession < currentSession) {
|
||||
unchecked { ++nextSession; }
|
||||
}
|
||||
|
||||
return (currentLevel[0], nextSession);
|
||||
}
|
||||
|
||||
function getProof(
|
||||
|
||||
@ -173,6 +173,7 @@ contract GatekeeperWeaverTest is Test {
|
||||
assertEq(gatekeeper.slotLengths(session + 1, 0), 1);
|
||||
assertEq(prevEntries, gatekeeper.ENTRIES());
|
||||
assertEq(gatekeeper.filledEntries(session + 1), 1);
|
||||
assertEq(session + 1, gatekeeper.currentSession());
|
||||
|
||||
session += 1;
|
||||
previousHash = bytes32(0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user