-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add logic to support setting networking keys, transferring, and re-ticketing on L2 #640
Conversation
src/lib/useRoller.ts
Outdated
const proxy = isOwnerProxy(starInfo.ownership!, _wallet.address) | ||
? 'own' | ||
: isSpawnProxy(starInfo.ownership!, _wallet.address) | ||
? 'spawn' | ||
: undefined; |
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.
Looks like this logic is repeated in multiple places. That is probably fine for now, but if we anticipate using it in more places, we should consider extracting it to its own helper.
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.
Makes sense, I can make wrappers around these calls
src/lib/useRoller.ts
Outdated
|
||
// } | ||
const pointDetails = await api.getPoint(_point); | ||
// const proxy = getProxy(pointDetails.ownership!, _wallet.address); |
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.
// const proxy = getProxy(pointDetails.ownership!, _wallet.address); |
throw new Error("Error: Address doesn't match proxy"); | ||
console.log('operator', operator); | ||
|
||
const nonce = await api.getNonce({ |
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 think this is a great design decision to push the nonce management to the backend. simplifies the frontend significantly
}); | ||
if (currentL2) { | ||
console.log(newWallet.value); | ||
// FIXME: the useEffect is called twice, which is fine since the duplicate |
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.
Since this is not a showstopper, we can ignore it for now, and I can take a look at this in a follow up PR
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.
LGTM, a few minor comments that don't necessarily require changes, so feel free to merge
@@ -32,7 +32,7 @@ | |||
"@types/styled-components": "^5.1.10", | |||
"@types/styled-system": "^5.1.11", | |||
"@types/styled-system__css": "^5.0.15", | |||
"@urbit/roller-api": "^0.1.8", | |||
"@urbit/roller-api": "^0.1.9", |
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.
Since this was addressed in #641, does this branch need to be rebased on roller
?
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'll look locally if there's any conflicts, although the merge message here says that all is fine
proxy: string, | ||
nonce: number, | ||
urbitWallet: any | ||
networkSeed: any, |
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.
Is there a better choice than any
in this case?
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 think we can use string here, from the urbit-key-generation
repo this should be a hex-encoded string
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.
...although this is a Maybe (Just/Nothing) from folktale, and that doesn't seem to support typescript? origamitower/folktale#65
This only adds the logic to support the correct calls to the Roller, the new UI/UX should be addressed in a separate PR