diff --git a/integrationTests/relayers/slowTests/common.go b/integrationTests/relayers/slowTests/common.go index 6a61f79f..cedf6816 100644 --- a/integrationTests/relayers/slowTests/common.go +++ b/integrationTests/relayers/slowTests/common.go @@ -127,12 +127,15 @@ func GenerateTestUSDCToken() framework.TestTokenParams { }, }, MintBurnChecks: &framework.MintBurnBalances{ - TotalUniversalMint: big.NewInt(5000 + 7000 + 1000), - TotalChainSpecificMint: big.NewInt(5000 + 7000 + 1000 + 900), - TotalUniversalBurn: big.NewInt(2500 + 300), - TotalChainSpecificBurn: big.NewInt(2500 - 50 + 300 - 50 + 900 - 50), - SafeMintValue: big.NewInt(5000 + 7000 + 1000 + 900), - SafeBurnValue: big.NewInt(2500 - 50 + 300 - 50 + 900 - 50), + MvxTotalUniversalMint: big.NewInt(5000 + 7000 + 1000), + MvxTotalChainSpecificMint: big.NewInt(5000 + 7000 + 1000 + 900), + MvxTotalUniversalBurn: big.NewInt(2500 + 300), + MvxTotalChainSpecificBurn: big.NewInt(2500 - 50 + 300 - 50 + 900 - 50), + MvxSafeMintValue: big.NewInt(5000 + 7000 + 1000 + 900), + MvxSafeBurnValue: big.NewInt(2500 - 50 + 300 - 50 + 900 - 50), + + EthSafeMintValue: big.NewInt(0), + EthSafeBurnValue: big.NewInt(0), }, SpecialChecks: &framework.SpecialBalanceChecks{ WrapperDeltaLiquidityCheck: big.NewInt(5000 + 7000 + 1000 - 2500 - 300), @@ -155,9 +158,9 @@ func ApplyUSDCRefundBalances(token *framework.TestTokenParams) { // we need to subtract the refunded value from the wrapper contract token.DeltaBalances[framework.SecondHalfBridge][framework.WrapperSC].OnMvx = big.NewInt(5000 + 7000 + 1000 - 2500 - 300 - 1000) - token.MintBurnChecks.TotalChainSpecificBurn = big.NewInt(2500 - 50 + 300 - 50 + 1000 - 50 + 900 - 50) - token.MintBurnChecks.TotalUniversalBurn = big.NewInt(2500 + 300 + 1000) - token.MintBurnChecks.SafeBurnValue = big.NewInt(2500 - 50 + 300 - 50 + 1000 - 50 + 900 - 50) + token.MintBurnChecks.MvxTotalChainSpecificBurn = big.NewInt(2500 - 50 + 300 - 50 + 1000 - 50 + 900 - 50) + token.MintBurnChecks.MvxTotalUniversalBurn = big.NewInt(2500 + 300 + 1000) + token.MintBurnChecks.MvxSafeBurnValue = big.NewInt(2500 - 50 + 300 - 50 + 1000 - 50 + 900 - 50) token.SpecialChecks.WrapperDeltaLiquidityCheck = big.NewInt(5000 + 7000 + 1000 - 2500 - 300 - 1000) } @@ -267,12 +270,15 @@ func GenerateTestMEMEToken() framework.TestTokenParams { }, }, MintBurnChecks: &framework.MintBurnBalances{ - TotalUniversalMint: big.NewInt(0), - TotalChainSpecificMint: big.NewInt(0), - TotalUniversalBurn: big.NewInt(0), - TotalChainSpecificBurn: big.NewInt(0), - SafeMintValue: big.NewInt(0), - SafeBurnValue: big.NewInt(0), + MvxTotalUniversalMint: big.NewInt(0), + MvxTotalChainSpecificMint: big.NewInt(0), + MvxTotalUniversalBurn: big.NewInt(0), + MvxTotalChainSpecificBurn: big.NewInt(0), + MvxSafeMintValue: big.NewInt(0), + MvxSafeBurnValue: big.NewInt(0), + + EthSafeMintValue: big.NewInt(4000 - 50 + 6000 - 50 + 2000 - 50), + EthSafeBurnValue: big.NewInt(2400 + 200 + 1000), }, SpecialChecks: &framework.SpecialBalanceChecks{ WrapperDeltaLiquidityCheck: big.NewInt(0), @@ -288,6 +294,8 @@ func ApplyMEMERefundBalances(token *framework.TestTokenParams) { token.DeltaBalances[framework.SecondHalfBridge][framework.Bob].OnEth = big.NewInt(4000 - 50 - 2400 + 6000 - 50 - 200 + 2000 - 50 - 1000 + 950) // no funds remain in the test caller SC token.DeltaBalances[framework.SecondHalfBridge][framework.CalledTestSC].OnMvx = big.NewInt(0) + + token.MintBurnChecks.EthSafeMintValue = big.NewInt(4000 - 50 + 6000 - 50 + 2000 - 50 + 1000 - 50) } // GenerateTestEUROCToken will generate a test EUROC token @@ -399,12 +407,15 @@ func GenerateTestEUROCToken() framework.TestTokenParams { }, }, MintBurnChecks: &framework.MintBurnBalances{ - TotalUniversalMint: big.NewInt(5010 + 7010 + 1010 + 700), - TotalChainSpecificMint: big.NewInt(0), - TotalUniversalBurn: big.NewInt(2510 - 50 + 310 - 50 + 700 - 50), - TotalChainSpecificBurn: big.NewInt(0), - SafeMintValue: big.NewInt(5010 + 7010 + 1010 + 700), - SafeBurnValue: big.NewInt(2510 - 50 + 310 - 50 + 700 - 50), + MvxTotalUniversalMint: big.NewInt(5010 + 7010 + 1010 + 700), + MvxTotalChainSpecificMint: big.NewInt(0), + MvxTotalUniversalBurn: big.NewInt(2510 - 50 + 310 - 50 + 700 - 50), + MvxTotalChainSpecificBurn: big.NewInt(0), + MvxSafeMintValue: big.NewInt(5010 + 7010 + 1010 + 700), + MvxSafeBurnValue: big.NewInt(2510 - 50 + 310 - 50 + 700 - 50), + + EthSafeMintValue: big.NewInt(2510 - 50 + 310 - 50 + 650), + EthSafeBurnValue: big.NewInt(5010 + 7010 + 1010 + 700), }, SpecialChecks: &framework.SpecialBalanceChecks{ WrapperDeltaLiquidityCheck: big.NewInt(0), @@ -423,8 +434,9 @@ func ApplyEUROCRefundBalances(token *framework.TestTokenParams) { // no funds remain in the called test SC token.DeltaBalances[framework.SecondHalfBridge][framework.CalledTestSC].OnMvx = big.NewInt(0) - token.MintBurnChecks.TotalUniversalBurn = big.NewInt(2510 - 50 + 310 - 50 + 700 - 50 + 1010 - 50) - token.MintBurnChecks.SafeBurnValue = big.NewInt(2510 - 50 + 310 - 50 + 700 - 50 + 1010 - 50) + token.MintBurnChecks.MvxTotalUniversalBurn = big.NewInt(2510 - 50 + 310 - 50 + 700 - 50 + 1010 - 50) + token.MintBurnChecks.MvxSafeBurnValue = big.NewInt(2510 - 50 + 310 - 50 + 700 - 50 + 1010 - 50) + token.MintBurnChecks.EthSafeMintValue = big.NewInt(2510 - 50 + 310 - 50 + 650 + 1010 - 50) } // GenerateTestMEXToken will generate a test MEX token @@ -532,12 +544,15 @@ func GenerateTestMEXToken() framework.TestTokenParams { }, }, MintBurnChecks: &framework.MintBurnBalances{ - TotalUniversalMint: big.NewInt(2410 + 210 + 1010), - TotalChainSpecificMint: big.NewInt(0), - TotalUniversalBurn: big.NewInt(4010 - 50 + 6010 - 50 + 2010 - 50), - TotalChainSpecificBurn: big.NewInt(0), - SafeMintValue: big.NewInt(2410 + 210 + 1010), - SafeBurnValue: big.NewInt(4010 - 50 + 6010 - 50 + 2010 - 50), + MvxTotalUniversalMint: big.NewInt(2410 + 210 + 1010), + MvxTotalChainSpecificMint: big.NewInt(0), + MvxTotalUniversalBurn: big.NewInt(4010 - 50 + 6010 - 50 + 2010 - 50), + MvxTotalChainSpecificBurn: big.NewInt(0), + MvxSafeMintValue: big.NewInt(2410 + 210 + 1010), + MvxSafeBurnValue: big.NewInt(4010 - 50 + 6010 - 50 + 2010 - 50), + + EthSafeMintValue: big.NewInt(4010 - 50 + 6010 - 50 + 2010 - 50), + EthSafeBurnValue: big.NewInt(2410 + 210 + 1010), }, SpecialChecks: &framework.SpecialBalanceChecks{ WrapperDeltaLiquidityCheck: big.NewInt(0), @@ -554,8 +569,9 @@ func ApplyMEXRefundBalances(token *framework.TestTokenParams) { // no funds remain in the test caller SC token.DeltaBalances[framework.SecondHalfBridge][framework.CalledTestSC].OnMvx = big.NewInt(0) - token.MintBurnChecks.TotalUniversalBurn = big.NewInt(4010 - 50 + 6010 - 50 + 2010 - 50 + 1010 - 50) - token.MintBurnChecks.SafeBurnValue = big.NewInt(4010 - 50 + 6010 - 50 + 2010 - 50 + 1010 - 50) + token.MintBurnChecks.MvxTotalUniversalBurn = big.NewInt(4010 - 50 + 6010 - 50 + 2010 - 50 + 1010 - 50) + token.MintBurnChecks.MvxSafeBurnValue = big.NewInt(4010 - 50 + 6010 - 50 + 2010 - 50 + 1010 - 50) + token.MintBurnChecks.EthSafeMintValue = big.NewInt(4010 - 50 + 6010 - 50 + 2010 - 50 + 1010 - 50) } // GenerateUnlistedTokenFromEth will generate an unlisted token on Eth @@ -650,12 +666,12 @@ func GenerateUnlistedTokenFromEth() framework.TestTokenParams { }, }, MintBurnChecks: &framework.MintBurnBalances{ - TotalUniversalMint: big.NewInt(0), - TotalChainSpecificMint: big.NewInt(0), - TotalUniversalBurn: big.NewInt(0), - TotalChainSpecificBurn: big.NewInt(0), - SafeMintValue: big.NewInt(0), - SafeBurnValue: big.NewInt(0), + MvxTotalUniversalMint: big.NewInt(0), + MvxTotalChainSpecificMint: big.NewInt(0), + MvxTotalUniversalBurn: big.NewInt(0), + MvxTotalChainSpecificBurn: big.NewInt(0), + MvxSafeMintValue: big.NewInt(0), + MvxSafeBurnValue: big.NewInt(0), }, SpecialChecks: &framework.SpecialBalanceChecks{ WrapperDeltaLiquidityCheck: big.NewInt(0), @@ -753,12 +769,15 @@ func GenerateUnlistedTokenFromMvx() framework.TestTokenParams { }, }, MintBurnChecks: &framework.MintBurnBalances{ - TotalUniversalMint: big.NewInt(0), - TotalChainSpecificMint: big.NewInt(0), - TotalUniversalBurn: big.NewInt(0), - TotalChainSpecificBurn: big.NewInt(0), - SafeMintValue: big.NewInt(0), - SafeBurnValue: big.NewInt(0), + MvxTotalUniversalMint: big.NewInt(0), + MvxTotalChainSpecificMint: big.NewInt(0), + MvxTotalUniversalBurn: big.NewInt(0), + MvxTotalChainSpecificBurn: big.NewInt(0), + MvxSafeMintValue: big.NewInt(0), + MvxSafeBurnValue: big.NewInt(0), + + EthSafeMintValue: big.NewInt(0), + EthSafeBurnValue: big.NewInt(0), }, SpecialChecks: &framework.SpecialBalanceChecks{ WrapperDeltaLiquidityCheck: big.NewInt(0), diff --git a/integrationTests/relayers/slowTests/edgeCases_test.go b/integrationTests/relayers/slowTests/edgeCases_test.go index d35932b9..e820e50e 100644 --- a/integrationTests/relayers/slowTests/edgeCases_test.go +++ b/integrationTests/relayers/slowTests/edgeCases_test.go @@ -96,12 +96,12 @@ func TestRelayerShouldExecuteSimultaneousSwapsAndNotCatchErrors(t *testing.T) { }, } usdcToken.MintBurnChecks = &framework.MintBurnBalances{ - TotalUniversalMint: big.NewInt(5000 + 5000), - TotalChainSpecificMint: big.NewInt(5000 + 5000), - TotalUniversalBurn: big.NewInt(200), - TotalChainSpecificBurn: big.NewInt(200 - 50), - SafeMintValue: big.NewInt(5000 + 5000), - SafeBurnValue: big.NewInt(200 - 50), + MvxTotalUniversalMint: big.NewInt(5000 + 5000), + MvxTotalChainSpecificMint: big.NewInt(5000 + 5000), + MvxTotalUniversalBurn: big.NewInt(200), + MvxTotalChainSpecificBurn: big.NewInt(200 - 50), + MvxSafeMintValue: big.NewInt(5000 + 5000), + MvxSafeBurnValue: big.NewInt(200 - 50), } usdcToken.SpecialChecks.WrapperDeltaLiquidityCheck = big.NewInt(5000 + 5000 - 200) diff --git a/integrationTests/relayers/slowTests/ethToMultiversXWithChainSimulator_test.go b/integrationTests/relayers/slowTests/ethToMultiversXWithChainSimulator_test.go index 9c4b5beb..7f4b5a58 100644 --- a/integrationTests/relayers/slowTests/ethToMultiversXWithChainSimulator_test.go +++ b/integrationTests/relayers/slowTests/ethToMultiversXWithChainSimulator_test.go @@ -147,7 +147,7 @@ func TestRelayersShouldExecuteTransfersWithInitSupply(t *testing.T) { usdcInitialValue := big.NewInt(100000) usdcToken := GenerateTestUSDCToken() usdcToken.InitialSupplyValue = usdcInitialValue.String() - usdcToken.MintBurnChecks.SafeMintValue.Add(usdcToken.MintBurnChecks.SafeMintValue, usdcInitialValue) + usdcToken.MintBurnChecks.MvxSafeMintValue.Add(usdcToken.MintBurnChecks.MvxSafeMintValue, usdcInitialValue) memeInitialValue := big.NewInt(200000) memeToken := GenerateTestMEMEToken() @@ -165,12 +165,12 @@ func TestRelayersShouldExecuteTransfersWithInitSupplyMintBurn(t *testing.T) { eurocInitialValue := big.NewInt(100010) eurocToken := GenerateTestEUROCToken() eurocToken.InitialSupplyValue = eurocInitialValue.String() - eurocToken.MintBurnChecks.SafeMintValue.Add(eurocToken.MintBurnChecks.SafeMintValue, eurocInitialValue) + eurocToken.MintBurnChecks.MvxSafeMintValue.Add(eurocToken.MintBurnChecks.MvxSafeMintValue, eurocInitialValue) mexInitialValue := big.NewInt(300000) mexToken := GenerateTestMEXToken() mexToken.InitialSupplyValue = mexInitialValue.String() - mexToken.MintBurnChecks.SafeBurnValue.Add(mexToken.MintBurnChecks.SafeBurnValue, mexInitialValue) + mexToken.MintBurnChecks.MvxSafeBurnValue.Add(mexToken.MintBurnChecks.MvxSafeBurnValue, mexInitialValue) _ = testRelayersWithChainSimulatorAndTokens( t, @@ -373,12 +373,12 @@ func createBadToken() framework.TestTokenParams { }, }, MintBurnChecks: &framework.MintBurnBalances{ - TotalUniversalMint: big.NewInt(0), - TotalChainSpecificMint: big.NewInt(0), - TotalUniversalBurn: big.NewInt(0), - TotalChainSpecificBurn: big.NewInt(0), - SafeMintValue: big.NewInt(0), - SafeBurnValue: big.NewInt(0), + MvxTotalUniversalMint: big.NewInt(0), + MvxTotalChainSpecificMint: big.NewInt(0), + MvxTotalUniversalBurn: big.NewInt(0), + MvxTotalChainSpecificBurn: big.NewInt(0), + MvxSafeMintValue: big.NewInt(0), + MvxSafeBurnValue: big.NewInt(0), }, } } diff --git a/integrationTests/relayers/slowTests/framework/testSetup.go b/integrationTests/relayers/slowTests/framework/testSetup.go index d349a5df..d0792ed0 100644 --- a/integrationTests/relayers/slowTests/framework/testSetup.go +++ b/integrationTests/relayers/slowTests/framework/testSetup.go @@ -369,148 +369,6 @@ func (setup *TestSetup) getEthAddressFromEntityName(entityName string) (common.A return common.Address{}, false } -func (setup *TestSetup) checkContractMvxBalanceForToken(params TestTokenParams) bool { - mvxBalance := setup.MultiversxHandler.GetESDTUniversalTokenBalance(setup.Ctx, setup.MultiversxHandler.CalleeScAddress, params.AbstractTokenIdentifier) - expectedValueOnContract := big.NewInt(0) - for _, operation := range params.TestOperations { - if operation.ValueToTransferToMvx == nil { - continue - } - if !setup.hasCallData(operation) { - continue - } - if operation.MvxFaultySCCall { - continue - } - - expectedValueOnContract.Add(expectedValueOnContract, operation.ValueToTransferToMvx) - } - - return mvxBalance.String() == expectedValueOnContract.String() -} - -func (setup *TestSetup) checkEthBurnedTokenBalance(params TestTokenParams) bool { - token := setup.GetTokenData(params.AbstractTokenIdentifier) - burnedTokens := setup.EthereumHandler.GetBurnBalanceForToken(setup.Ctx, token.EthErc20Address) - - expectedValue := setup.computeExpectedValueToMvx(params) - - if params.IsNativeOnEth { - if params.InitialSupplyValue != "" { - if initialSupply, ok := new(big.Int).SetString(params.InitialSupplyValue, 10); ok { - expectedValue.Add(expectedValue, initialSupply) - } - } - } - - return burnedTokens.String() == expectedValue.String() -} - -func (setup *TestSetup) checkMvxMintedBalanceForToken(params TestTokenParams) bool { - token := setup.GetTokenData(params.AbstractTokenIdentifier) - mintedTokens := setup.MultiversxHandler.GetMintedAmountForToken(setup.Ctx, token.MvxChainSpecificToken) - - expectedValue := setup.computeExpectedValueToMvx(params) - - if params.IsNativeOnEth { - if params.InitialSupplyValue != "" { - if initialSupply, ok := new(big.Int).SetString(params.InitialSupplyValue, 10); ok { - expectedValue.Add(expectedValue, initialSupply) - } - } - } - - return mintedTokens.String() == expectedValue.String() -} - -func (setup *TestSetup) computeExpectedValueToMvx(params TestTokenParams) *big.Int { - expectedValue := big.NewInt(0) - for _, operation := range params.TestOperations { - if operation.ValueToTransferToMvx == nil { - continue - } - if operation.IsFaultyDeposit { - continue - } - - expectedValue.Add(expectedValue, operation.ValueToTransferToMvx) - } - - return expectedValue -} - -func (setup *TestSetup) computeExpectedValueFromMvx(params TestTokenParams) *big.Int { - expectedValue := big.NewInt(0) - for _, operation := range params.TestOperations { - if operation.ValueToSendFromMvX == nil { - continue - } - if operation.IsFaultyDeposit { - continue - } - - expectedValue.Add(expectedValue, operation.ValueToSendFromMvX) - expectedValue.Sub(expectedValue, feeInt) - } - - return expectedValue -} - -func (setup *TestSetup) checkMvxBurnedTokenBalance(params TestTokenParams) bool { - token := setup.GetTokenData(params.AbstractTokenIdentifier) - burnedTokens := setup.MultiversxHandler.GetBurnedAmountForToken(setup.Ctx, token.MvxChainSpecificToken) - - expectedValue := setup.computeExpectedValueFromMvx(params) - - if params.IsNativeOnMvX { - if params.InitialSupplyValue != "" { - if initialSupply, ok := new(big.Int).SetString(params.InitialSupplyValue, 10); ok { - expectedValue.Add(expectedValue, initialSupply) - } - } - } else { - expectedValue.Add(expectedValue, setup.getMvxTotalRefundAmountForToken(params)) // burn possible refund amount to be bridged back to Eth - } - - return burnedTokens.String() == expectedValue.String() -} - -func (setup *TestSetup) checkEthMintedBalanceForToken(params TestTokenParams) bool { - token := setup.GetTokenData(params.AbstractTokenIdentifier) - mintedTokens := setup.EthereumHandler.GetMintBalanceForToken(setup.Ctx, token.EthErc20Address) - - expectedValue := setup.computeExpectedValueFromMvx(params) - - if params.IsNativeOnMvX { - if params.InitialSupplyValue != "" { - if initialSupply, ok := new(big.Int).SetString(params.InitialSupplyValue, 10); ok { - expectedValue.Add(expectedValue, initialSupply) - } - } - } else { - expectedValue.Add(expectedValue, setup.getMvxTotalRefundAmountForToken(params)) // mint possible refund amount from failed SC call on Mvx - } - - return mintedTokens.String() == expectedValue.String() -} - -func (setup *TestSetup) getMvxTotalRefundAmountForToken(params TestTokenParams) *big.Int { - totalRefund := big.NewInt(0) - for _, operation := range params.TestOperations { - if !setup.hasCallData(operation) { - continue - } - if !operation.MvxFaultySCCall { - continue - } - - // the balance should be bridged back to the receiver on Ethereum - fee - totalRefund.Add(totalRefund, operation.ValueToTransferToMvx) - totalRefund.Sub(totalRefund, feeInt) - } - return totalRefund -} - // CreateBatchOnMultiversX will create deposits that will be gathered in a batch on MultiversX func (setup *TestSetup) CreateBatchOnMultiversX(tokensParams ...TestTokenParams) { for _, params := range tokensParams { @@ -683,6 +541,7 @@ func (setup *TestSetup) TestWithdrawTotalFeesOnEthereumForTokens(tokensParams .. func (setup *TestSetup) CheckCorrectnessOnMintBurnTokens(tokens ...TestTokenParams) { for _, params := range tokens { setup.checkTotalMintBurnOnMvx(params) + setup.checkMintBurnOnEth(params) setup.checkSafeContractMintBurnOnMvx(params) } } @@ -698,8 +557,8 @@ func (setup *TestSetup) checkTotalMintBurnOnMvx(token TestTokenParams) { tokenData := setup.TokensRegistry.GetTokenData(token.AbstractTokenIdentifier) esdtSupplyForUniversal := setup.MultiversxHandler.ChainSimulator.GetESDTSupplyValues(setup.Ctx, tokenData.MvxUniversalToken) - require.Equal(setup, token.MintBurnChecks.TotalUniversalMint.String(), esdtSupplyForUniversal.Minted, fmt.Sprintf("token: %s", tokenData.MvxUniversalToken)) - require.Equal(setup, token.MintBurnChecks.TotalUniversalBurn.String(), esdtSupplyForUniversal.Burned, fmt.Sprintf("token: %s", tokenData.MvxUniversalToken)) + require.Equal(setup, token.MintBurnChecks.MvxTotalUniversalMint.String(), esdtSupplyForUniversal.Minted, fmt.Sprintf("token: %s", tokenData.MvxUniversalToken)) + require.Equal(setup, token.MintBurnChecks.MvxTotalUniversalBurn.String(), esdtSupplyForUniversal.Burned, fmt.Sprintf("token: %s", tokenData.MvxUniversalToken)) if tokenData.MvxUniversalToken == tokenData.MvxChainSpecificToken { // we do not have a chain specific token, we can return true here @@ -707,18 +566,28 @@ func (setup *TestSetup) checkTotalMintBurnOnMvx(token TestTokenParams) { } esdtSupplyForChainSpecific := setup.MultiversxHandler.ChainSimulator.GetESDTSupplyValues(setup.Ctx, tokenData.MvxChainSpecificToken) - require.Equal(setup, token.MintBurnChecks.TotalChainSpecificMint.String(), esdtSupplyForChainSpecific.Minted, fmt.Sprintf("token: %s", tokenData.MvxChainSpecificToken)) - require.Equal(setup, token.MintBurnChecks.TotalChainSpecificBurn.String(), esdtSupplyForChainSpecific.Burned, fmt.Sprintf("token: %s", tokenData.MvxChainSpecificToken)) + require.Equal(setup, token.MintBurnChecks.MvxTotalChainSpecificMint.String(), esdtSupplyForChainSpecific.Minted, fmt.Sprintf("token: %s", tokenData.MvxChainSpecificToken)) + require.Equal(setup, token.MintBurnChecks.MvxTotalChainSpecificBurn.String(), esdtSupplyForChainSpecific.Burned, fmt.Sprintf("token: %s", tokenData.MvxChainSpecificToken)) +} + +func (setup *TestSetup) checkMintBurnOnEth(token TestTokenParams) { + tokenData := setup.GetTokenData(token.AbstractTokenIdentifier) + + minted := setup.EthereumHandler.GetMintBalanceForToken(setup.Ctx, tokenData.EthErc20Address) + require.Equal(setup, token.MintBurnChecks.EthSafeMintValue.String(), minted.String(), fmt.Sprintf("eth safe contract, token: %s", tokenData.EthErc20Address.String())) + + burned := setup.EthereumHandler.GetBurnBalanceForToken(setup.Ctx, tokenData.EthErc20Address) + require.Equal(setup, token.MintBurnChecks.EthSafeBurnValue.String(), burned.String(), fmt.Sprintf("eth safe contract, token: %s", tokenData.EthErc20Address.String())) } func (setup *TestSetup) checkSafeContractMintBurnOnMvx(token TestTokenParams) { tokenData := setup.TokensRegistry.GetTokenData(token.AbstractTokenIdentifier) minted := setup.MultiversxHandler.GetMintedAmountForToken(setup.Ctx, tokenData.MvxChainSpecificToken) - require.Equal(setup, token.MintBurnChecks.SafeMintValue.String(), minted.String(), fmt.Sprintf("safe contract, token: %s", tokenData.MvxChainSpecificToken)) + require.Equal(setup, token.MintBurnChecks.MvxSafeMintValue.String(), minted.String(), fmt.Sprintf("Mvx safe contract, token: %s", tokenData.MvxChainSpecificToken)) burn := setup.MultiversxHandler.GetBurnedAmountForToken(setup.Ctx, tokenData.MvxChainSpecificToken) - require.Equal(setup, token.MintBurnChecks.SafeBurnValue.String(), burn.String(), fmt.Sprintf("safe contract, token: %s", tokenData.MvxChainSpecificToken)) + require.Equal(setup, token.MintBurnChecks.MvxSafeBurnValue.String(), burn.String(), fmt.Sprintf("Mvx safe contract, token: %s", tokenData.MvxChainSpecificToken)) } func (setup *TestSetup) executeSpecialChecks(token TestTokenParams) { diff --git a/integrationTests/relayers/slowTests/framework/types.go b/integrationTests/relayers/slowTests/framework/types.go index 36c187cf..333925a4 100644 --- a/integrationTests/relayers/slowTests/framework/types.go +++ b/integrationTests/relayers/slowTests/framework/types.go @@ -84,12 +84,15 @@ type DeltaBalanceHolder struct { // MintBurnBalances holds the mint/burn tokens balances for a test token type MintBurnBalances struct { - TotalUniversalMint *big.Int - TotalChainSpecificMint *big.Int - TotalUniversalBurn *big.Int - TotalChainSpecificBurn *big.Int - SafeMintValue *big.Int - SafeBurnValue *big.Int + MvxTotalUniversalMint *big.Int + MvxTotalChainSpecificMint *big.Int + MvxTotalUniversalBurn *big.Int + MvxTotalChainSpecificBurn *big.Int + MvxSafeMintValue *big.Int + MvxSafeBurnValue *big.Int + + EthSafeMintValue *big.Int + EthSafeBurnValue *big.Int } // ESDTSupply represents the DTO that holds the supply values for a token