diff --git a/src/factory.ts b/src/factory.ts index 873a7cc..d12b9e9 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -2,7 +2,6 @@ import type { ethers } from "ethers" import type { Account } from "near-api-js" import { EthereumDeployer } from "./chains/ethereum" import { NearDeployer } from "./chains/near" -import type { ChainDeployer } from "./types" import { ChainKind } from "./types" /** @@ -19,7 +18,7 @@ import { ChainKind } from "./types" * const txHash = await deployer.initDeployToken("near:token.near"); * ``` */ -export function getDeployer(chain: ChainKind, wallet: TWallet): ChainDeployer { +export function getDeployer(chain: ChainKind, wallet: TWallet) { switch (chain) { case ChainKind.Near: return new NearDeployer(wallet as Account) diff --git a/tests/chains/near.test.ts b/tests/chains/near.test.ts index 9da6982..bdc3000 100644 --- a/tests/chains/near.test.ts +++ b/tests/chains/near.test.ts @@ -50,16 +50,16 @@ describe("NearDeployer", () => { }) }) - describe("initDeployToken", () => { + describe("logMetadata", () => { it("should throw error if token address is not on NEAR", async () => { - await expect(deployer.initDeployToken("eth:0x123")).rejects.toThrow( + await expect(deployer.logMetadata("eth:0x123")).rejects.toThrow( "Token address must be on NEAR", ) }) it("should call log_metadata with correct arguments", async () => { const tokenAddress = "near:test-token.near" - const txHash = await deployer.initDeployToken(tokenAddress) + const txHash = await deployer.logMetadata(tokenAddress) expect(mockWallet.functionCall).toHaveBeenCalledWith({ contractId: mockLockerAddress, @@ -74,12 +74,12 @@ describe("NearDeployer", () => { }) }) - describe("finDeployToken", () => { + describe("deployToken", () => { it("should call deploy_token with correct arguments", async () => { const destinationChain = ChainKind.Eth const mockVaa = "mock-vaa" - const txHash = await deployer.finDeployToken(destinationChain, mockVaa) + const txHash = await deployer.deployToken(destinationChain, mockVaa) expect(mockWallet.functionCall).toHaveBeenCalledWith({ contractId: mockLockerAddress, @@ -118,7 +118,7 @@ describe("NearDeployer", () => { const error = new Error("NEAR error") mockWallet.functionCall = vi.fn().mockRejectedValue(error) - await expect(deployer.initDeployToken("near:test-token.near")).rejects.toThrow("NEAR error") + await expect(deployer.logMetadata("near:test-token.near")).rejects.toThrow("NEAR error") }) }) })