Skip to content

Commit

Permalink
Add records to subname test
Browse files Browse the repository at this point in the history
  • Loading branch information
sugh01 committed Dec 12, 2023
1 parent e18d5ab commit f6a0802
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion packages/ensjs/src/test/usage/registerName.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import transferName from '../../functions/wallet/transferName.js'
import createSubname from '../../functions/wallet/createSubname.js'
import { registryOwnerSnippet, registrySetApprovalForAllSnippet } from '../../contracts/registry.js'
import wrapName from '../../functions/wallet/wrapName.js'
import setRecords from '../../functions/wallet/setRecords.js'
import { encodeAbi } from '../../utils/index.js'

let snapshot: Hex
let accounts: Address[]
Expand Down Expand Up @@ -689,7 +691,7 @@ it('Register - Set Subname', async () => {
`)
})

it('Register - unwrap 2LD - wrap Subname', async () => {
it.only('Register - unwrap 2LD - wrap Subname', async () => {
const name = 'cool-swag-wrap.eth'
const params: RegistrationParameters = {
name: name,
Expand Down Expand Up @@ -771,6 +773,27 @@ it('Register - unwrap 2LD - wrap Subname', async () => {

await approve(accounts[2])

const utx = await setRecords(walletClient, {
name: subName,
resolverAddress: (await getResolver(publicClient, {
name: name,
}))!,
coins: [
{
coin: 'eth',
value: accounts[2],
},
],
texts: [{ key: 'foo', value: 'bars' }],
abi: await encodeAbi({ encodeAs: 'json', data: [...dummyABI,{stateMutability: 'readonly',}] }),
contentHash: 'ipns://k51qzi5uqu5dgox2z23r6e99oqency055a6xt92xzmyvpz8mwz5ycjavm0u150',
account: accounts[2],
})
expect(utx).toBeTruthy()
const ureceipt = await waitForTransaction(utx)
expect(ureceipt.status).toBe('success')


const wrapNameTx = await wrapName(walletClient, {
name: subName,
newOwnerAddress: accounts[2],
Expand Down

0 comments on commit f6a0802

Please sign in to comment.