Skip to content

Commit

Permalink
add tests for deposit_amounts
Browse files Browse the repository at this point in the history
  • Loading branch information
HananINouman committed Mar 13, 2024
1 parent a2992bd commit 47664f2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions test/methods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ describe('Cluster Client', () => {
const clusterDefinition = await clientInstance.getClusterDefinition(
clusterLockV1X8.cluster_definition.config_hash,
)

expect(clusterDefinition.deposit_amounts?.length).toEqual(
clusterLockV1X8.cluster_definition.deposit_amounts.length,
)
expect(clusterDefinition.config_hash).toEqual(
clusterLockV1X8.cluster_definition.config_hash,
)
Expand Down Expand Up @@ -183,10 +187,10 @@ describe('Cluster Client without a signer', () => {
expect(clusterLock.lock_hash).toEqual(clusterLockV1X8.lock_hash)
})

test.each([{version:"v1.7.0", clusterLock:clusterLockV1X7},{version:"v1.8.0", clusterLock:clusterLockV1X8}])(
test.each([{ version: "v1.7.0", clusterLock: clusterLockV1X7 }, { version: "v1.8.0", clusterLock: clusterLockV1X8 }])(
`$version: 'should return true on verified cluster lock'`,
async ({ clusterLock }) => {
const isValidLock: boolean = await validateClusterLock(clusterLock)
expect(isValidLock).toEqual(true)
})
const isValidLock: boolean = await validateClusterLock(clusterLock)
expect(isValidLock).toEqual(true)
})
})
12 changes: 8 additions & 4 deletions test/sdk-package-test/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,21 @@ describe('Poll Cluster Lock', () => {
await client.getClusterDefinition(
clusterLockV1X8.cluster_definition.config_hash,
)

expect(clusterDefinition.deposit_amounts?.length).toEqual(
clusterLockV1X8.cluster_definition.deposit_amounts.length,
)
expect(clusterDefinition.config_hash).toEqual(
clusterLockV1X8.cluster_definition.config_hash,
)
})

test.each([{version:"v1.7.0", clusterLock:clusterLockV1X7},{version:"v1.8.0", clusterLock:clusterLockV1X8}])(
test.each([{ version: "v1.7.0", clusterLock: clusterLockV1X7 }, { version: "v1.8.0", clusterLock: clusterLockV1X8 }])(
`$version: 'should return true on verified cluster lock'`,
async ({ clusterLock }) => {
const isValidLock: boolean = await validateClusterLock(clusterLock)
expect(isValidLock).toEqual(true)
})
const isValidLock: boolean = await validateClusterLock(clusterLock)
expect(isValidLock).toEqual(true)
})

afterAll(async () => {
const configHash = clusterLockV1X8.cluster_definition.config_hash
Expand Down

0 comments on commit 47664f2

Please sign in to comment.