diff --git a/pkg/ride/tree_evaluation_test.go b/pkg/ride/tree_evaluation_test.go index 9a51169e5..67dd261b2 100644 --- a/pkg/ride/tree_evaluation_test.go +++ b/pkg/ride/tree_evaluation_test.go @@ -5329,7 +5329,7 @@ func TestRegularAvailableBalanceSwitchOnV5ToV6(t *testing.T) { require.EqualError(t, err, "invoke: failed to apply attached payments: not enough money in the DApp, balance of asset WAVES on address 3MzDtgL5yw73C2xVLnLJCrT5gCL4357a4sz after payments application is -1000000000: negative balance after payments application") //nolint:lll } -func TestInvokePaymentsCheckBeforeAndAfterInvokeScriptTxActivation(t *testing.T) { +func TestInvokePaymentsCheckBeforeAndAfterInvoke(t *testing.T) { dApp1 := newTestAccount(t, "DAPP1") // 3MzDtgL5yw73C2xVLnLJCrT5gCL4357a4sz dApp2 := newTestAccount(t, "DAPP2") // 3N7Te7NXtGVoQqFqktwrFhQWAkc6J8vfPQ1 sender := newTestAccount(t, "SENDER") // 3N8CkZAyS4XcDoJTJoKNuNk2xmNKmQj7myW @@ -5370,17 +5370,29 @@ func TestInvokePaymentsCheckBeforeAndAfterInvokeScriptTxActivation(t *testing.T) withWrappedState() } - t.Run("BeforeInvokeScriptActivation", func(t *testing.T) { + t.Run("BeforeLightNodeActivationAndPaymentsFix", func(t *testing.T) { env := prepareEnv().withWrappedState() res, err := CallFunction(env.toEnv(), tree1, proto.NewFunctionCall("call", proto.Arguments{})) assert.Nil(t, res) assert.EqualError(t, err, "gotcha") }) - t.Run("AfterInvokeScriptActivation", func(t *testing.T) { + t.Run("AfterLightNodeActivation", func(t *testing.T) { env := prepareEnv().withLightNodeActivated() res, err := CallFunction(env.toEnv(), tree1, proto.NewFunctionCall("call", proto.Arguments{})) assert.Nil(t, res) - assert.EqualError(t, err, "invoke: failed to apply attached payments: not enough money in the DApp, balance of asset WAVES on address 3MzDtgL5yw73C2xVLnLJCrT5gCL4357a4sz after payments application is -4900000000") + assert.EqualError(t, err, "gotcha") + }) + t.Run("WithPaymentsFix", func(t *testing.T) { + env := prepareEnv().withPaymentsFix() + res, err := CallFunction(env.toEnv(), tree1, proto.NewFunctionCall("call", proto.Arguments{})) + assert.Nil(t, res) + assert.EqualError(t, err, "invoke: failed to apply attached payments: not enough money in the DApp, balance of asset WAVES on address 3MzDtgL5yw73C2xVLnLJCrT5gCL4357a4sz after payments application is -4900000000: negative balance after payments application") //nolint:lll + }) + t.Run("AfterLightNodeActivationWithPaymentsFix", func(t *testing.T) { + env := prepareEnv().withPaymentsFix().withPaymentsFix() + res, err := CallFunction(env.toEnv(), tree1, proto.NewFunctionCall("call", proto.Arguments{})) + assert.Nil(t, res) + assert.EqualError(t, err, "invoke: failed to apply attached payments: not enough money in the DApp, balance of asset WAVES on address 3MzDtgL5yw73C2xVLnLJCrT5gCL4357a4sz after payments application is -4900000000: negative balance after payments application") //nolint:lll }) }