From 0a47999fccf62423a10b7d861e904cb773ae9e1c Mon Sep 17 00:00:00 2001 From: ericlee Date: Tue, 5 Mar 2024 10:54:14 +0800 Subject: [PATCH] feat: more clear revert msg for invalid newEpoch in commitEpoch --- contracts/SequencerSet.sol | 2 +- ts-src/test/SequencerSet.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/SequencerSet.sol b/contracts/SequencerSet.sol index 362ca84..f7e3037 100644 --- a/contracts/SequencerSet.sol +++ b/contracts/SequencerSet.sol @@ -173,7 +173,7 @@ contract MetisSequencerSet is OwnableUpgradeable { } // check conditions - require(_newEpoch == curEpochId + 1, "Invalid epoch id"); + require(_newEpoch == curEpochId + 1, "Invalid new epoch number"); require( _endBlock > _startBlock, "End block must be greater than start block" diff --git a/ts-src/test/SequencerSet.ts b/ts-src/test/SequencerSet.ts index 651cb34..8df5bf0 100644 --- a/ts-src/test/SequencerSet.ts +++ b/ts-src/test/SequencerSet.ts @@ -150,7 +150,7 @@ describe("MetisSequencerSet", async () => { await expect( seqset.connect(mpc).commitEpoch(currentEpochNumber + 2n, 600, 799, seq1), - ).to.revertedWith("Invalid epoch id"); + ).to.revertedWith("Invalid new epoch number"); await expect( seqset.connect(mpc).commitEpoch(currentEpochNumber + 1n, 900, 799, seq1),