Skip to content

Commit

Permalink
changes to test to reflect classes. changed naming convention in prog…
Browse files Browse the repository at this point in the history
…rams for consistency.
  • Loading branch information
jawndiego committed Nov 10, 2023
1 parent 47b6779 commit bedab3a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
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

0 comments on commit bedab3a

Please sign in to comment.