Skip to content

Commit

Permalink
xdefi: remove create/info functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnerdhair committed Mar 23, 2022
1 parent 5ce70aa commit e7d256a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion integration/src/wallets/mocks/@xdefi/xdefi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const mockSignLongContractData = {
};

export async function createMockWallet(): Promise<core.HDWallet> {
const wallet = xdefi.create();
const wallet = new xdefi.XDeFiHDWallet();
// mock wallet provider
wallet.ethSignTx = jest
.fn()
Expand Down
2 changes: 1 addition & 1 deletion integration/src/wallets/xdefi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function createWallet(): Promise<core.HDWallet> {
}

export function createInfo(): core.HDWalletInfo {
return xdefi.info();
return new xdefi.XDeFiHDWalletInfo();
}

export function selfTest(get: () => core.HDWallet): void {
Expand Down
13 changes: 3 additions & 10 deletions packages/hdwallet-xdefi/src/xdefi.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import * as core from "@shapeshiftoss/hdwallet-core";
import { create, XDeFiHDWallet } from ".";

import * as xdefi from "./xdefi";
import { XDeFiHDWallet, XDeFiHDWalletInfo } from ".";

describe("XDeFIHDWalletInfo", () => {
const info = new XDeFiHDWalletInfo();

it("should have correct metadata", async () => {
const info = xdefi.info();
expect(info.getVendor()).toBe("XDeFi");
expect(info.hasOnDevicePinEntry()).toBe(false);
expect(info.hasOnDevicePassphrase()).toBe(false);
Expand All @@ -19,7 +18,6 @@ describe("XDeFIHDWalletInfo", () => {
expect(await info.supportsBroadcast()).toBe(true);
});
it("should produce correct path descriptions", () => {
const info = xdefi.info();
expect(info.hasNativeShapeShift()).toBe(false);
[
{
Expand Down Expand Up @@ -208,9 +206,4 @@ describe("XDeFiWHDWallet", () => {
})
).toEqual(true);
});

it("should create instance of XDeFiHD wallet", () => {
const wallet = create();
expect(wallet).toBeInstanceOf(XDeFiHDWallet);
});
});
8 changes: 0 additions & 8 deletions packages/hdwallet-xdefi/src/xdefi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,3 @@ export class XDeFiHDWalletInfo implements core.HDWalletInfo, core.ETHWalletInfo
return eth.ethGetAccountPaths(msg);
}
}

export function info() {
return new XDeFiHDWalletInfo();
}

export function create(): XDeFiHDWallet {
return new XDeFiHDWallet();
}

0 comments on commit e7d256a

Please sign in to comment.