4
0
Fork 0

Added case where args keyword but empty list, and also case where empty list and constructor exists for deploy

pull/5/head
hswick 7 years ago
parent 47fbbb6104
commit db705033d8
  1. 2
      doc/.build
  2. 6
      doc/404.html
  3. 239
      doc/ExW3.Contract.html
  4. 178
      doc/ExW3.html
  5. 8
      doc/api-reference.html
  6. 1
      doc/dist/sidebar_items-8f71fb01e6.js
  7. 1
      doc/dist/sidebar_items-fa0908e9e2.js
  8. 2
      doc/index.html
  9. 6
      doc/search.html
  10. 15
      lib/exw3.ex

@ -4,7 +4,7 @@ fonts/icomoon.eot
fonts/icomoon.svg
fonts/icomoon.ttf
fonts/icomoon.woff
dist/sidebar_items-8f71fb01e6.js
dist/sidebar_items-fa0908e9e2.js
api-reference.html
search.html
404.html

@ -5,12 +5,12 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.18.3">
<title>404 – exw3 v0.0.2</title>
<title>404 – exw3 v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<link rel="canonical" href="https://hexdocs.pm/exw3/404.html" />
<script src="dist/sidebar_items-8f71fb01e6.js"></script>
<script src="dist/sidebar_items-fa0908e9e2.js"></script>
@ -37,7 +37,7 @@
exw3
</h1>
<h2 class="sidebar-projectVersion">
v0.0.2
v0.1.0
</h2>
</div>

@ -5,12 +5,12 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.18.3">
<title>ExW3.Contract – exw3 v0.0.2</title>
<title>ExW3.Contract – exw3 v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<link rel="canonical" href="https://hexdocs.pm/exw3/ExW3.Contract.html" />
<script src="dist/sidebar_items-8f71fb01e6.js"></script>
<script src="dist/sidebar_items-fa0908e9e2.js"></script>
@ -37,7 +37,7 @@
exw3
</h1>
<h2 class="sidebar-projectVersion">
v0.0.2
v0.1.0
</h2>
</div>
@ -71,10 +71,10 @@
<h1>
<small class="visible-xs">exw3 v0.0.2</small>
<small class="visible-xs">exw3 v0.1.0</small>
ExW3.Contract
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L135" title="View Source" class="view-source" rel="help">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L179" title="View Source" class="view-source" rel="help">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -101,7 +101,19 @@
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#at/2">at(abi, address)</a>
<a href="#address/1">address(pid)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#at/2">at(pid, address)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#call/3">call(pid, method_name, args \\ [])</a>
</div>
</div>
@ -116,34 +128,53 @@
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#deploy/2">deploy(bin_filename, options)</a>
<a href="#deploy/2">deploy(pid, args)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#deploy_helper/3">deploy_helper(bin, abi, args)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#get/2">get(contract, key)</a>
<a href="#eth_call_helper/4">eth_call_helper(address, abi, method_name, args)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#method/4">method(contract_agent, method_name, args \\ [], options \\ %{})</a>
<a href="#eth_send_helper/5">eth_send_helper(address, abi, method_name, args, options)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#put/3">put(contract, key, value)</a>
<a href="#init/1">init(state)</a>
</div>
<div class="summary-synopsis"><p>Puts the <code class="inline">value</code> for the given <code class="inline">key</code> in the <code class="inline">contract</code></p>
<div class="summary-synopsis"><p>Invoked when the server is started. <code class="inline">start_link/3</code> or <code class="inline">start/3</code> will
block until it returns</p>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#tx_receipt/2">tx_receipt(contract_agent, tx_hash)</a>
<a href="#send/4">send(pid, method_name, args, options)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#start_link/2">start_link(name, state)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#tx_receipt/2">tx_receipt(pid, tx_hash)</a>
</div>
</div>
@ -167,7 +198,29 @@
</a>
Functions
</h1>
<div class="detail" id="at/2">
<div class="detail" id="address/1">
<div class="detail-header">
<a href="#address/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">address(pid)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L196" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</div>
<div class="detail" id="at/2">
<div class="detail-header">
@ -175,9 +228,33 @@
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">at(abi, address)</span>
<span class="signature">at(pid, address)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L192" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</div>
<div class="detail" id="call/3">
<span id="call/2"></span>
<div class="detail-header">
<a href="#call/3" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">call(pid, method_name, args \\ [])</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L138" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L200" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -199,7 +276,7 @@
</a>
<span class="signature">child_spec(arg)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L136" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L180" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -221,9 +298,9 @@
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">deploy(bin_filename, options)</span>
<span class="signature">deploy(pid, args)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L170" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L188" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -235,17 +312,17 @@
</section>
</div>
<div class="detail" id="get/2">
<div class="detail" id="deploy_helper/3">
<div class="detail-header">
<a href="#get/2" class="detail-link" title="Link to this function">
<a href="#deploy_helper/3" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">get(contract, key)</span>
<span class="signature">deploy_helper(bin, abi, args)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L159" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L240" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -257,21 +334,39 @@
</section>
</div>
<div class="detail" id="method/4">
<div class="detail" id="eth_call_helper/4">
<span id="method/2"></span>
<div class="detail-header">
<a href="#eth_call_helper/4" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">eth_call_helper(address, abi, method_name, args)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L267" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</div>
<div class="detail" id="eth_send_helper/5">
<span id="method/3"></span>
<div class="detail-header">
<a href="#method/4" class="detail-link" title="Link to this function">
<a href="#eth_send_helper/5" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">method(contract_agent, method_name, args \\ [], options \\ %{})</span>
<span class="signature">eth_send_helper(address, abi, method_name, args, options)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L186" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L279" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -283,17 +378,17 @@
</section>
</div>
<div class="detail" id="put/3">
<div class="detail" id="init/1">
<div class="detail-header">
<a href="#put/3" class="detail-link" title="Link to this function">
<a href="#init/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">put(contract, key, value)</span>
<span class="signature">init(state)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L166" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L214" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -302,10 +397,84 @@
</div>
<section class="docstring">
<p>Puts the <code class="inline">value</code> for the given <code class="inline">key</code> in the <code class="inline">contract</code>.</p>
<p>Invoked when the server is started. <code class="inline">start_link/3</code> or <code class="inline">start/3</code> will
block until it returns.</p>
<p><code class="inline">args</code> is the argument term (second argument) passed to <code class="inline">start_link/3</code>.</p>
<p>Returning <code class="inline">{:ok, state}</code> will cause <code class="inline">start_link/3</code> to return
<code class="inline">{:ok, pid}</code> and the process to enter its loop.</p>
<p>Returning <code class="inline">{:ok, state, timeout}</code> is similar to <code class="inline">{:ok, state}</code>
except <code class="inline">handle_info(:timeout, state)</code> will be called after <code class="inline">timeout</code>
milliseconds if no messages are received within the timeout.</p>
<p>Returning <code class="inline">{:ok, state, :hibernate}</code> is similar to
<code class="inline">{:ok, state}</code> except the process is hibernated before entering the loop. See
<code class="inline">c:handle_call/3</code> for more information on hibernation.</p>
<p>Returning <code class="inline">:ignore</code> will cause <code class="inline">start_link/3</code> to return <code class="inline">:ignore</code> and the
process will exit normally without entering the loop or calling <code class="inline">c:terminate/2</code>.
If used when part of a supervision tree the parent supervisor will not fail
to start nor immediately try to restart the <a href="https://hexdocs.pm/elixir/GenServer.html"><code class="inline">GenServer</code></a>. The remainder of the
supervision tree will be (re)started and so the <a href="https://hexdocs.pm/elixir/GenServer.html"><code class="inline">GenServer</code></a> should not be
required by other processes. It can be started later with
<a href="https://hexdocs.pm/elixir/Supervisor.html#restart_child/2"><code class="inline">Supervisor.restart_child/2</code></a> as the child specification is saved in the parent
supervisor. The main use cases for this are:</p>
<ul>
<li>The <a href="https://hexdocs.pm/elixir/GenServer.html"><code class="inline">GenServer</code></a> is disabled by configuration but might be enabled later.
</li>
<li>An error occurred and it will be handled by a different mechanism than the
<a href="https://hexdocs.pm/elixir/Supervisor.html"><code class="inline">Supervisor</code></a>. Likely this approach involves calling <a href="https://hexdocs.pm/elixir/Supervisor.html#restart_child/2"><code class="inline">Supervisor.restart_child/2</code></a>
after a delay to attempt a restart.
</li>
</ul>
<p>Returning <code class="inline">{:stop, reason}</code> will cause <code class="inline">start_link/3</code> to return
<code class="inline">{:error, reason}</code> and the process to exit with reason <code class="inline">reason</code> without
entering the loop or calling <code class="inline">c:terminate/2</code>.</p>
<p>Callback implementation for <a href="https://hexdocs.pm/elixir/GenServer.html#c:init/1"><code class="inline">GenServer.init/1</code></a>.</p>
</section>
</div>
<div class="detail" id="send/4">
<div class="detail-header">
<a href="#send/4" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">send(pid, method_name, args, options)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L204" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</div>
<div class="detail" id="start_link/2">
<div class="detail-header">
<a href="#start_link/2" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">start_link(name, state)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L184" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</div>
<div class="detail" id="tx_receipt/2">
@ -314,9 +483,9 @@
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">tx_receipt(contract_agent, tx_hash)</span>
<span class="signature">tx_receipt(pid, tx_hash)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L216" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L208" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>

@ -5,12 +5,12 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.18.3">
<title>ExW3 – exw3 v0.0.2</title>
<title>ExW3 – exw3 v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<link rel="canonical" href="https://hexdocs.pm/exw3/ExW3.html" />
<script src="dist/sidebar_items-8f71fb01e6.js"></script>
<script src="dist/sidebar_items-fa0908e9e2.js"></script>
@ -37,7 +37,7 @@
exw3
</h1>
<h2 class="sidebar-projectVersion">
v0.0.2
v0.1.0
</h2>
</div>
@ -71,7 +71,7 @@
<h1>
<small class="visible-xs">exw3 v0.0.2</small>
<small class="visible-xs">exw3 v0.1.0</small>
ExW3
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L1" title="View Source" class="view-source" rel="help">
@ -140,6 +140,12 @@
<a href="#decode_output/3">decode_output(abi, name, output)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#encode_data/2">encode_data(types_signature, data)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
@ -152,6 +158,12 @@
<a href="#encode_input/3">encode_input(abi, name, input)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#encode_method_call/3">encode_method_call(abi, name, input)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
@ -164,6 +176,18 @@
<a href="#load_abi/1">load_abi(file_path)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#load_bin/1">load_bin(file_path)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#method_signature/2">method_signature(abi, name)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
@ -188,6 +212,12 @@
<a href="#tx_receipt/1">tx_receipt(tx_hash)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#types_signature/2">types_signature(abi, name)</a>
</div>
</div>
</div>
@ -219,7 +249,7 @@
</a>
<span class="signature">accounts()</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L55" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L10" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -241,7 +271,7 @@
</a>
<span class="signature">balance(account)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L79" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L34" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -263,7 +293,7 @@
</a>
<span class="signature">block(block_number)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L107" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L62" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -285,7 +315,7 @@
</a>
<span class="signature">block_number()</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L69" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L24" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -307,7 +337,7 @@
</a>
<span class="signature">bytes_to_string(bytes)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L48" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L3" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -329,7 +359,7 @@
</a>
<span class="signature">decode_event(data, signature)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L124" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L79" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -351,7 +381,29 @@
</a>
<span class="signature">decode_output(abi, name, output)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L15" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L112" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</div>
<div class="detail" id="encode_data/2">
<div class="detail-header">
<a href="#encode_data/2" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">encode_data(types_signature, data)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L145" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -373,7 +425,7 @@
</a>
<span class="signature">encode_event(signature)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L120" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L75" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -395,7 +447,29 @@
</a>
<span class="signature">encode_input(abi, name, input)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L26" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L157" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</div>
<div class="detail" id="encode_method_call/3">
<div class="detail-header">
<a href="#encode_method_call/3" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">encode_method_call(abi, name, input)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L152" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -417,7 +491,7 @@
</a>
<span class="signature">keys_to_decimal(map, keys)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L89" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L44" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -439,7 +513,51 @@
</a>
<span class="signature">load_abi(file_path)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L6" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L94" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</div>
<div class="detail" id="load_bin/1">
<div class="detail-header">
<a href="#load_bin/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">load_bin(file_path)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L103" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</div>
<div class="detail" id="method_signature/2">
<div class="detail-header">
<a href="#method_signature/2" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">method_signature(abi, name)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L133" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -463,7 +581,7 @@
</a>
<span class="signature">mine(num_blocks \\ 1)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L114" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L69" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -485,7 +603,7 @@
</a>
<span class="signature">reformat_abi(abi)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L2" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L90" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -507,7 +625,7 @@
</a>
<span class="signature">to_decimal(hex_string)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L63" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L18" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
@ -529,7 +647,29 @@
</a>
<span class="signature">tx_receipt(tx_hash)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L97" class="view-source" rel="help" title="View Source">
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L52" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</div>
<div class="detail" id="types_signature/2">
<div class="detail-header">
<a href="#types_signature/2" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<span class="signature">types_signature(abi, name)</span>
<a href="https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L127" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>

@ -5,12 +5,12 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.18.3">
<title>API Reference – exw3 v0.0.2</title>
<title>API Reference – exw3 v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<link rel="canonical" href="https://hexdocs.pm/exw3/api-reference.html" />
<script src="dist/sidebar_items-8f71fb01e6.js"></script>
<script src="dist/sidebar_items-fa0908e9e2.js"></script>
@ -37,7 +37,7 @@
exw3
</h1>
<h2 class="sidebar-projectVersion">
v0.0.2
v0.1.0
</h2>
</div>
@ -71,7 +71,7 @@
<h1>
<small class="visible-xs">exw3 v0.0.2</small>
<small class="visible-xs">exw3 v0.1.0</small>
API Reference
</h1>

@ -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":[]}

@ -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":[]}

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>exw3 v0.0.2 – Documentation</title>
<title>exw3 v0.1.0 – Documentation</title>
<meta http-equiv="refresh" content="0; url=api-reference.html">
<meta name="robots" content="noindex">
<meta name="generator" content="ExDoc v0.18.3">

@ -5,12 +5,12 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.18.3">
<title>Search – exw3 v0.0.2</title>
<title>Search – exw3 v0.1.0</title>
<link rel="stylesheet" href="dist/app-480ffdc169.css" />
<link rel="canonical" href="https://hexdocs.pm/exw3/search.html" />
<script src="dist/sidebar_items-8f71fb01e6.js"></script>
<script src="dist/sidebar_items-fa0908e9e2.js"></script>
@ -37,7 +37,7 @@
exw3
</h1>
<h2 class="sidebar-projectVersion">
v0.0.2
v0.1.0
</h2>
</div>

@ -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

Loading…
Cancel
Save