Skip to content

Commit

Permalink
feat: add support for node 6.8.1 back (#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
sborrazas committed May 31, 2023
1 parent c303cce commit 4284e63
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ WORKDIR /home/aeternity/node

# Download, and unzip latest aeternity release archive
ENV NODEROOT=/home/aeternity/node/local
ARG NODE_VERSION=6.7.0
ARG NODE_VERSION=6.8.1
ARG NODE_URL=https://github.com/aeternity/aeternity/releases/download/v${NODE_VERSION}/aeternity-v${NODE_VERSION}-ubuntu-x86_64.tar.gz
ENV NODEDIR=/home/aeternity/node/local/rel/aeternity
RUN mkdir -p ./local/rel/aeternity/data/mnesia
Expand Down
2 changes: 1 addition & 1 deletion lib/ae_mdw/contract.ex
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ defmodule AeMdw.Contract do
{:ok, _, _, events} =
:aec_block_micro_candidate.apply_block_txs_strict(txs_taken, trees_in, env)

Enum.reverse(events)
events
else
[]
end
Expand Down
18 changes: 14 additions & 4 deletions lib/ae_mdw/db/sync/contract.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ defmodule AeMdw.Db.Sync.Contract do

@type call_record() :: tuple()

@contract_create_fnames ~w(Chain.create Chain.clone Call.create Call.clone)

@spec child_contract_mutations(
Contract.fun_arg_res_or_error(),
Blocks.block_index(),
Expand Down Expand Up @@ -55,6 +57,16 @@ defmodule AeMdw.Db.Sync.Contract do
Mutation.t()
]
def events_mutations(events, block_index, call_txi, call_tx_hash, contract_pk) do
events =
Enum.filter(
events,
&match?(
{{:internal_call_tx, fname}, %{info: aetx}}
when is_tuple(aetx) or fname in @contract_create_fnames,
&1
)
)

shifted_events = [nil | events]

# This function relies on a property that every Chain.clone and Chain.create
Expand All @@ -63,10 +75,8 @@ defmodule AeMdw.Db.Sync.Contract do
{chain_events, non_chain_events} =
shifted_events
|> Enum.zip(events)
|> Enum.split_with(fn
{_prev_event, {{:internal_call_tx, "Chain.create"}, _info}} -> true
{_prev_event, {{:internal_call_tx, "Chain.clone"}, _info}} -> true
{_prev_event, {{:internal_call_tx, _fname}, _info}} -> false
|> Enum.split_with(fn {_prev_event, {{:internal_call_tx, fname}, _info}} ->
fname in @contract_create_fnames
end)

chain_mutations =
Expand Down

0 comments on commit 4284e63

Please sign in to comment.