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

CNS-262: changed payment objects to hold keys, not pointers #273

Merged

Conversation

oren-lava
Copy link
Contributor

  • Please check if the PR fulfills these requirements
  • [ V ] Commit message follows the Contribution Guidelines
  • [ V ] Tests ran locally and added/modified if needed
  • [ V ] Docs have been added/updated, if applicable
  • [ V ] If applicable - JIRA ticket ID was added
  • What kind of change does this PR introduce? (Bug fix, feature, unit tests, docs update, ...)
    Bug fix

  • What is the current behavior? (You can also link to an open issue here)
    The payment object epochPayments holds a list of providerPaymentStorage pointers. The providerPaymentStorage object holds a list of uniquePaymentStorageClientProvider pointers. In addition, the epochPayments, providerPaymentStorage and uniquePaymentStorageClientProvider are saved separately in the KVStore. This caused duplicates of objects. For example, if there was only one payment for a specific provider, two objects were created: a providerPaymentStorage object stored directly in the KVStore and a providerPaymentStorage object that its pointer was part of the epochPayments object's list of providerPaymentStorage pointers.

  • What is the new behavior (if this is a feature change)?
    Instead of keeping lists of pointers, each payment object now holds a unique string key that can be used to access payment objects. This way, there will be no more duplications since all the objects are saved once in the KVStore.

  • Please describe what manual tests you ran, if applicable

  • Other information:

proto/pairing/provider_payment_storage.proto Outdated Show resolved Hide resolved
proto/pairing/epoch_payments.proto Outdated Show resolved Hide resolved
x/pairing/keeper/epoch_payments.go Outdated Show resolved Hide resolved
x/pairing/keeper/epoch_payments.go Outdated Show resolved Hide resolved
x/pairing/keeper/msg_server_relay_payment.go Outdated Show resolved Hide resolved
x/pairing/keeper/msg_server_relay_payment.go Outdated Show resolved Hide resolved
@oren-lava oren-lava force-pushed the CNS-262-change-pointers-to-keys-in-payment-objects branch from be0fd69 to 057144c Compare January 30, 2023 15:29
@oren-lava oren-lava requested a review from Yaroms January 30, 2023 15:57
proto/pairing/epoch_payments.proto Outdated Show resolved Hide resolved
proto/pairing/provider_payment_storage.proto Outdated Show resolved Hide resolved
Yaroms
Yaroms previously approved these changes Jan 31, 2023
omerlavanet
omerlavanet previously approved these changes Feb 1, 2023
x/pairing/keeper/epoch_payments.go Show resolved Hide resolved
@oren-lava oren-lava dismissed stale reviews from omerlavanet and Yaroms via 4679d69 February 1, 2023 12:30
@omerlavanet omerlavanet self-requested a review February 1, 2023 12:49
@omerlavanet omerlavanet merged commit 4e2acf1 into main Feb 1, 2023
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.

None yet

3 participants