-
Notifications
You must be signed in to change notification settings - Fork 3
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
support vstorage query by block height #80
Comments
I think we could add something pretty easily to the |
I haven't tried casting lately. I should give it another look. |
From my perspective, the helpers/functions I think could be useful are -
Reading back, |
This issue is specifically about the vstorage layer. The wallet abstraction is a layer above. Your comments seem to be about a wallet query API.
I think that approach turned out to be buggy: an error could be reported between the time you submit the offer and the time you get around to asking for the result. The correct approach is to start watching for updates before submitting an offer. In general, the design is for wallet vstorage clients is:
it's not optional.
It's straightforward to get that by filtering by instance. A helper that does that is straightforward. The filter is at the wallet layer, not the vstorage layer. In ag-trade, I built the wallet layer on top of the vstorage layer like this: history: async (visitor, minHeight) => {
const history = vstorage.readHistoryBy(
s => query.fromCapData(JSON.parse(s)),
`published.wallet.${addr}`,
minHeight,
);
for await (const record of history) {
await E(visitor).visit(record);
}
}, -- https://github.com/endojs/playground/blob/main/packages/ag-trade/src/smartWallet.js#L106
In the on-chain world, there's a general recognition that a one-time |
ui-kit currently has Also, the smart wallet contract stores and publishes offer results that include For "in-progress" offers, these are published in I think this covers a lot of cases, but not all. It would be better to cover as many cases as possible without relying on archive nodes, blockheight concerns, and long chains of queries on page-load. |
What is the Problem Being Solved?
Description of the Design
briefly: use
x-cosmos-block-height
as inhttps://github.com/endojs/playground/blob/dd07158623eae7319b704723b9467e3df1b2fdb4/packages/ag-trade/src/batchQuery.js#L41-L45
stretch goal: async iterable of results as in readHistory (IIRC, @0xpatrickdev liked that idea)
Security Considerations
Scaling Considerations
Test Plan
The text was updated successfully, but these errors were encountered: