Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NayNay] Fixing register tests #194

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/flows/register/register.ts
Original file line number Diff line number Diff line change
@@ -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<string> {
export async function register (entropy: Entropy, params?: RegisterParams): Promise<string> {
let verifyingKey: string
try {
const registerParams = params?.programModAddress && params?.programData ? { programDeployer: params.programModAddress, programData: params.programData } : undefined
Expand Down
2 changes: 1 addition & 1 deletion src/flows/register/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface RegsiterParams {
export interface RegisterParams {
programModAddress?: string
// TODO: Export ProgramInstance type from sdk
programData?: any
Expand Down
10 changes: 5 additions & 5 deletions tests/register.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand All @@ -29,16 +29,16 @@ 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' }],
Comment on lines +32 to 35
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the fix to review, the rest is cleanup

})
)

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()
})