Skip to content

Commit

Permalink
Fixed with new 'TODO' test 'TestInternalPaymentsValidationFailure'.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickeskov committed Aug 16, 2024
1 parent 743121d commit 880df36
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/ride/tree_evaluation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3972,9 +3972,17 @@ func TestInternalPaymentsValidationFailure(t *testing.T) {
// Switch on internal payments validation and reset wrapped state
env = env.withValidateInternalPayments().withWrappedState()
res, err = CallFunction(env.toEnv(), tree1, proto.NewFunctionCall("call", proto.Arguments{}))
// Expecting validation error for the switched on internal payments validation
// TODO: is it correct to expect no error here?
// The actions application and payments check order has been changed. This change affects the test result.
// No error is expected in this case, because asset is transferred back and payments check happens after
require.NoError(t, err)
require.IsType(t, DAppResult{}, res)

// Switch on payments fix and reset wrapped state
env = env.withPaymentsFix().withWrappedState()
res, err = CallFunction(env.toEnv(), tree1, proto.NewFunctionCall("call", proto.Arguments{}))
require.Nil(t, res)
require.Error(t, err)
require.EqualError(t, err, "invoke: failed to apply attached payments: not enough money in the DApp, balance of asset 2fCdmsn6maErwtLuzxoUrCBkh2vx5SvXtMKAJtN4YBgd on address 3PH75p2rmMKCV2nyW4TsAdFgFtmc61mJaqA after payments application is -50: negative balance after payments application") //nolint:lll
}

func TestAliasesInInvokes(t *testing.T) {
Expand Down

0 comments on commit 880df36

Please sign in to comment.