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

No transfer role integration test #420

Merged
merged 13 commits into from
Feb 24, 2025

Conversation

cosmatudor
Copy link

@cosmatudor cosmatudor commented Feb 6, 2025

Added e2e test for these 4 scenarios:

  • tokens with transfer role (happy flow)
  • refunds should work with tokens with transfer role
  • MultiversX tokens with transfer role but no one has it, blacklisted, frozen -> should fail when creating deposit
  • MultiversX tokens with transfer role only for Alice, blacklisted, frozen -> should fail when withdrawing fees

Refactoring

@cosmatudor cosmatudor self-assigned this Feb 6, 2025
@cosmatudor cosmatudor changed the base branch from main to feat/v3.1 February 6, 2025 14:09
@cosmatudor cosmatudor marked this pull request as draft February 6, 2025 14:09
cosmatudor and others added 8 commits February 10, 2025 18:18
# Conflicts:
#	integrationTests/relayers/slowTests/ethToMultiversXWithChainSimulator_test.go
#	integrationTests/relayers/slowTests/framework/multiversxHandler.go
#	integrationTests/relayers/slowTests/refundWithChainSimulator_test.go
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/bridge-proxy.abi.json
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/bridge-proxy.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/bridged-tokens-wrapper.abi.json
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/bridged-tokens-wrapper.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/esdt-safe.abi.json
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/esdt-safe.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/multi-transfer-esdt.abi.json
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/multi-transfer-esdt.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/multisig.abi.json
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/multisig.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/test-caller.abi.json
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/test-caller.wasm
# Conflicts:
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/bridge-proxy.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/bridged-tokens-wrapper.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/esdt-safe.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/helper-contract.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/multi-transfer-esdt.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/multisig.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/multiversx-price-aggregator-sc.abi.json
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/multiversx-price-aggregator-sc.wasm
#	integrationTests/relayers/slowTests/testdata/contracts/mvx/test-caller.wasm
t.Run("refunds should work with tokens with transfer role", func(t *testing.T) {
// usdc token
usdcToken := slowTests.GetSimplerVersionOfUSDCToken()
usdcToken.AddressesWithTransferRole = []string{framework.Alice, framework.SafeSC, framework.MultiTransfer, framework.ScProxy}
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder for myself: document this

getFunction string,
withdrawFunction string,
) {
queryParams := []string{
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe extract L1135-L1156 in a function and use it on L1082 to remove the duplicated code?

@@ -290,8 +290,8 @@ func (setup *TestSetup) AreAllTransfersCompleted(halfBridgeIdentifier HalfBridge
}

func (setup *TestSetup) isTransferDone(halfBridgeIdentifier HalfBridgeIdentifier, token TestTokenParams) bool {
// if token is prevented from whitelist, we can't check the balances
if token.PreventWhitelist {
// if token is prevented from whitelist or alice don't have the permission to transfer it, we can't check the balances
Copy link
Contributor

Choose a reason for hiding this comment

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

Alice *

@@ -534,4 +535,4 @@
]
}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

missing new line

@cosmatudor cosmatudor marked this pull request as ready for review February 24, 2025 09:38
@cosmatudor cosmatudor merged commit c4f11f7 into feat/v3.1 Feb 24, 2025
12 checks passed
@cosmatudor cosmatudor deleted the no-transfer-role-integration-test branch February 24, 2025 11:14
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.

3 participants