Open samsiegart opened 1 month ago
The smart wallet uses a read-only marshaller when publishing wallet contents; if something isn't already on the board, the smartWallet doesn't add it.
A work-around is for the contract that creates the invitation to put the invitation handle on the board.
@erights points out that Amounts are designed to be not sensitive - parties should be able to want:
them without having them.
It looks like none of the other things in the current and update records that the smartWallet publishes are sensitive either.
So changing getReadonlyMarshaller
to getPublishingMarshaller
would be one approach.
Downside: the board has no mechanism for collecting entries. So the invitation handles would consume space indefinitely.
In today's office hours, I talked with @Jovonni and co about...
~/projects/agoric-sdk/packages/smart-wallet
11:48 connolly@bldbox$ git diff .
diff --git a/packages/smart-wallet/src/offerWatcher.js b/packages/smart-wallet/src/offerWatcher.js
index 3b2bc004f..6994d6dbd 100644
--- a/packages/smart-wallet/src/offerWatcher.js
+++ b/packages/smart-wallet/src/offerWatcher.js
@@ -191,6 +191,11 @@ export const prepareOfferWatcher = baggage => {
}
facets.helper.updateStatus({ result: UNPUBLISHED_RESULT });
break;
+ case 'remotable':{
+ const amt = await E(invitationIssuer).getAmountOf(result); // isLivePayment?
+ await E(invitationPurse).deposit(result)
+ }
+
default:
// drop the result
facets.helper.updateStatus({ result: UNPUBLISHED_RESULT });
In office hourse, @Jovonni and co talked about...
Trying to grok... this snippet is about returning an invitation from an offer result, rather than from a payout. This allows Alice to give an invitation to Bob without Bob exiting his seat, but I'm unclear on how this addresses the null
slot issue here.
oops; I think that comment should have gone on #8550
Describe the bug
In the invitation purse published to vstorage, invitations have a
null
slot value for their "handle" property. When trying to make an offer through the smart wallet with an invitation in the proposal, this null slot causes an error:To Reproduce
Send a
WalletSpendAction
with an invitation amount in the proposal, observe the error in the smart wallet.Expected behavior
A client can execute offers with invitation amounts in proposals.
Additional context
Discovered when trying to swap an invitation in https://github.com/Agoric/dapp-agoric-basics/pull/42