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

fix: multiple deposits of unknown brand #7027

Merged
merged 3 commits into from
Feb 17, 2023
Merged

Conversation

turadg
Copy link
Member

@turadg turadg commented Feb 17, 2023

closes: #6961

Description

Makes a new array instead of try to push to the hardened one. Also improved docs on how unknown brand deposits are handled.

Security Considerations

Scaling Considerations

Documentation Considerations

Testing Considerations

Failing test now passing.

@turadg turadg requested a review from dckc February 17, 2023 19:49
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting approach.

@@ -374,11 +374,13 @@ export const prepareSmartWallet = (baggage, shared) => {
return E(invitationPurse).deposit(payment);
}

// When there is no purse, queue the payment
// When there is no purse, save the payment into a queue.
// It's not yet ever read but a future version of the contract can
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting... so we don't yet trigger deposits when new issuers come along, but we support upgrade to a wallet that does.

Hm... is there a way for somebody to send an ERTP payment with a brand not known to the vbank? I can't think of one. I was thinking we might owe an issue for the case of newly-approved tokens, but I think we're internally consistent as-is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's right

if (queues.has(brand)) {
queues.get(brand).push(payment);
const extant = queues.get(brand);
queues.set(brand, harden([...extant, payment]));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to be the gist of it.

@turadg turadg added automerge:no-update (expert!) Automatically merge without updates bypass:integration Prevent integration tests from running on PR labels Feb 17, 2023
@mergify mergify bot merged commit 4d513b0 into master Feb 17, 2023
@mergify mergify bot deleted the 6961-save-unknown-payments branch February 17, 2023 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:no-update (expert!) Automatically merge without updates bypass:integration Prevent integration tests from running on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

smart wallet fails on 2nd payment from unknown brand
2 participants