Replace no_fees_transaction with no_fees_required
MODIFY
apps/omg/lib/omg/fees.ex
apps/omg/lib/omg/fees.ex
@@ -26,7 +26,7 @@ defmodule OMG.Fees do
use OMG.Utils.LoggerExt
@type fee_spec_t() :: %{token: Transaction.Payment.currency(), flat_fee: non_neg_integer}
- @type fee_t() :: %{Transaction.Payment.currency() => non_neg_integer} | :no_fees_transaction
+ @type fee_t() :: %{Transaction.Payment.currency() => non_neg_integer} | ::no_fees_required
@doc ~S"""
Checks whether the transaction's inputs cover the fees.
@@ -38,7 +38,7 @@ defmodule OMG.Fees do
"""
@spec covered?(implicit_paid_fee_by_currency :: map(), fees :: fee_t()) :: boolean()
- def covered?(_, :no_fees_transaction), do: true
+ def covered?(_, ::no_fees_required), do: true
def covered?(implicit_paid_fee_by_currency, fees) do
for {input_currency, implicit_paid_fee} <- implicit_paid_fee_by_currency do
@@ -64,7 +64,7 @@ defmodule OMG.Fees do
def for_transaction(transaction, fee_map) do
case MergeTransactionValidator.is_merge_transaction?(transaction) do
true ->
- :no_fees_transaction
+ ::no_fees_required
# TODO: reducing fees to output currencies only is incorrect, let's deffer until fees get large
false ->

MODIFY
apps/omg/test/omg/fees_test.exs
apps/omg/test/omg/fees_test.exs
@@ -34,8 +34,8 @@ defmodule OMG.FeesTest do
}
describe "covered?/2" do
- test "does not check the fees when :no_fees_transaction is passed" do
- assert Fees.covered?(%{@eth => 0}, :no_fees_transaction)
+ test "does not check the fees when ::no_fees_required is passed" do
+ assert Fees.covered?(%{@eth => 0}, ::no_fees_required)
end
test "returns true when fees are covered by another currency" do
@@ -77,14 +77,14 @@ defmodule OMG.FeesTest do
end
@tag fixtures: [:alice]
- test "returns :no_fees_transaction for merge transactions",
+ test "returns ::no_fees_required for merge transactions",
%{alice: alice} do
transaction = create_recovered([{1, 0, 0, alice}, {2, 0, 0, alice}], @eth, [{alice, 10}])
- assert Fees.for_transaction(transaction, @fees) == :no_fees_transaction
+ assert Fees.for_transaction(transaction, @fees) == ::no_fees_required
end
@tag fixtures: [:alice]
- test "returns :no_fees_transaction for valid merge transactions with multiple inputs/ouputs",
+ test "returns ::no_fees_required for valid merge transactions with multiple inputs/ouputs",
%{alice: alice} do
transaction =
create_recovered(
@@ -92,7 +92,7 @@ defmodule OMG.FeesTest do
[{alice, @eth, 10}, {alice, @eth, 10}]
)
- assert Fees.for_transaction(transaction, @fees) == :no_fees_transaction
+ assert Fees.for_transaction(transaction, @fees) == ::no_fees_required
end
end
end

MODIFY
apps/omg/test/omg/state/core_test.exs
apps/omg/test/omg/state/core_test.exs
@@ -43,9 +43,9 @@ defmodule OMG.State.CoreTest do
test "can spend deposits", %{alice: alice, bob: bob, state_empty: state} do
state
|> do_deposit(alice, %{amount: 10, currency: @eth, blknum: 1})
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), ::no_fees_required)
|> success?
- |> Core.exec(create_recovered([{@blknum1, 0, 1, alice}], @eth, [{bob, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 1, alice}], @eth, [{bob, 3}]), ::no_fees_required)
|> success?
end
@@ -55,22 +55,22 @@ defmodule OMG.State.CoreTest do
state1 =
state
|> do_deposit(alice, %{amount: 10, currency: @not_eth, blknum: 1})
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @not_eth, [{alice, 7}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @not_eth, [{alice, 7}, {alice, 3}]), ::no_fees_required)
|> success?
state1
- |> Core.exec(create_recovered([{1000, 0, 0, alice}], @eth, [{alice, 9}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1000, 0, 0, alice}], @eth, [{alice, 9}]), ::no_fees_required)
|> fail?(:amounts_do_not_add_up)
state1
|> Core.exec(
create_recovered([{1000, 0, 0, alice}], [{alice, @eth, 9}, {alice, @not_eth, 3}]),
- :no_fees_transaction
+ ::no_fees_required
)
|> fail?(:amounts_do_not_add_up)
state1
- |> Core.exec(create_recovered([{1000, 0, 0, alice}], [{alice, @not_eth, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1000, 0, 0, alice}], [{alice, @not_eth, 3}]), ::no_fees_required)
|> success?
end
@@ -81,10 +81,10 @@ defmodule OMG.State.CoreTest do
# outputs exceed inputs, no fee
state =
state
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 8}, {bob, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 8}, {bob, 3}]), ::no_fees_required)
|> fail?(:amounts_do_not_add_up)
|> same?(state)
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 2}, {alice, 8}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 2}, {alice, 8}]), ::no_fees_required)
|> success?
# outputs exceed inputs, with fee
@@ -96,13 +96,13 @@ defmodule OMG.State.CoreTest do
|> same?(state)
|> Core.exec(
create_recovered([{@blknum1, 0, 0, bob}, {@blknum1, 0, 1, alice}], @eth, [{alice, 9}, {bob, 2}]),
- :no_fees_transaction
+ ::no_fees_required
)
|> fail?(:amounts_do_not_add_up)
|> same?(state)
|> Core.exec(
create_recovered([{@blknum1, 0, 0, bob}, {@blknum1, 0, 1, alice}], @eth, [{alice, 7}, {bob, 2}]),
- :no_fees_transaction
+ ::no_fees_required
)
|> success?()
end
@@ -221,7 +221,7 @@ defmodule OMG.State.CoreTest do
|> do_deposit(alice, %{amount: 2, currency: @not_eth, blknum: 2})
|> Core.exec(
create_recovered([{1, 0, 0, alice}, {2, 0, 0, alice}], [{bob, @eth, 1}, {bob, @not_eth, 2}]),
- :no_fees_transaction
+ ::no_fees_required
)
|> success?
end
@@ -232,9 +232,9 @@ defmodule OMG.State.CoreTest do
state
|> do_deposit(alice, %{amount: 10, currency: @eth, blknum: 1})
|> do_deposit(bob, %{amount: 20, currency: @eth, blknum: 2})
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 10}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 10}]), ::no_fees_required)
|> success?
- |> Core.exec(create_recovered([{2, 0, 0, bob}], @eth, [{alice, 20}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{2, 0, 0, bob}], @eth, [{alice, 20}]), ::no_fees_required)
|> success?
end
@@ -244,7 +244,7 @@ defmodule OMG.State.CoreTest do
state
|> do_deposit(alice, %{amount: 10, currency: @eth, blknum: 1})
|> do_deposit(bob, %{amount: 20, currency: @eth, blknum: 2})
- |> Core.exec(create_recovered([{1, 0, 0, bob}, {2, 0, 0, alice}], @eth, [{bob, 10}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, bob}, {2, 0, 0, alice}], @eth, [{bob, 10}]), ::no_fees_required)
|> fail?(:unauthorized_spent)
end
@@ -271,7 +271,7 @@ defmodule OMG.State.CoreTest do
state_deposit = state |> do_deposit(alice, %{amount: 10, currency: @eth, blknum: 1})
state_deposit
- |> Core.exec(create_recovered([{1, 1, 0, alice}, {1, 0, 0, alice}], @eth, [{bob, 7}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 1, 0, alice}, {1, 0, 0, alice}], @eth, [{bob, 7}]), ::no_fees_required)
|> fail?(:utxo_not_found)
|> same?(state_deposit)
end
@@ -279,10 +279,10 @@ defmodule OMG.State.CoreTest do
@tag fixtures: [:alice, :bob, :state_alice_deposit]
test "can't spend other people's funds", %{alice: alice, bob: bob, state_alice_deposit: state} do
state
- |> Core.exec(create_recovered([{1, 0, 0, bob}], @eth, [{bob, 8}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, bob}], @eth, [{bob, 8}, {alice, 3}]), ::no_fees_required)
|> fail?(:unauthorized_spent)
|> same?(state)
- |> Core.exec(create_recovered([{1, 0, 0, bob}], @eth, [{alice, 10}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, bob}], @eth, [{alice, 10}]), ::no_fees_required)
|> fail?(:unauthorized_spent)
|> same?(state)
end
@@ -291,19 +291,19 @@ defmodule OMG.State.CoreTest do
test "all inputs must be authorized to be spent", %{alice: alice, bob: bob, state_alice_deposit: state} do
state =
state
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), ::no_fees_required)
|> success?()
state
- |> Core.exec(create_recovered([{@blknum1, 0, 0, bob}, {@blknum1, 0, 1, bob}], @eth, []), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 0, bob}, {@blknum1, 0, 1, bob}], @eth, []), ::no_fees_required)
|> fail?(:unauthorized_spent)
|> same?(state)
- |> Core.exec(create_recovered([{@blknum1, 0, 0, alice}, {@blknum1, 0, 1, alice}], @eth, []), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 0, alice}, {@blknum1, 0, 1, alice}], @eth, []), ::no_fees_required)
|> fail?(:unauthorized_spent)
|> same?(state)
state
- |> Core.exec(create_recovered([{@blknum1, 0, 0, bob}, {@blknum1, 0, 1, alice}], @eth, []), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 0, bob}, {@blknum1, 0, 1, alice}], @eth, []), ::no_fees_required)
|> success?()
end
@@ -317,9 +317,9 @@ defmodule OMG.State.CoreTest do
for first <- transactions,
second <- transactions do
state
- |> Core.exec(first, :no_fees_transaction)
+ |> Core.exec(first, ::no_fees_required)
|> success?
- |> Core.exec(second, :no_fees_transaction)
+ |> Core.exec(second, ::no_fees_required)
|> fail?(:utxo_not_found)
end
end
@@ -332,15 +332,15 @@ defmodule OMG.State.CoreTest do
state_alice_deposit: state
} do
state
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), ::no_fees_required)
|> success?
- |> Core.exec(create_recovered([{@blknum1, 0, 0, bob}], @eth, [{carol, 7}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 0, bob}], @eth, [{carol, 7}]), ::no_fees_required)
|> success?
- |> Core.exec(create_recovered([{@blknum1, 0, 1, alice}], @eth, [{carol, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 1, alice}], @eth, [{carol, 3}]), ::no_fees_required)
|> success?
|> Core.exec(
create_recovered([{@blknum1, 1, 0, carol}, {@blknum1, 2, 0, carol}], @eth, [{alice, 10}]),
- :no_fees_transaction
+ ::no_fees_required
)
|> success?
end
@@ -351,9 +351,9 @@ defmodule OMG.State.CoreTest do
{:ok, {_, _, _}, state} = form_block_check(state)
state
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), ::no_fees_required)
|> success?
- |> Core.exec(create_recovered([{next_block_height, 0, 0, bob}], @eth, [{bob, 7}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{next_block_height, 0, 0, bob}], @eth, [{bob, 7}]), ::no_fees_required)
|> success?
end
@@ -363,11 +363,11 @@ defmodule OMG.State.CoreTest do
{:ok, {_, _, _}, state} =
state
- |> Core.exec(recovered, :no_fees_transaction)
+ |> Core.exec(recovered, ::no_fees_required)
|> success?
|> form_block_check()
- Core.exec(state, recovered, :no_fees_transaction) |> fail?(:utxo_not_found) |> same?(state)
+ Core.exec(state, recovered, ::no_fees_required) |> fail?(:utxo_not_found) |> same?(state)
end
@tag fixtures: [:alice, :bob, :state_alice_deposit]
@@ -377,9 +377,9 @@ defmodule OMG.State.CoreTest do
assert {:ok, {%Block{hash: block_hash, number: block_number}, triggers, _}, _} =
state
- |> Core.exec(recover1, :no_fees_transaction)
+ |> Core.exec(recover1, ::no_fees_required)
|> success?
- |> Core.exec(recover2, :no_fees_transaction)
+ |> Core.exec(recover2, ::no_fees_required)
|> success?
|> form_block_check()
@@ -395,7 +395,7 @@ defmodule OMG.State.CoreTest do
assert state =
state
- |> Core.exec(recover1, :no_fees_transaction)
+ |> Core.exec(recover1, ::no_fees_required)
|> success?
assert {_, {_block, [%{submited_at_ethheight: 123}], _db_updates}, _} = Core.form_block(@interval, 123, state)
@@ -409,9 +409,9 @@ defmodule OMG.State.CoreTest do
} do
state =
state
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), ::no_fees_required)
|> success?
- |> Core.exec(create_recovered([{@blknum1, 0, 0, bob}], @eth, [{alice, 7}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 0, bob}], @eth, [{alice, 7}]), ::no_fees_required)
|> success?
assert {:ok, {_, [_trigger1, _trigger2], _}, _} = form_block_check(state)
@@ -424,7 +424,7 @@ defmodule OMG.State.CoreTest do
state_alice_deposit: state
} do
state
- |> Core.exec(create_recovered([{1, 1, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 1, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), ::no_fees_required)
|> same?(state)
assert {:ok, {_, [], _}, _} = form_block_check(state)
@@ -447,7 +447,7 @@ defmodule OMG.State.CoreTest do
} do
state =
state
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), ::no_fees_required)
|> success?
assert {:ok, {_, [_trigger], _}, state} = form_block_check(state)
@@ -469,11 +469,11 @@ defmodule OMG.State.CoreTest do
state =
state
- |> Core.exec(recovered_tx_1, :no_fees_transaction)
+ |> Core.exec(recovered_tx_1, ::no_fees_required)
|> success?
- |> Core.exec(recovered_tx_2, :no_fees_transaction)
+ |> Core.exec(recovered_tx_2, ::no_fees_required)
|> success?
- |> Core.exec(recovered_tx_3, :no_fees_transaction)
+ |> Core.exec(recovered_tx_3, ::no_fees_required)
|> success?
assert {:ok,
@@ -501,7 +501,7 @@ defmodule OMG.State.CoreTest do
} do
state =
state
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), ::no_fees_required)
|> success?
{:ok, {_, _, _}, state} = form_block_check(state)
@@ -527,7 +527,7 @@ defmodule OMG.State.CoreTest do
# persistence tested in-depth elsewhere
{:ok, {_, _, [_ | _]}, state} =
state
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{bob, 7}, {alice, 3}]), ::no_fees_required)
|> success?
|> form_block_check()
@@ -554,7 +554,7 @@ defmodule OMG.State.CoreTest do
state =
state
- |> Core.exec(tx, :no_fees_transaction)
+ |> Core.exec(tx, ::no_fees_required)
|> success?
utxo_pos_exits = [Utxo.position(@blknum1, 0, 0), Utxo.position(@blknum1, 0, 1)]
@@ -590,7 +590,7 @@ defmodule OMG.State.CoreTest do
state
|> Core.exec(
create_recovered([{1, 0, 0, alice}], @eth, [{alice, amount_1}, {alice, amount_2}]),
- :no_fees_transaction
+ ::no_fees_required
)
|> success?
@@ -602,10 +602,10 @@ defmodule OMG.State.CoreTest do
Core.exit_utxos(utxo_pos_exits, state)
state_after_exit
- |> Core.exec(create_recovered([{@blknum1, 0, 0, alice}], @eth, [{alice, 7}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 0, alice}], @eth, [{alice, 7}]), ::no_fees_required)
|> fail?(:utxo_not_found)
|> same?(state_after_exit)
- |> Core.exec(create_recovered([{@blknum1, 0, 1, alice}], @eth, [{alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 1, alice}], @eth, [{alice, 3}]), ::no_fees_required)
|> fail?(:utxo_not_found)
end
@@ -614,7 +614,7 @@ defmodule OMG.State.CoreTest do
# persistence tested in-depth elsewhere
tx = create_recovered([{1, 0, 0, alice}], @eth, [{alice, 7}, {alice, 3}])
- state = state |> Core.exec(tx, :no_fees_transaction) |> success?
+ state = state |> Core.exec(tx, ::no_fees_required) |> success?
utxo_pos_exits_in_flight = [%{call_data: %{in_flight_tx: Transaction.raw_txbytes(tx)}}]
utxo_pos_exits_piggyback = [%{tx_hash: Transaction.raw_txhash(tx), output_index: 4}]
@@ -626,10 +626,10 @@ defmodule OMG.State.CoreTest do
Core.exit_utxos(utxo_pos_exits_piggyback, state)
state_after_exit
- |> Core.exec(create_recovered([{@blknum1, 0, 0, alice}], @eth, [{alice, 7}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 0, alice}], @eth, [{alice, 7}]), ::no_fees_required)
|> fail?(:utxo_not_found)
|> same?(state_after_exit)
- |> Core.exec(create_recovered([{@blknum1, 0, 1, alice}], @eth, [{alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 1, alice}], @eth, [{alice, 3}]), ::no_fees_required)
|> success?
end
@@ -638,7 +638,7 @@ defmodule OMG.State.CoreTest do
# persistence tested in-depth elsewhere
state =
state
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 7}, {alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 7}, {alice, 3}]), ::no_fees_required)
|> success?
tx = create_recovered([{@blknum1, 0, 0, alice}], @eth, [{alice, 3}, {alice, 3}])
@@ -650,10 +650,10 @@ defmodule OMG.State.CoreTest do
Core.exit_utxos(utxo_pos_exits_in_flight, state)
state_after_exit
- |> Core.exec(create_recovered([{@blknum1, 0, 0, alice}], @eth, [{alice, 7}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 0, alice}], @eth, [{alice, 7}]), ::no_fees_required)
|> fail?(:utxo_not_found)
|> same?(state_after_exit)
- |> Core.exec(create_recovered([{@blknum1, 0, 1, alice}], @eth, [{alice, 3}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 0, 1, alice}], @eth, [{alice, 3}]), ::no_fees_required)
|> success?
end
@@ -680,7 +680,7 @@ defmodule OMG.State.CoreTest do
state =
state
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 10}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 10}]), ::no_fees_required)
|> success?
assert not Core.utxo_exists?(Utxo.position(1, 0, 0), state)
@@ -707,7 +707,7 @@ defmodule OMG.State.CoreTest do
{:ok, _, state} =
state
|> do_deposit(alice, %{amount: 10, currency: @eth, blknum: 1})
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 10}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 10}]), ::no_fees_required)
assert {@blknum1, false} = Core.get_status(state)
@@ -721,9 +721,9 @@ defmodule OMG.State.CoreTest do
test "Output can have a zero value; can't be used as input though", %{alice: alice, state_empty: state} do
state
|> do_deposit(alice, %{amount: 10, currency: @eth, blknum: 1})
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 8}, {alice, 0}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 8}, {alice, 0}]), ::no_fees_required)
|> success?
- |> Core.exec(create_recovered([{1000, 0, 1, alice}], @eth, [{alice, 0}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1000, 0, 1, alice}], @eth, [{alice, 0}]), ::no_fees_required)
|> fail?(:utxo_not_found)
end
@@ -731,9 +731,9 @@ defmodule OMG.State.CoreTest do
test "Output with zero value does not change oindex of other outputs", %{alice: alice, state_empty: state} do
state
|> do_deposit(alice, %{amount: 10, currency: @eth, blknum: 1})
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 0}, {alice, 8}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 0}, {alice, 8}]), ::no_fees_required)
|> success?
- |> Core.exec(create_recovered([{1000, 0, 1, alice}], @eth, [{alice, 1}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1000, 0, 1, alice}], @eth, [{alice, 1}]), ::no_fees_required)
|> success?
end
@@ -741,7 +741,7 @@ defmodule OMG.State.CoreTest do
test "Output with zero value will not be written to DB", %{alice: alice, state_alice_deposit: state} do
state =
state
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 0}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, [{alice, 0}]), ::no_fees_required)
|> success?
{:ok, {_, _, db_updates}, _} = form_block_check(state)
@@ -752,7 +752,7 @@ defmodule OMG.State.CoreTest do
test "Transaction can have no outputs", %{alice: alice, state_empty: state} do
state
|> do_deposit(alice, %{amount: 10, currency: @eth, blknum: 1})
- |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, []), :no_fees_transaction)
+ |> Core.exec(create_recovered([{1, 0, 0, alice}], @eth, []), ::no_fees_required)
|> success?
end
@@ -769,20 +769,20 @@ defmodule OMG.State.CoreTest do
state
|> Core.exec(
create_recovered([{future_deposit_blknum, 0, 0, alice}], @eth, [{bob, 6}, {alice, 4}]),
- :no_fees_transaction
+ ::no_fees_required
)
|> fail?(:input_utxo_ahead_of_state)
state
|> Core.exec(
create_recovered([{1, 0, 0, alice}, {future_deposit_blknum, 0, 0, alice}], @eth, [{bob, 6}, {alice, 4}]),
- :no_fees_transaction
+ ::no_fees_required
)
|> fail?(:input_utxo_ahead_of_state)
# when non-existent input comes with a blknum of the current block fail with :utxo_not_found
state
- |> Core.exec(create_recovered([{@blknum1, 1, 0, alice}], @eth, [{bob, 6}, {alice, 4}]), :no_fees_transaction)
+ |> Core.exec(create_recovered([{@blknum1, 1, 0, alice}], @eth, [{bob, 6}, {alice, 4}]), ::no_fees_required)
|> fail?(:utxo_not_found)
end

MODIFY
apps/omg/test/omg/state/persistence_test.exs
apps/omg/test/omg/state/persistence_test.exs
@@ -173,7 +173,7 @@ defmodule OMG.State.PersistenceTest do
end
defp exec(state, tx) do
- assert {:ok, _, state} = Core.exec(state, tx, :no_fees_transaction)
+ assert {:ok, _, state} = Core.exec(state, tx, ::no_fees_required)
state
end

MODIFY
apps/omg/test/omg/state/transaction_test.exs
apps/omg/test/omg/state/transaction_test.exs
@@ -410,7 +410,7 @@ defmodule OMG.State.TransactionTest do
defp assert_tx_usable(signed, state_core) do
{:ok, transaction} = signed |> Transaction.Signed.encode() |> Transaction.Recovered.recover_from()
- assert {:ok, {_, _, _}, _state} = State.Core.exec(state_core, transaction, :no_fees_transaction)
+ assert {:ok, {_, _, _}, _state} = State.Core.exec(state_core, transaction, ::no_fees_required)
end
defp parametrized_tester({inputs, outputs}) do

MODIFY
apps/omg/test/omg/state_test.exs
apps/omg/test/omg/state_test.exs
@@ -55,7 +55,7 @@ defmodule OMG.StateTest do
assert true == State.utxo_exists?(Utxo.position(1, 0, 0))
assert {:ok, _} =
- State.exec(TestHelper.create_recovered([{1, 0, 0, alice}], @eth, [{alice, 3}]), :no_fees_transaction)
+ State.exec(TestHelper.create_recovered([{1, 0, 0, alice}], @eth, [{alice, 3}]), ::no_fees_required)
# block forming & status
assert {blknum, _} = State.get_status()

MODIFY
apps/omg_child_chain/lib/omg_child_chain/fee_server.ex
apps/omg_child_chain/lib/omg_child_chain/fee_server.ex
@@ -40,7 +40,7 @@ defmodule OMG.ChildChain.FeeServer do
args =
case Application.get_env(:omg_child_chain, :ignore_fees) do
true ->
- :ok = save_fees(:no_fees_transaction, 0)
+ :ok = save_fees(::no_fees_required, 0)
_ = Logger.warn("Fee specs from file are ignored.")
args

MODIFY
apps/omg_child_chain/test/omg_child_chain/integration/fee_server_test.exs
apps/omg_child_chain/test/omg_child_chain/integration/fee_server_test.exs
@@ -108,11 +108,11 @@ defmodule OMG.ChildChain.Integration.FeeServerTest do
end
test "fee server ignores file updates" do
- assert {:ok, :no_fees_transaction} == FeeServer.transaction_fees()
+ assert {:ok, ::no_fees_required} == FeeServer.transaction_fees()
assert refresh_fees() =~ "Updates takes no effect"
- assert {:ok, :no_fees_transaction} == FeeServer.transaction_fees()
+ assert {:ok, ::no_fees_required} == FeeServer.transaction_fees()
assert server_alive?()
end
end

MODIFY
apps/omg_watcher/lib/omg_watcher/block_getter.ex
apps/omg_watcher/lib/omg_watcher/block_getter.ex
@@ -108,7 +108,7 @@ defmodule OMG.Watcher.BlockGetter do
end
def handle_continue({:apply_block_step, :execute_transactions, block_application}, state) do
- tx_exec_results = for(tx <- block_application.transactions, do: OMG.State.exec(tx, :no_fees_transaction))
+ tx_exec_results = for(tx <- block_application.transactions, do: OMG.State.exec(tx, ::no_fees_required))
case Core.validate_executions(tx_exec_results, block_application, state) do
{:ok, state} ->

MODIFY
apps/omg_watcher/test/omg_watcher/block_getter/core_test.exs
apps/omg_watcher/test/omg_watcher/block_getter/core_test.exs
@@ -116,7 +116,7 @@ defmodule OMG.Watcher.BlockGetter.CoreTest do
_} = Core.get_blocks_to_apply(state, [%{blknum: block.number, eth_height: synced_height}], synced_height)
# check feasibility of transactions from block to consume at the OMG.State
- assert {:ok, tx_result, _} = OMG.State.Core.exec(state_alice_deposit, tx, :no_fees_transaction)
+ assert {:ok, tx_result, _} = OMG.State.Core.exec(state_alice_deposit, tx, ::no_fees_required)
assert {:ok, ^state} = Core.validate_executions([{:ok, tx_result}], block, state)

Replace no_fees_transaction with no_fees_required