-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial ZNS 1.1 changes #51
Conversation
# Conflicts: # src/index.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM, some comments and questions
ipfsGatewayUri: IPFSGatewayUri | ||
): Promise<DomainMetadata> => { | ||
const registrar = await getRegistrarForDomain(hub, domainId); | ||
const metadataUri = await registrar.tokenURI(domainId); | ||
const metadata = await getMetadataFromUri(metadataUri, ipfsGatewayUri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a nice idea from now on to do the below for performance, even if this is only a few await
statements
const promises = [ ... ] as const;
const [var1, var2, ...] = await Promise.all(promises);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't do that since each promise relies on the last one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't how I missed that, makes sense
@@ -103,13 +104,13 @@ export const createInstance = (config: Config): Instance => { | |||
lockStatus: boolean, | |||
signer: ethers.Signer | |||
): Promise<ethers.ContractTransaction> => { | |||
const registrar: Registrar = await getRegistrar(signer, config.registrar); | |||
const hub: ZNSHub = await getHubContract(signer, config.hub); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose you could simplify this even further by just having config.hub
be a parameter to the action, and calling getHubContract
inside the action, same for the other functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the best pattern will be here yet, I think we'll need to do a refactor pass in the future after the launch.
Making the actions just take a registrar and then doing the domainId->registrar look up outside of them may be wiser.
Preliminary support for ZNS 1.1