-
-
Save dhadrien/b71505210b4cd014af81dee12a9c0034 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const subdomain = 'subdomain.sismo.eth'; | |
const userLabel = 'newUser'; | |
const userLabelHash = getLabelhash(userLabel); | |
const subdomainNode = nameHash.hash(subdomain); | |
const userNode = nameHash.hash(`${userLabel}.${subdomain}`); | |
const userNode2 = keccak256( | |
ethers.utils.solidityPack( | |
['bytes', 'bytes'], | |
[subdomainNode, userLabelHash] | |
) | |
); | |
await nameWrapper.setSubnodeRecordAndWrap( | |
subdomainNode, | |
'newUser', | |
ownerSigner.address, | |
publicResolver.address, | |
0, | |
0 | |
); | |
// This is ok with userNode2 | |
expect( | |
await nameWrapper.balanceOf(ownerSigner.address, userNode2) | |
).to.be.equal(1); | |
// This is not ok with userNode | |
expect( | |
await nameWrapper.balanceOf(ownerSigner.address, userNode) | |
).to.be.equal(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment