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 add additional fee amount (Part 1) #109

Merged
merged 8 commits into from
Nov 6, 2023

Conversation

gwen917
Copy link
Contributor

@gwen917 gwen917 commented Nov 5, 2023

Why this should be merged

Implements the following test cases from #94

  • Adding an extra fee amount after a message is submitted, checking relayer gets total amount as reward

How this works

See above

How this was tested

New E2E test cases

How is this documented

@gwen917 gwen917 mentioned this pull request Nov 5, 2023
24 tasks
@gwen917 gwen917 changed the title Test add additional fee amount Test add additional fee amount (Part 1) Nov 6, 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.

LGTM. Just some small comments. Let's prioritize getting this merged into general-e2e so that other PRs can integrate the abigen changes made here.

addFeeAmount(&network.LocalNetwork{})
}

func addFeeAmount(network network.Network) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's export this function so that a separate application can call it to test against Fuji

network.RelayMessage(ctx, sendCrossChainMsgReceipt.BlockHash, sendCrossChainMsgReceipt.BlockNumber, subnetAInfo, subnetBInfo)

// Check Teleporter message received on the destination
delivered, err := subnetBTeleporterMessenger.MessageReceived(&bind.CallOpts{}, subnetAInfo.BlockchainID, messageID)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a great way to call the contracts, I'll update my own PRs to use this interface

tests/utils/local_network_setup.go Show resolved Hide resolved
// check the fee amount
amount, err := subnetATeleporterMessenger.CheckRelayerRewardAmount(&bind.CallOpts{}, fundedAddress, mockTokenAddress)
Expect(err).Should(BeNil())
Expect(amount).Should(Equal(big.NewInt(1)))
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 variables initialFeeAmount and adjustedFeeAmount and check against those rather than checking against the number on its own?

@cam-schultz cam-schultz merged commit 0e8ef2d into general-e2e Nov 6, 2023
9 of 10 checks passed
@gwen917 gwen917 deleted the test-case-add-fee-amount branch November 6, 2023 20:41
minghinmatthewlam pushed a commit that referenced this pull request Oct 1, 2024
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.

2 participants