changed hex_metadata.config
 
@@ -1,14 +1,14 @@
1
1
{<<"app">>,<<"eth">>}.
2
2
{<<"build_tools">>,[<<"mix">>]}.
3
3
{<<"description">>,<<"Ethereum utilities for Elixir.">>}.
4
- {<<"elixir">>,<<"~> 1.11">>}.
4
+ {<<"elixir">>,<<"~> 1.12">>}.
5
5
{<<"files">>,
6
- [<<"lib">>,<<"lib/eth.ex">>,<<"lib/eth">>,<<"lib/eth/query.ex">>,
7
- <<"lib/eth/transaction">>,<<"lib/eth/transaction/signer.ex">>,
6
+ [<<"lib">>,<<"lib/eth">>,<<"lib/eth/query.ex">>,<<"lib/eth/transaction">>,
8
7
<<"lib/eth/transaction/parser.ex">>,<<"lib/eth/transaction/builder.ex">>,
9
- <<"lib/eth/wallet.ex">>,<<"lib/eth/transaction_queries.ex">>,
10
- <<"lib/eth/utils.ex">>,<<"lib/eth/transaction.ex">>,<<"mix.exs">>,
11
- <<"README.md">>,<<"LICENSE.md">>]}.
8
+ <<"lib/eth/transaction/signer.ex">>,<<"lib/eth/wallet.ex">>,
9
+ <<"lib/eth/transaction_queries.ex">>,<<"lib/eth/transaction.ex">>,
10
+ <<"lib/eth/utils.ex">>,<<"lib/eth.ex">>,<<"mix.exs">>,<<"README.md">>,
11
+ <<"LICENSE.md">>]}.
12
12
{<<"licenses">>,[<<"MIT License">>]}.
13
13
{<<"links">>,
14
14
[{<<"Changelog">>,
 
@@ -21,7 +21,7 @@
21
21
{<<"name">>,<<"ethereumex">>},
22
22
{<<"optional">>,false},
23
23
{<<"repository">>,<<"hexpm">>},
24
- {<<"requirement">>,<<"~> 0.6.0">>}],
24
+ {<<"requirement">>,<<"~> 0.7.0">>}],
25
25
[{<<"app">>,<<"ex_rlp">>},
26
26
{<<"name">>,<<"ex_rlp">>},
27
27
{<<"optional">>,false},
 
@@ -36,25 +36,20 @@
36
36
{<<"name">>,<<"ex_keccak">>},
37
37
{<<"optional">>,false},
38
38
{<<"repository">>,<<"hexpm">>},
39
- {<<"requirement">>,<<"~> 0.1.2">>}],
39
+ {<<"requirement">>,<<"~> 0.2.0">>}],
40
40
[{<<"app">>,<<"mnemonic">>},
41
41
{<<"name">>,<<"mnemonic">>},
42
42
{<<"optional">>,false},
43
43
{<<"repository">>,<<"hexpm">>},
44
- {<<"requirement">>,<<"~> 0.2.2">>}],
44
+ {<<"requirement">>,<<"~> 0.3.0">>}],
45
45
[{<<"app">>,<<"poison">>},
46
46
{<<"name">>,<<"poison">>},
47
47
{<<"optional">>,false},
48
48
{<<"repository">>,<<"hexpm">>},
49
- {<<"requirement">>,<<"~> 4.0.1">>}],
49
+ {<<"requirement">>,<<"~> 5.0.0">>}],
50
50
[{<<"app">>,<<"ex_secp256k1">>},
51
51
{<<"name">>,<<"ex_secp256k1">>},
52
52
{<<"optional">>,false},
53
53
{<<"repository">>,<<"hexpm">>},
54
- {<<"requirement">>,<<"~> 0.1.2">>}],
55
- [{<<"app">>,<<"telemetry">>},
56
- {<<"name">>,<<"telemetry">>},
57
- {<<"optional">>,false},
58
- {<<"repository">>,<<"hexpm">>},
59
- {<<"requirement">>,<<"~> 0.4.2">>}]]}.
60
- {<<"version">>,<<"0.6.1">>}.
54
+ {<<"requirement">>,<<"~> 0.2.1">>}]]}.
55
+ {<<"version">>,<<"0.6.2">>}.
changed lib/eth.ex
 
@@ -97,7 +97,6 @@ defmodule ETH do
97
97
defdelegate get_address(private_or_public_key), to: ETH.Utils
98
98
defdelegate convert(value, denomination), to: ETH.Utils
99
99
defdelegate secp256k1_signature(hash, private_key), to: ETH.Utils
100
- defdelegate keccak256(data), to: ETH.Utils
101
100
defdelegate encode16(data), to: ETH.Utils
102
101
defdelegate decode16(decoded_data), to: ETH.Utils
103
102
defdelegate to_buffer(data), to: ETH.Utils
changed lib/eth/transaction/signer.ex
 
@@ -34,7 +34,7 @@ defmodule ETH.Transaction.Signer do
34
34
35
35
target_list
36
36
|> ExRLP.encode()
37
- |> keccak256
37
+ |> ExKeccak.hash_256
38
38
end
39
39
40
40
def hash_transaction(
changed lib/eth/utils.ex
 
@@ -14,25 +14,25 @@ defmodule ETH.Utils do
14
14
15
15
def get_address(<<private_key::binary-size(32)>>) do
16
16
<<4::size(8), key::binary-size(64)>> = private_key |> get_public_key()
17
- <<_::binary-size(12), eth_address::binary-size(20)>> = keccak256(key)
17
+ <<_::binary-size(12), eth_address::binary-size(20)>> = ExKeccak.hash_256(key)
18
18
"0x#{Base.encode16(eth_address)}"
19
19
end
20
20
21
21
def get_address(<<encoded_private_key::binary-size(64)>>) do
22
22
public_key = Base.decode16!(encoded_private_key, case: :mixed) |> get_public_key()
23
23
<<4::size(8), key::binary-size(64)>> = public_key
24
- <<_::binary-size(12), eth_address::binary-size(20)>> = keccak256(key)
24
+ <<_::binary-size(12), eth_address::binary-size(20)>> = ExKeccak.hash_256(key)
25
25
"0x#{Base.encode16(eth_address)}"
26
26
end
27
27
28
28
def get_address(<<4::size(8), key::binary-size(64)>>) do
29
- <<_::binary-size(12), eth_address::binary-size(20)>> = keccak256(key)
29
+ <<_::binary-size(12), eth_address::binary-size(20)>> = ExKeccak.hash_256(key)
30
30
"0x#{Base.encode16(eth_address)}"
31
31
end
32
32
33
33
def get_address(<<encoded_public_key::binary-size(130)>>) do
34
34
<<4::size(8), key::binary-size(64)>> = Base.decode16!(encoded_public_key, case: :mixed)
35
- <<_::binary-size(12), eth_address::binary-size(20)>> = keccak256(key)
35
+ <<_::binary-size(12), eth_address::binary-size(20)>> = ExKeccak.hash_256(key)
36
36
"0x#{Base.encode16(eth_address)}"
37
37
end
38
38
 
@@ -64,11 +64,6 @@ defmodule ETH.Utils do
64
64
[signature: signature, recovery: recovery]
65
65
end
66
66
67
- def keccak256(data) do
68
- {:ok, result} = ExKeccak.hash_256(data)
69
- result
70
- end
71
-
72
67
def encode16(value), do: Base.encode16(value, case: :lower)
73
68
def decode16(value), do: Base.decode16!(value, case: :mixed)
changed mix.exs
 
@@ -1,14 +1,14 @@
1
1
defmodule Eth.Mixfile do
2
2
use Mix.Project
3
3
4
- @version "0.6.1"
4
+ @version "0.6.2"
5
5
@source_url "https://github.com/izelnakri/eth"
6
6
7
7
def project() do
8
8
[
9
9
app: :eth,
10
10
version: @version,
11
- elixir: "~> 1.11",
11
+ elixir: "~> 1.12",
12
12
description: description(),
13
13
start_permanent: Mix.env() == :prod,
14
14
package: package(),
 
@@ -20,23 +20,22 @@ defmodule Eth.Mixfile do
20
20
# Run "mix help compile.app" to learn about applications.
21
21
def application() do
22
22
[
23
- extra_applications: [:logger, :telemetry, :ethereumex]
23
+ extra_applications: [:logger, :ethereumex]
24
24
]
25
25
end
26
26
27
27
# Run "mix help deps" to learn about dependencies.
28
28
defp deps() do
29
29
[
30
- {:ethereumex, "~> 0.6.0"},
30
+ {:ethereumex, "~> 0.7.0"},
31
31
{:ex_rlp, "~> 0.5.3"},
32
- {:ex_doc, ">= 0.23.0", only: :dev},
33
- {:dialyxir, "~> 1.0.0", only: [:dev], runtime: false},
32
+ {:ex_doc, ">= 0.25.2", only: :dev},
33
+ {:dialyxir, "~> 1.1.0", only: [:dev], runtime: false},
34
34
{:hexate, "~> 0.6.1"},
35
- {:ex_keccak, "~> 0.1.2"},
36
- {:mnemonic, "~> 0.2.2"},
37
- {:poison, "~> 4.0.1"},
38
- {:ex_secp256k1, "~> 0.1.2"},
39
- {:telemetry, "~> 0.4.2"}
35
+ {:ex_keccak, "~> 0.2.0"},
36
+ {:mnemonic, "~> 0.3.0"},
37
+ {:poison, "~> 5.0.0"},
38
+ {:ex_secp256k1, "~> 0.2.1"},
40
39
]
41
40
end