From fd1e5398fcd346d18570b4bd111a74cd83931681 Mon Sep 17 00:00:00 2001 From: Nayyir Jutha Date: Mon, 22 Jul 2024 15:44:24 -0400 Subject: [PATCH 1/2] [NayNay] Fixing register tests - mistakingly tested the wrong register method - fixed it --- tests/register.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/register.test.ts b/tests/register.test.ts index bbd21618..7422950a 100644 --- a/tests/register.test.ts +++ b/tests/register.test.ts @@ -29,9 +29,9 @@ test('Register - Barebones Program', async t => { ) const verifyingKey = await run( - 'register', - entropy.register({ - programDeployer: entropy.keyring.accounts.registration.address, + 'register - using custom params', + register(entropy, { + programModAddress: entropy.keyring.accounts.registration.address, programData: [{ program_pointer: pointer, program_config: '0x' }], }) ) From 0b6628f9c4a1b15d494e82b58daa0249d8bdda77 Mon Sep 17 00:00:00 2001 From: Nayyir Jutha Date: Mon, 22 Jul 2024 15:58:52 -0400 Subject: [PATCH 2/2] updated spelling of params --- src/flows/register/register.ts | 4 ++-- src/flows/register/types.ts | 2 +- tests/register.test.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/flows/register/register.ts b/src/flows/register/register.ts index 8b2c3941..d859d92b 100644 --- a/src/flows/register/register.ts +++ b/src/flows/register/register.ts @@ -1,8 +1,8 @@ import Entropy from "@entropyxyz/sdk"; -import { RegsiterParams } from "./types"; +import { RegisterParams } from "./types"; import { print } from "src/common/utils"; -export async function register (entropy: Entropy, params?: RegsiterParams): Promise { +export async function register (entropy: Entropy, params?: RegisterParams): Promise { let verifyingKey: string try { const registerParams = params?.programModAddress && params?.programData ? { programDeployer: params.programModAddress, programData: params.programData } : undefined diff --git a/src/flows/register/types.ts b/src/flows/register/types.ts index df77d563..1a1dc573 100644 --- a/src/flows/register/types.ts +++ b/src/flows/register/types.ts @@ -1,4 +1,4 @@ -export interface RegsiterParams { +export interface RegisterParams { programModAddress?: string // TODO: Export ProgramInstance type from sdk programData?: any diff --git a/tests/register.test.ts b/tests/register.test.ts index 7422950a..0f16622b 100644 --- a/tests/register.test.ts +++ b/tests/register.test.ts @@ -13,7 +13,7 @@ test('Regsiter - Default Program', async (t) => { const fullAccount = entropy.keyring.getAccount() - t.equal(verifyingKey, fullAccount.registration.verifyingKeys[0], 'verifying key matches key added to regsitration account') + t.equal(verifyingKey, fullAccount.registration.verifyingKeys[0], 'verifying key matches key added to registration account') t.end() }) @@ -38,7 +38,7 @@ test('Register - Barebones Program', async t => { const fullAccount = entropy.keyring.getAccount() - t.equal(verifyingKey, fullAccount.registration.verifyingKeys[1], 'verifying key matches key added to regsitration account') + t.equal(verifyingKey, fullAccount.registration.verifyingKeys[1], 'verifying key matches key added to registration account') t.end() })