Skip to content

Commit

Permalink
chore: remove update operator test
Browse files Browse the repository at this point in the history
  • Loading branch information
huyhuynh3103 committed Feb 2, 2024
1 parent f861782 commit 94e8482
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 63 deletions.
5 changes: 0 additions & 5 deletions test/bridge/integration/BaseIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -563,15 +563,10 @@ contract BaseIntegration_Test is Base_Test {

function _wrapUpEpoch() internal {
uint256 multiplier = _validatorSet.numberOfBlocksInEpoch();
console.log("Before roll block.number: ", block.number);

vm.roll((block.number / multiplier + 1) * multiplier - 1);
console.log("After roll block.number: ", block.number);

vm.prank(block.coinbase);
console.log("Before wrap up", _validatorSet.currentPeriod());
_validatorSet.wrapUpEpoch();
console.log("After wrap up", _validatorSet.currentPeriod());
}

function _setTimestampToPeriodEnding() internal {
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test {

Transfer.Receipt[] _depositReceipts;
uint256 _numOperatorsForVoteExecuted;
Transfer.Receipt[] first50Receipts;
Transfer.Receipt[] second50Receipts;

function setUp() public virtual override {
super.setUp();
Expand Down Expand Up @@ -83,60 +81,4 @@ contract DepositVote_RoninGatewayV3_Test is BaseIntegration_Test {
assertEq(totalWeight, (_numOperatorsForVoteExecuted) * 100);
}
}

function test_bulkDeposit_100Txs() public {
_setTimestampToPeriodEnding();
_wrapUpEpochAndMine();
_wrapUpEpochAndMine();

vm.deal(address(_bridgeReward), 10 ether);
address newBridgeOperator = makeAddr("new-bridge-operator");
Transfer.Receipt memory sampleReceipt = Transfer.Receipt({
id: 0,
kind: Transfer.Kind.Deposit,
ronin: Token.Owner({ addr: makeAddr("recipient"), tokenAddr: address(_roninWeth), chainId: _param.test.roninChainId }),
mainchain: Token.Owner({
addr: makeAddr("requester"),
tokenAddr: address(_mainchainWeth),
chainId: _param.test.mainchainChainId
}),
info: Token.Info({ erc: Token.Standard.ERC20, id: 0, quantity: 100 })
});

uint256 id = 1;
for (uint256 i; i < 50; i++) {
first50Receipts.push(sampleReceipt);
second50Receipts.push(sampleReceipt);
first50Receipts[i].id = id;
second50Receipts[i].id = id + 50;

id++;
}

for (uint256 i; i < _numOperatorsForVoteExecuted; i++) {
vm.prank(_param.roninBridgeManager.bridgeOperators[i]);
_roninGatewayV3.tryBulkDepositFor(first50Receipts);
}

vm.prank(_param.roninBridgeManager.governors[0]);
_roninBridgeManager.updateBridgeOperator(newBridgeOperator);

_param.roninBridgeManager.bridgeOperators[0] = newBridgeOperator;

for (uint256 i; i < _numOperatorsForVoteExecuted; i++) {
vm.prank(_param.roninBridgeManager.bridgeOperators[i]);
_roninGatewayV3.tryBulkDepositFor(second50Receipts);
}

_setTimestampToPeriodEnding();
_wrapUpEpochAndMine();
_wrapUpEpochAndMine();

sampleReceipt.id = 101;

for (uint256 i; i < _numOperatorsForVoteExecuted; i++) {
vm.prank(_param.roninBridgeManager.bridgeOperators[i]);
_roninGatewayV3.depositFor(sampleReceipt);
}
}
}

0 comments on commit 94e8482

Please sign in to comment.