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

changes to test to reflect classes. changed naming convention in prog… #241

Merged
merged 1 commit into from
Nov 10, 2023
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
10 changes: 5 additions & 5 deletions src/programs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ export default class ProgramManager extends ExtrinsicBaseClass {
}

async checkAuthorization (
ownerAccount: string,
delegateAccount: string
sigReqAccount: string,
programModAccount: string
): Promise<boolean> {
// Get authorization status from Substrate
const authorizationStatus: Option<Bool> = ((await this.substrate.query.programs.getAuthorizationStatus(
ownerAccount,
delegateAccount
const authorizationStatus: Option<Bool> = ((await this.substrate.query.programs.allowedToModifyProgram(
sigReqAccount,
programModAccount
)) as unknown) as Option<Bool>

// Check if the Option is populated with a value
Expand Down
4 changes: 2 additions & 2 deletions src/registration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export interface RegistrationParams {
freeTx?: boolean
initialProgram?: string
keyVisibility?: 'Public' | 'Permissioned' | 'Private'
programModAccount?: Address
address: Address
programModAccount: Address
address?: Address
}

/**
Expand Down
5 changes: 3 additions & 2 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ it('should handle registration, program management, and signing', async () => {

try {
await entropy.register({
address: charlieStashAddress,
programModAccount: charlieStashAddress,
keyVisibility: 'Permissioned',
freeTx: false,
initialProgram: '0x'
})
} catch (e) {
console.error('Error in test:', e.message)
Expand Down Expand Up @@ -111,7 +112,7 @@ it('should handle registration, program management, and signing', async () => {
const dummyProgram: any = readFileSync(
'./tests/testing-utils/template_barebones.wasm'
)
await entropy.programs.set(dummyProgram)
await entropy.programs.set(dummyProgram, charlieStashAddress)
console.log('set program')
// Retrieve the program and compare
const fetchedProgram: ArrayBuffer = await entropy.programs.get()
Expand Down
Loading