Skip to content
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

Merged
merged 13 commits into from
Jan 4, 2024
Merged

Metadata upgrade #579

merged 13 commits into from
Jan 4, 2024

Conversation

swansontec
Copy link
Contributor

@swansontec swansontec commented Jan 3, 2024

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

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.


@swansontec swansontec force-pushed the william/metadata-upgrade branch 2 times, most recently from c2e88af to 70efe80 Compare January 3, 2024 16:48
swansontec and others added 8 commits January 3, 2024 15:45
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.
name: over.name ?? under.name,
notes: over.notes ?? under.notes
const out: EdgeMetadata = { exchangeAmount: {} }
const { exchangeAmount = {} } = out
Copy link
Member

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

Copy link
Contributor Author

@swansontec swansontec Jan 4, 2024

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.
Copy link
Member

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.

paullinator and others added 5 commits January 4, 2024 10:04
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.
@swansontec swansontec merged commit 6eeb874 into master Jan 4, 2024
3 checks passed
@swansontec swansontec deleted the william/metadata-upgrade branch January 4, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants