+
+
+
+
+
-
+
-
+
-
+
+
+
+
-
-
+
- Puts the value
for the given key
in the contract
.
+ Invoked when the server is started. start_link/3
or start/3
will
+block until it returns.
+args
is the argument term (second argument) passed to start_link/3
.
+Returning {:ok, state}
will cause start_link/3
to return
+{:ok, pid}
and the process to enter its loop.
+Returning {:ok, state, timeout}
is similar to {:ok, state}
+except handle_info(:timeout, state)
will be called after timeout
+milliseconds if no messages are received within the timeout.
+Returning {:ok, state, :hibernate}
is similar to
+{:ok, state}
except the process is hibernated before entering the loop. See
+c:handle_call/3
for more information on hibernation.
+Returning :ignore
will cause start_link/3
to return :ignore
and the
+process will exit normally without entering the loop or calling c:terminate/2
.
+If used when part of a supervision tree the parent supervisor will not fail
+to start nor immediately try to restart the GenServer
. The remainder of the
+supervision tree will be (re)started and so the GenServer
should not be
+required by other processes. It can be started later with
+Supervisor.restart_child/2
as the child specification is saved in the parent
+supervisor. The main use cases for this are:
+
+The GenServer
is disabled by configuration but might be enabled later.
+
+An error occurred and it will be handled by a different mechanism than the
+ Supervisor
. Likely this approach involves calling Supervisor.restart_child/2
+after a delay to attempt a restart.
+
+
+Returning {:stop, reason}
will cause start_link/3
to return
+{:error, reason}
and the process to exit with reason reason
without
+entering the loop or calling c:terminate/2
.
+Callback implementation for GenServer.init/1
.
+
+
+
+
+
+
+
+
+
+
+
+
@@ -314,9 +483,9 @@
Link to this function
-
tx_receipt(contract_agent, tx_hash)
+
tx_receipt(pid, tx_hash)
-
+
View Source
diff --git a/doc/ExW3.html b/doc/ExW3.html
index e3bb357..f490dfb 100644
--- a/doc/ExW3.html
+++ b/doc/ExW3.html
@@ -5,12 +5,12 @@
-
ExW3 – exw3 v0.0.2
+
ExW3 – exw3 v0.1.0
-
+
@@ -37,7 +37,7 @@
exw3
@@ -71,7 +71,7 @@
+
+
+
+
+
+
@@ -219,7 +249,7 @@
accounts()
-
+
View Source
@@ -241,7 +271,7 @@
balance(account)
-
+
View Source
@@ -263,7 +293,7 @@
block(block_number)
-
+
View Source
@@ -285,7 +315,7 @@
block_number()
-
+
View Source
@@ -307,7 +337,7 @@
bytes_to_string(bytes)
-
+
View Source
@@ -329,7 +359,7 @@
decode_event(data, signature)
-
+
View Source
@@ -351,7 +381,29 @@
decode_output(abi, name, output)
-
+
+
+ View Source
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -71,7 +71,7 @@
- exw3 v0.0.2
+ exw3 v0.1.0
API Reference
diff --git a/doc/dist/sidebar_items-8f71fb01e6.js b/doc/dist/sidebar_items-8f71fb01e6.js
deleted file mode 100644
index c4f48d8..0000000
--- a/doc/dist/sidebar_items-8f71fb01e6.js
+++ /dev/null
@@ -1 +0,0 @@
-sidebarNodes={"extras":[{"id":"api-reference","title":"API Reference","group":"","headers":[{"id":"Modules","anchor":"modules"}]}],"exceptions":[],"modules":[{"id":"ExW3","title":"ExW3","group":"","functions":[{"id":"accounts/0","anchor":"accounts/0"},{"id":"balance/1","anchor":"balance/1"},{"id":"block/1","anchor":"block/1"},{"id":"block_number/0","anchor":"block_number/0"},{"id":"bytes_to_string/1","anchor":"bytes_to_string/1"},{"id":"decode_event/2","anchor":"decode_event/2"},{"id":"decode_output/3","anchor":"decode_output/3"},{"id":"encode_event/1","anchor":"encode_event/1"},{"id":"encode_input/3","anchor":"encode_input/3"},{"id":"keys_to_decimal/2","anchor":"keys_to_decimal/2"},{"id":"load_abi/1","anchor":"load_abi/1"},{"id":"mine/1","anchor":"mine/1"},{"id":"reformat_abi/1","anchor":"reformat_abi/1"},{"id":"to_decimal/1","anchor":"to_decimal/1"},{"id":"tx_receipt/1","anchor":"tx_receipt/1"}]},{"id":"ExW3.Contract","title":"ExW3.Contract","group":"","functions":[{"id":"at/2","anchor":"at/2"},{"id":"child_spec/1","anchor":"child_spec/1"},{"id":"deploy/2","anchor":"deploy/2"},{"id":"get/2","anchor":"get/2"},{"id":"method/4","anchor":"method/4"},{"id":"put/3","anchor":"put/3"},{"id":"tx_receipt/2","anchor":"tx_receipt/2"}]}],"tasks":[]}
\ No newline at end of file
diff --git a/doc/dist/sidebar_items-fa0908e9e2.js b/doc/dist/sidebar_items-fa0908e9e2.js
new file mode 100644
index 0000000..9dbf043
--- /dev/null
+++ b/doc/dist/sidebar_items-fa0908e9e2.js
@@ -0,0 +1 @@
+sidebarNodes={"extras":[{"id":"api-reference","title":"API Reference","group":"","headers":[{"id":"Modules","anchor":"modules"}]}],"exceptions":[],"modules":[{"id":"ExW3","title":"ExW3","group":"","functions":[{"id":"accounts/0","anchor":"accounts/0"},{"id":"balance/1","anchor":"balance/1"},{"id":"block/1","anchor":"block/1"},{"id":"block_number/0","anchor":"block_number/0"},{"id":"bytes_to_string/1","anchor":"bytes_to_string/1"},{"id":"decode_event/2","anchor":"decode_event/2"},{"id":"decode_output/3","anchor":"decode_output/3"},{"id":"encode_data/2","anchor":"encode_data/2"},{"id":"encode_event/1","anchor":"encode_event/1"},{"id":"encode_input/3","anchor":"encode_input/3"},{"id":"encode_method_call/3","anchor":"encode_method_call/3"},{"id":"keys_to_decimal/2","anchor":"keys_to_decimal/2"},{"id":"load_abi/1","anchor":"load_abi/1"},{"id":"load_bin/1","anchor":"load_bin/1"},{"id":"method_signature/2","anchor":"method_signature/2"},{"id":"mine/1","anchor":"mine/1"},{"id":"reformat_abi/1","anchor":"reformat_abi/1"},{"id":"to_decimal/1","anchor":"to_decimal/1"},{"id":"tx_receipt/1","anchor":"tx_receipt/1"},{"id":"types_signature/2","anchor":"types_signature/2"}]},{"id":"ExW3.Contract","title":"ExW3.Contract","group":"","functions":[{"id":"address/1","anchor":"address/1"},{"id":"at/2","anchor":"at/2"},{"id":"call/3","anchor":"call/3"},{"id":"child_spec/1","anchor":"child_spec/1"},{"id":"deploy/2","anchor":"deploy/2"},{"id":"deploy_helper/3","anchor":"deploy_helper/3"},{"id":"eth_call_helper/4","anchor":"eth_call_helper/4"},{"id":"eth_send_helper/5","anchor":"eth_send_helper/5"},{"id":"init/1","anchor":"init/1"},{"id":"send/4","anchor":"send/4"},{"id":"start_link/2","anchor":"start_link/2"},{"id":"tx_receipt/2","anchor":"tx_receipt/2"}]}],"tasks":[]}
\ No newline at end of file
diff --git a/doc/index.html b/doc/index.html
index 7b8ce00..7e5314b 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -2,7 +2,7 @@
- exw3 v0.0.2 – Documentation
+ exw3 v0.1.0 – Documentation
diff --git a/doc/search.html b/doc/search.html
index 348b9bf..fc2905f 100644
--- a/doc/search.html
+++ b/doc/search.html
@@ -5,12 +5,12 @@
- Search – exw3 v0.0.2
+ Search – exw3 v0.1.0
-
+
@@ -37,7 +37,7 @@
exw3
diff --git a/lib/exw3.ex b/lib/exw3.ex
index d9b45a4..1954321 100644
--- a/lib/exw3.ex
+++ b/lib/exw3.ex
@@ -241,12 +241,17 @@ defmodule ExW3 do
constructor_arg_data =
if args[:args] do
- {_, constructor} = Enum.find abi, fn {_, v} ->
+ constructor_abi = Enum.find abi, fn {_, v} ->
v["type"] == "constructor"
- end
- input_types = Enum.map(constructor["inputs"], fn x -> x["type"] end)
- types_signature = Enum.join(["(", Enum.join(input_types, ","), ")"])
- bin <> (ExW3.encode_data(types_signature, args[:args]) |> Base.encode16(case: :lower))
+ end
+ if constructor_abi do
+ {_, constructor} = constructor_abi
+ input_types = Enum.map(constructor["inputs"], fn x -> x["type"] end)
+ types_signature = Enum.join(["(", Enum.join(input_types, ","), ")"])
+ bin <> (ExW3.encode_data(types_signature, args[:args]) |> Base.encode16(case: :lower))
+ else
+ bin
+ end
else
bin
end