Skip to content

Commit

Permalink
rename init with onInit
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmanzanera committed Sep 4, 2024
1 parent 4d2f586 commit c1efd19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/archethic/contracts/wasm/instance.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Archethic.Contracts.WasmInstance do
alias Archethic.Contracts.Wasm.ReadResult
alias Archethic.Contracts.Wasm.UpdateResult

@reserved_functions ["spec", "init", "onUpgrade"]
@reserved_functions ["spec", "onInit", "onUpgrade"]

@spec start_link(bytes: binary(), transaction: nil | map()) :: GenServer.on_start()
def start_link(arg) do
Expand Down Expand Up @@ -62,7 +62,7 @@ defmodule Archethic.Contracts.WasmInstance do

defp init_state(instance_pid, io_mem_pid, exported_functions, opts) do
if "init" in exported_functions do
case WasmModule.execute(instance_pid, io_mem_pid, "init", opts) do
case WasmModule.execute(instance_pid, io_mem_pid, "onInit", opts) do
{:ok, %ReadResult{value: initialized_state}} ->
{:ok, initialized_state}

Expand Down

0 comments on commit c1efd19

Please sign in to comment.