update kick from queue logic and add mordor to foundry.toml
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
efe1f7ce25
commit
2f8aedb6e3
@ -38,7 +38,9 @@ forge-std = { version = "1.9.2", url = "https://soldeer-revisions.s3.amazonaws.c
|
|||||||
anvil-localnet = "http://127.0.0.1:8545"
|
anvil-localnet = "http://127.0.0.1:8545"
|
||||||
sepolia-testnet = "${SEPOLIA_TEST_RPC_URL}"
|
sepolia-testnet = "${SEPOLIA_TEST_RPC_URL}"
|
||||||
hoodi-testnet = "${HOODI_TEST_RPC_URL}"
|
hoodi-testnet = "${HOODI_TEST_RPC_URL}"
|
||||||
|
mordor-testnet = "${MORDOR_TEST_RPC_URL}"
|
||||||
|
|
||||||
[etherscan]
|
[etherscan]
|
||||||
sepolia-testnet = { key = "${SEPOLIA_TEST_API_KEY}", url = "${SEPOLIA_TEST_ENDPOINT}" }
|
sepolia-testnet = { key = "${SEPOLIA_TEST_API_KEY}", url = "${SEPOLIA_TEST_ENDPOINT}" }
|
||||||
hoodi-testnet = { key = "${HOODI_TEST_API_KEY}", url = "${HOODI_TEST_ENDPOINT}" }
|
hoodi-testnet = { key = "${HOODI_TEST_API_KEY}", url = "${HOODI_TEST_ENDPOINT}" }
|
||||||
|
mordor-testnet = { key = "${MORDOR_TEST_API_KEY}", url = "${MORDOR_TEST_ENDPOINT}" }
|
||||||
|
|||||||
@ -115,19 +115,17 @@ contract GhostGovernor is
|
|||||||
revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);
|
revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proposerVotes <= activeProposedLock) {
|
|
||||||
revert ProposerNotEnoughVotes(proposerVotes, activeProposedLock);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint256 proposalId = _lastProposalId;
|
uint256 proposalId = _lastProposalId;
|
||||||
if (proposalId != 0) {
|
if (proposalId != 0) {
|
||||||
bytes32 currentProposalState = _encodeStateBitmap(state(proposalId));
|
bytes32 currentProposalState = _encodeStateBitmap(state(proposalId));
|
||||||
bytes32 terminalStatesBitmap =
|
bytes32 activePendingMask =
|
||||||
_encodeStateBitmap(ProposalState.Canceled) |
|
_encodeStateBitmap(ProposalState.Pending) |
|
||||||
_encodeStateBitmap(ProposalState.Expired) |
|
_encodeStateBitmap(ProposalState.Active);
|
||||||
_encodeStateBitmap(ProposalState.Executed);
|
|
||||||
|
|
||||||
if (currentProposalState & terminalStatesBitmap == 0) {
|
if (currentProposalState & activePendingMask != 0) {
|
||||||
|
if (proposerVotes <= activeProposedLock) {
|
||||||
|
revert ProposerNotEnoughVotes(proposerVotes, activeProposedLock);
|
||||||
|
}
|
||||||
(
|
(
|
||||||
address[] memory currentTargets,
|
address[] memory currentTargets,
|
||||||
uint256[] memory currentValues,
|
uint256[] memory currentValues,
|
||||||
|
|||||||
@ -260,7 +260,7 @@ contract GhostGovernorTest is Test {
|
|||||||
vm.roll(block.number + 3);
|
vm.roll(block.number + 3);
|
||||||
|
|
||||||
(uint256 newProposalId,,,,) = _proposeDummy(carol, 1337);
|
(uint256 newProposalId,,,,) = _proposeDummy(carol, 1337);
|
||||||
assertEq(uint8(governor.state(proposalId)), uint8(IGovernor.ProposalState.Canceled));
|
assertEq(uint8(governor.state(proposalId)), uint8(IGovernor.ProposalState.Succeeded));
|
||||||
assertEq(uint8(governor.state(newProposalId)), uint8(IGovernor.ProposalState.Pending));
|
assertEq(uint8(governor.state(newProposalId)), uint8(IGovernor.ProposalState.Pending));
|
||||||
|
|
||||||
assertEq(ghst.balanceOf(alice), amount);
|
assertEq(ghst.balanceOf(alice), amount);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user