Skip to content

Commit

Permalink
refactor: rename event
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Sep 30, 2024
1 parent d31d882 commit e130127
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/contracts-rfq/contracts/FastBridgeV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ contract FastBridgeV2 is Admin, IFastBridgeV2, IFastBridgeV2Errors {
params.destAmount,
params.sendChainGas
);
emit BridgeRequestedV2(transactionId, paramsV2.quoteId);
emit BridgeQuoteDetails(transactionId, paramsV2.quoteId);
}

/// @inheritdoc IFastBridge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ interface IFastBridgeV2 is IFastBridge {
uint256 exclusivityEndTime;
}

event BridgeRequestedV2(bytes32 indexed transactionId, bytes quoteId);
event BridgeQuoteDetails(bytes32 indexed transactionId, bytes quoteId);

/// @notice Initiates bridge on origin chain to be relayed by off-chain relayer, with the ability
/// to provide temporary exclusivity fill rights for the quote relayer.
Expand Down
16 changes: 8 additions & 8 deletions packages/contracts-rfq/test/FastBridgeV2.Src.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ contract FastBridgeV2SrcTest is FastBridgeV2SrcBaseTest {

event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);

event BridgeRequestedV2(bytes32 indexed transactionId, bytes quoteId);
event BridgeQuoteDetails(bytes32 indexed transactionId, bytes quoteId);

address public claimTo = makeAddr("Claim To");

Expand All @@ -46,9 +46,9 @@ contract FastBridgeV2SrcTest is FastBridgeV2SrcBaseTest {
});
}

function expectBridgeRequestedV2(bytes32 txId, bytes memory quoteId) public {
function expectBridgeQuoteDetails(bytes32 txId, bytes memory quoteId) public {
vm.expectEmit(address(fastBridge));
emit BridgeRequestedV2({transactionId: txId, quoteId: quoteId});
emit BridgeQuoteDetails({transactionId: txId, quoteId: quoteId});
}

function expectBridgeProofProvided(bytes32 txId, address relayer, bytes32 destTxHash) public {
Expand Down Expand Up @@ -101,7 +101,7 @@ contract FastBridgeV2SrcTest is FastBridgeV2SrcBaseTest {
function test_bridge_token() public {
bytes32 txId = getTxId(tokenTx);
expectBridgeRequested(tokenTx, txId);
expectBridgeRequestedV2(txId, tokenParamsV2.quoteId);
expectBridgeQuoteDetails(txId, tokenParamsV2.quoteId);
bridge({caller: userA, msgValue: 0, params: tokenParams});
assertEq(fastBridge.bridgeStatuses(txId), IFastBridgeV2.BridgeStatus.REQUESTED);
checkTokenBalancesAfterBridge(userA);
Expand All @@ -110,7 +110,7 @@ contract FastBridgeV2SrcTest is FastBridgeV2SrcBaseTest {
function test_bridge_token_diffSender() public {
bytes32 txId = getTxId(tokenTx);
expectBridgeRequested(tokenTx, txId);
expectBridgeRequestedV2(txId, tokenParamsV2.quoteId);
expectBridgeQuoteDetails(txId, tokenParamsV2.quoteId);
bridge({caller: userB, msgValue: 0, params: tokenParams});
assertEq(fastBridge.bridgeStatuses(txId), IFastBridgeV2.BridgeStatus.REQUESTED);
assertEq(srcToken.balanceOf(userA), LEFTOVER_BALANCE + tokenParams.originAmount);
Expand All @@ -128,7 +128,7 @@ contract FastBridgeV2SrcTest is FastBridgeV2SrcBaseTest {
bridge({caller: userA, msgValue: 0, params: tokenParams});
bytes32 txId = getTxId(ethTx);
expectBridgeRequested(ethTx, txId);
expectBridgeRequestedV2(txId, ethParamsV2.quoteId);
expectBridgeQuoteDetails(txId, ethParamsV2.quoteId);
bridge({caller: userA, msgValue: ethParams.originAmount, params: ethParams});
assertEq(fastBridge.bridgeStatuses(txId), IFastBridgeV2.BridgeStatus.REQUESTED);
checkEthBalancesAfterBridge(userA);
Expand All @@ -139,7 +139,7 @@ contract FastBridgeV2SrcTest is FastBridgeV2SrcBaseTest {
bridge({caller: userA, msgValue: 0, params: tokenParams});
bytes32 txId = getTxId(ethTx);
expectBridgeRequested(ethTx, txId);
expectBridgeRequestedV2(txId, ethParamsV2.quoteId);
expectBridgeQuoteDetails(txId, ethParamsV2.quoteId);
bridge({caller: userB, msgValue: ethParams.originAmount, params: ethParams});
assertEq(fastBridge.bridgeStatuses(txId), IFastBridgeV2.BridgeStatus.REQUESTED);
assertEq(userA.balance, LEFTOVER_BALANCE + ethParams.originAmount);
Expand All @@ -155,7 +155,7 @@ contract FastBridgeV2SrcTest is FastBridgeV2SrcBaseTest {
ethTx.originSender = userB;
bytes32 txId = getTxId(ethTx);
expectBridgeRequested(ethTx, txId);
expectBridgeRequestedV2(txId, ethParamsV2.quoteId);
expectBridgeQuoteDetails(txId, ethParamsV2.quoteId);
bridge({caller: userB, msgValue: ethParams.originAmount, params: ethParams});
assertEq(fastBridge.bridgeStatuses(txId), IFastBridgeV2.BridgeStatus.REQUESTED);
checkEthBalancesAfterBridge(userB);
Expand Down

0 comments on commit e130127

Please sign in to comment.