How to verify the tryExitOffer
execution of a bad invitation
?
#10374
-
QuestionThe purpose of this discussion is to find an approach to verify that a transaction that executes a ContextIn the context of a3p acceptance tests, there is one test case that validates that an offer built with an invalid method during upgrade-15 can be exited and the payment redeemed. By comparing the user's balance, we can verify that this is the case. Although, the current implementation relies on the method At smatWallet.js, the executeOffer method will call This means that when tryExitOffer method is called, the payment will be reclaimed but then, it will throw with a message similar to ProblemIn the effort to find a replacement for waitForBlock, I started by checking if the user's wallet, During today's office hours, @dckc suggested that the status of the This does not seem to be the case either, as we can see from this test. Which I assume it is because the tryExitOffer method throws because the offerId can't be found at liveOfferSeats. How to reproduce:
LogsChain logs: 2024-10-30T18:57:30.655Z SwingSet: vat: v43: walletFactory.fromBridge: { blockHeight: 1360, blockTime: 1730314649, owner: 'agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q', spendAction: '{"body":"#{\\"method\\":\\"tryExitOffer\\",\\"offerId\\":\\"bad-invitation-15\\"}","slots":[]}', type: 'WALLET_SPEND_ACTION' }
2024-10-30T18:57:30.656Z SwingSet: vat: v43: walletFactory: { wallet: Object [Alleged: SmartWallet self] {}, actionCapData: { body: '#{"method":"tryExitOffer","offerId":"bad-invitation-15"}', slots: [] } }
2024-10-30T18:57:30.701Z SwingSet: vat: v43: wallet agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q reclaimed [ { brand: Object [Alleged: IST brand] {}, value: 15_000n } ] from bad-invitation-15
2024-10-30T18:57:30.702Z SwingSet: ls: v43: Logging sent error stack (Error#1)
2024-10-30T18:57:30.702Z SwingSet: ls: v43: Error#1: key bad-invitation-15 not found in collection live offer seats
2024-10-30T18:57:30.702Z SwingSet: ls: v43: Error: key (a string) not found in collection "live offer seats" Test logs: LOG wallet node before: {
status: {
id: 'pushPriceRound-1730282371904',
invitationSpec: {
invitationArgs: Array [ … ],
invitationMakerName: 'PushPrice',
previousOffer: 'stATOM.n-upgrade.0',
source: 'continuing',
},
numWantsSatisfied: 1,
payouts: {},
proposal: {},
result: undefined,
},
updated: 'offerStatus',
} LOG wallet node after: {
status: {
id: 'pushPriceRound-1730282371904',
invitationSpec: {
invitationArgs: Array [ … ],
invitationMakerName: 'PushPrice',
previousOffer: 'stATOM.n-upgrade.0',
source: 'continuing',
},
numWantsSatisfied: 1,
payouts: {},
proposal: {},
result: undefined,
},
updated: 'offerStatus',
} broadcastBridgeAction { method: 'tryExitOffer', offerId: 'bad-invitation-15' }
Executing [
'--node=http://0.0.0.0:26657',
'--chain-id=agoriclocal',
'--keyring-backend=test',
'--from=agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q',
'tx',
'swingset',
'wallet-action',
'--allow-spend',
'{"body":"#{\\"method\\":\\"tryExitOffer\\",\\"offerId\\":\\"bad-invitation-15\\"}","slots":[]}',
'--output',
'json',
'--yes'
]
2024-10-30T19:29:29.474074754Z tx not in block 1324 retrying... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That's unfortunate. I suppose the test we used was to check the account balance. could you use a "retry until the balance changes" approach? |
Beta Was this translation helpful? Give feedback.
That's unfortunate.
I suppose the test we used was to check the account balance.
https://github.com/Agoric/agoric-3-proposals/blob/c9644d6cdc28af8cc40c836ea17662935a948c9f/proposals/75%3Aupgrade-16/exit-reclaim.test.js#L23-L35
could you use a "retry until the balance changes" approach?