Skip to content

Commit

Permalink
updating test description and method name
Browse files Browse the repository at this point in the history
  • Loading branch information
erdimaden committed May 23, 2024
1 parent 6a6b9c9 commit 459d97e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/coinbase/tests/wallet_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe("Wallet Class", () => {
});
});

describe(".export", () => {
describe("#export", () => {
let walletId: string;
let addressModel: AddressModel;
let walletModel: WalletModel;
Expand Down Expand Up @@ -185,7 +185,7 @@ describe("Wallet Class", () => {
});
});

describe(".defaultAddress", () => {
describe("#defaultAddress", () => {
let wallet, walletId;
beforeEach(async () => {
jest.clearAllMocks();
Expand Down Expand Up @@ -224,7 +224,7 @@ describe("Wallet Class", () => {
});
});

describe(".listBalances", () => {
describe("#getBalances", () => {
beforeEach(() => {
const mockBalanceResponse: AddressBalanceList = {
data: [
Expand Down Expand Up @@ -253,15 +253,15 @@ describe("Wallet Class", () => {
});

it("should return a hash with an ETH and USDC balance", async () => {
const balanceMap = await wallet.listBalances();
const balanceMap = await wallet.getBalances();
expect(balanceMap.get("eth")).toEqual(new Decimal(1));
expect(balanceMap.get("usdc")).toEqual(new Decimal(5));
expect(Coinbase.apiClients.wallet!.listWalletBalances).toHaveBeenCalledTimes(1);
expect(Coinbase.apiClients.wallet!.listWalletBalances).toHaveBeenCalledWith(walletId);
});
});

describe(".getBalance", () => {
describe("#getBalance", () => {
beforeEach(() => {
const mockWalletBalance: BalanceModel = {
amount: "5000000000000000000",
Expand Down Expand Up @@ -316,7 +316,7 @@ describe("Wallet Class", () => {
});
});

describe(".canSign", () => {
describe("#canSign", () => {
let wallet;
beforeAll(async () => {
const mockAddressModel = newAddressModel(walletId);
Expand Down
2 changes: 1 addition & 1 deletion src/coinbase/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class Wallet {
*
* @returns The list of balances. The key is the Asset ID, and the value is the balance.
*/
public async listBalances(): Promise<BalanceMap> {
public async getBalances(): Promise<BalanceMap> {
const response = await Coinbase.apiClients.wallet!.listWalletBalances(this.model.id!);
return BalanceMap.fromBalances(response.data.data);
}
Expand Down

0 comments on commit 459d97e

Please sign in to comment.