Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test send specific receipts (Part 2) #113

Merged
merged 14 commits into from
Nov 7, 2023

Conversation

gwen917
Copy link
Contributor

@gwen917 gwen917 commented Nov 6, 2023

Why this should be merged

Implements the following test cases from #94

  • Relayer manually retries sending of specific receipts.

How this works

See above

How this was tested

New E2E test cases

How is this documented

@gwen917 gwen917 changed the title Test send specific receipts Test send specific receipts (Part 3) Nov 6, 2023
@gwen917 gwen917 mentioned this pull request Nov 6, 2023
24 tasks
tests/send_specific_receipts.go Outdated Show resolved Hide resolved
amount, err := subnetATeleporterMessenger.CheckRelayerRewardAmount(&bind.CallOpts{}, fundedAddress, mockTokenAddress)
Expect(err).Should(BeNil())
Expect(amount).Should(Equal(big.NewInt(10)))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an additional step of sending an arbitrary message from Subnet B -> Subnet A? This message will also include the receipts that were explicitly sent in the above steps. We should check that the relayer reward amount is unchanged, even after the receipt is delivered again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. Then, will it cover Test receiving a receipt multiple times has no effect case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup it will! I pointed it out for completeness here, but that will also cover that test case.

@gwen917 gwen917 changed the base branch from test-case-insufficient-gas to general-e2e November 7, 2023 15:38
@gwen917 gwen917 changed the title Test send specific receipts (Part 3) Test send specific receipts (Part 2) Nov 7, 2023
Copy link
Contributor

@cam-schultz cam-schultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two nits otherwise LGTM!

Expect(err).Should(BeNil())
Expect(amount).Should(Equal(big.NewInt(10)))

// Send message from Subnet B to Subnet A
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Send message from Subnet B to Subnet A
// Send message from Subnet B to Subnet A to trigger the "regular" method of delivering receipts.
// The next message from B->A will contain the same receipts that were manually sent in the above steps,
// but they should not be processed again on Subnet A.

DestinationAddress: fundedAddress,
FeeInfo: teleportermessenger.TeleporterFeeInfo{
ContractAddress: mockTokenAddress,
Amount: big.NewInt(5),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you replace thi and big.NetInt(10) below with variables? E.g. relayerFeePerMessage and totalAccumulatedRelayerFee

@gwen917 gwen917 merged commit e8a3751 into general-e2e Nov 7, 2023
10 checks passed
@gwen917 gwen917 deleted the test-case-send-specific-receipts branch November 7, 2023 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants