Skip to content

Commit

Permalink
Updating test descriptions and mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
erdimaden committed May 24, 2024
1 parent 3a02b29 commit d15e20e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/coinbase/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export class Address {
throw new InternalError("Cannot transfer from address without private key loaded");
}
let normalizedAmount = new Decimal(amount.toString());

const currentBalance = await this.getBalance(assetId);
if (currentBalance.lessThan(normalizedAmount)) {
throw new ArgumentError(
Expand Down
4 changes: 3 additions & 1 deletion src/coinbase/tests/address_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ describe("Address", () => {
next_page: "",
total_count: 0,
} as TransferList;
Coinbase.apiClients.transfer!.listTransfers = mockFn(() => {
Coinbase.apiClients.transfer!.listTransfers = mockFn((walletId, addressId) => {
VALID_TRANSFER_MODEL.wallet_id = walletId;
VALID_TRANSFER_MODEL.address_id = addressId;
response.next_page = pages.shift() as string;
response.data = [VALID_TRANSFER_MODEL];
response.has_more = !!response.next_page;
Expand Down

0 comments on commit d15e20e

Please sign in to comment.