Skip to content

Commit

Permalink
Drops unused adapter key from Wallet.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesduncombe committed Feb 1, 2024
1 parent 6866889 commit a45a039
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 0 additions & 1 deletion lib/tt_eth/local_wallet.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ defmodule TTEth.LocalWallet do
address = pub |> Address.from_public_key!()

[
adapter: @for,
address: address,
public_key: pub,
human_address: address |> Address.to_human!(),
Expand Down
17 changes: 15 additions & 2 deletions lib/tt_eth/wallet.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,24 @@ defmodule TTEth.Wallet do
"""
alias TTEth.Protocols.Wallet, as: WalletProtocol
alias TTEth.Type.Signature, as: EthSignature
alias TTEth.Type.Address, as: EthAddress
alias TTEth.Type.PublicKey, as: EthPublicKey

@type t :: %__MODULE__{}
@typedoc """
Represents a Wallet.
The underlying adapter lives under `_adapter`.
"""
@type t :: %__MODULE__{
address: EthAddress.t(),
public_key: EthPublicKey.t(),
human_address: String.t(),
human_public_key: String.t(),
_adapter: struct()
}

@enforce_keys [:address, :public_key, :human_address, :human_public_key, :_adapter]
defstruct [
:adapter,
:address,
:public_key,
:human_address,
Expand Down
1 change: 0 additions & 1 deletion test/tt_eth/wallet_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ defmodule TTEth.WalletTest do

wallet
|> assert_match(%Wallet{
adapter: LocalWallet,
address: ^address,
public_key: ^public_key,
human_address: ^human_address,
Expand Down

0 comments on commit a45a039

Please sign in to comment.