4
0
Fork 0

fix formatting

pull/5/head
Deon 7 years ago
parent 5a18897947
commit 4aaf93d573
No known key found for this signature in database
GPG Key ID: 5292459838C9BC58
  1. 10
      lib/exw3.ex

@ -23,9 +23,9 @@ defmodule ExW3 do
Enum.join(["0x", bytes |> Base.encode16(case: :lower)], "")
end
@spec to_checksum_address(binary()) :: binary()
@doc "returns a checksummed address"
def to_checksum_address(address) do
@spec to_checksum_address(binary()) :: binary()
@doc "returns a checksummed address"
def to_checksum_address(address) do
address = String.replace(address, ~r/^0x/, "")
{:ok, hash} = Ethereumex.HttpClient.web3_sha3(String.downcase(address))
@ -45,8 +45,8 @@ defmodule ExW3 do
"0x" <> List.to_string(list_arr)
end
@doc "checks if the address is a valid checksummed address"
@spec is_valid_checksum_address(binary()) :: boolean()
@doc "checks if the address is a valid checksummed address"
@spec is_valid_checksum_address(binary()) :: boolean()
def is_valid_checksum_address(address) do
to_checksum_address(address) == address
end

Loading…
Cancel
Save