Skip to content

Commit

Permalink
[hotfix] Fix user import_wallet
Browse files Browse the repository at this point in the history
This fixes the user import_wallet to ensure that it uses the memoized
wallets_api helper.

This currently is returning an error when importing a wallet in
the following manner:

```ruby
user = Coinbase.default_user
cb_wallet = user.import_wallet(Coinbase::Wallet::Data.new(wallet.seed, wallet.wallet_id))
```
  • Loading branch information
alex-stone committed Apr 30, 2024
1 parent 7d9ff47 commit 027aa95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/coinbase/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def create_wallet
# @param data [Coinbase::Wallet::Data] the Wallet data to import
# @return [Coinbase::Wallet] the imported Wallet
def import_wallet(data)
model = @wallets_api.get_wallet(data.wallet_id)
model = wallets_api.get_wallet(data.wallet_id)
address_count = addresses_api.list_addresses(model.id).total_count
Wallet.new(model, seed: data.seed, address_count: address_count)
end
Expand Down

0 comments on commit 027aa95

Please sign in to comment.