Skip to content

Commit

Permalink
test: fix mint-module test (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
Songkeys committed May 6, 2023
1 parent 9a85477 commit d179921
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions test/contracts/mint-module.test.ts
@@ -1,5 +1,9 @@
import { describe, expect, test } from 'vitest'
import { decodeModuleInitData, encodeModuleInitData } from '../../src'
import {
decodeModuleInitData,
encodeModuleInitData,
getModules,
} from '../../src'

describe('mind-module', () => {
const input = [
Expand All @@ -11,19 +15,16 @@ describe('mind-module', () => {
]
const output =
'0x0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000001234567890123456789012345678901234567890000000000000000000000000abc123def456abc123def456abc123def456abc1'

test('encodeModuleInitData', async () => {
const result = await encodeModuleInitData(
'0x328610484ba1faae0fcdee44990d199cd84c8608',
input,
)
const modules = await getModules()
const result = await encodeModuleInitData(modules[0].address, input)
expect(result).toBe(output)
})

test('decodeModuleInitData', async () => {
const result = await decodeModuleInitData(
'0x328610484ba1faae0fcdee44990d199cd84c8608',
output,
)
const modules = await getModules()
const result = await decodeModuleInitData(modules[0].address, output)
expect(result).toStrictEqual(input)
})
})

0 comments on commit d179921

Please sign in to comment.