-
Notifications
You must be signed in to change notification settings - Fork 261
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
Paul/core2.0 #4641
Paul/core2.0 #4641
Conversation
9f56e43
to
8990c50
Compare
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.
Besides the comments here, I have a sidecar branch that includes a bunch of additional fixes.
The sidecar branch focuses on the GuiCurrencyInfo
and WalletListResult
, which are using tokenId: undefined
to mean both "parent currency" and "none specified". We aren't using null
in general, but only to indicate parent currencies. This means we can't use tokenId: null
to mean "none specified".
In the GuiCurrencyInfo
case, I simply made the tokenId
mandatory in all cases. In the WalletListResult
case, I use a discriminated union to simply remove the tokenId
when it is not relevant.
This branch will need to be rebased on top of the sidecar branch. The merge conflicts are things we need to fix in any case.
src/plugins/borrow-plugins/plugins/aave/AaveBorrowEngineFactory.ts
Outdated
Show resolved
Hide resolved
1661d3a
to
47ec4f5
Compare
React.useEffect(() => { | ||
const interval = setInterval(() => { | ||
setDirty(dirty => ({ | ||
...dirty, | ||
rates: true | ||
})) | ||
}, REFRESH_RATES_MS) | ||
return () => clearInterval(interval) | ||
}, []) | ||
|
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.
Do not use setInterval
! There are subtle dangers here. Use makePeriodicTask
to handle this in a better way.
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 moved this fix to #4677
47ec4f5
to
c32a9f7
Compare
@@ -175,7 +175,7 @@ export function handleWalletUris( | |||
fioAddress?: string | |||
): ThunkAction<Promise<void>> { | |||
return async (dispatch, getState) => { | |||
const { legacyAddress, metadata, minNativeAmount, nativeAmount, publicAddress, uniqueIdentifier, tokenId } = parsedUri | |||
const { legacyAddress, metadata, minNativeAmount, nativeAmount, publicAddress, uniqueIdentifier, tokenId = null } = parsedUri |
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.
A note about this one: I made EdgeParsedUri.tokenId optional, since it doesn't apply in all scenarios. For instance, something like a bitId URI would not include a currency code / tokenId at all.
More importantly, we would need to add upgrade logic into the core, in case an older currency plugin fails to pass tokenId, we can still derive it from the currency code so the GUI can rely on it being present. We don't want illegal values slipping past the type system, since that's a recipe for crashes.
I did not want to enter this minefield, so I'm leaving the status quo for now.
The correct fix is to make EdgeParsedUri a union type, reflecting the different types of things we might scan (payments / private keys / wallet connect / bitId / request for address / etc.), so we can make tokenId mandatory in the places where it matters. This is a bigger project, so I left it for another day.
0de260d
to
f7f0038
Compare
163f262
to
1c48dcf
Compare
edge-core-js to 2.0.0 edge-exchange-plugins to 2.0.0
1c48dcf
to
93c95c9
Compare
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
#4677
Requirements
If you have made any visual changes to the GUI. Make sure you have: