-
Notifications
You must be signed in to change notification settings - Fork 49
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
Metadata upgrade #579
Metadata upgrade #579
Conversation
c2e88af
to
70efe80
Compare
Also upgrade the fake currency plugin so the test can access its tokens in the new format.
- Replace `mergeDeeply` with a type-safe merge routine. - Do more work in the cleaner, to avoid the separate `DiskMetadata` type.
d8f282b
to
e37ac0a
Compare
name: over.name ?? under.name, | ||
notes: over.notes ?? under.notes | ||
const out: EdgeMetadata = { exchangeAmount: {} } | ||
const { exchangeAmount = {} } = out |
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.
Adding a default fallback not necessary. just do
const { exchangeAmount } = out
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.
This doesn't type-check because exchangeAmount
is a ?:
. The fallback is useless at runtime, but TypeScript is angry without it.
CHANGELOG.md
Outdated
@@ -10,6 +10,7 @@ | |||
- added: Allow deleting metadata fields by passing `null` to `saveTxMetadata`. | |||
- deprecated: `EdgeCurrencyEngineCallbacks.onBalanceChanged`. Use `onTokenBalanceChanged` instead. | |||
- deprecated: `EdgeTransaction.currencyCode`. Use `tokenId` instead. | |||
- removed: Turn rate plugins into a no-op. These plugins may still be passed to `addEdgeCorePlugins`, and `EdgeAccount.rateCache` object still exists, but all rates are locked at 0. |
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.
This is borderline a breaking change. Sure the API stays the same but the plugins just plain not working is arguably a breaking change. It's even worse because a user won't even get a TS error that the API is broken. I would revert this.
Also store metadata on-disk using tokenId instead of currencyCode, with fallback support for reading old data.
This makes it possible to get transactions and addresses using a tokenId instead of a currency code.
b2ca26d
to
d4a25c7
Compare
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneDescription
This branch back-ports all the new non-breaking features from Paul's core 2.0 branches, so we can release them as a final v1 branch. Then we can merge the breaking v2 changes on top.