-
Notifications
You must be signed in to change notification settings - Fork 214
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
6184 wallet.current record #6359
Conversation
eb33d67
to
4d97f9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks on target.
I'm less confident about the wallet ui, so perhaps stand by for someone else to review that part.
); | ||
t.deepEqual(Object.keys(currentState.offerToUsedInvitation), ['44']); | ||
t.is( | ||
currentState.offerToUsedInvitation[44].value[0].description, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bingo
@@ -47,7 +47,7 @@ agd query bank balances "$WALLET_BECH32" | grep ubld || exit 1 | |||
echo "Provisioning your smart wallet..." | |||
agoric wallet provision --spend --account "$WALLET" | |||
echo "waiting for blocks" | |||
sleep 5 | |||
sleep 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. I tripped on that too.
const latest = await iterator.next(); | ||
/** @type {import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord} */ | ||
const current = latest.value.value; | ||
console.log('fetcHCurrent', current); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks drafty. Did you mean to keep that?
Not critical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, thanks, i'll fixup
console.log('fetchCurrent()'); | ||
const latestIterable = await E(currentFollower).getLatestIterable(); | ||
const iterator = latestIterable[Symbol.asyncIterator](); | ||
const latest = await iterator.next(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent a race between the two followers, we need to store the height at which latest
was published, like the way we used to get from getFirstHeight
.
} | ||
console.log('brandToPurse map', brandToPurse); | ||
updatePurses(); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}; | |
return firstHeight; | |
}; |
const followLatest = async () => { | ||
console.log('followLatest()'); | ||
for await (const { value } of iterateEach(updateFollower)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const followLatest = async () => { | |
console.log('followLatest()'); | |
for await (const { value } of iterateEach(updateFollower)) { | |
const followLatest = async firstHeight => { | |
console.log('followLatest()'); | |
for await (const { value } of iterateEach(updateFollower, { height: firstHeight })) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excellent, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks overall good.
I would prefer more careful handoff between the current state and the { height: lastHeight }
parameter of the update stream, but even just a comment to that effect would be fine.
Since this has on-chain changes, it needs to go on the release-pismo branch, one way or the other. |
4d97f9c
to
8e94f86
Compare
8e94f86
to
fa3e4e6
Compare
fa3e4e6
to
4c6544b
Compare
I tried to make this PR base of release-pismo but it has diverged enough from master that the rebase was somewhat cumbersome. I'll wait for this to get into master and then do a separate PR to get the commits into pismo. |
refs: #6184 (partial)
Description
Add a
.current
subnode to the wallet node for clients to have a stable HEAD that has all precious state. This is a slow growing set so won't bring on the problems of #6038The keys are,
Also updates wallet CLI and GUI to use it.
Security Considerations
Nothing exposed that wasn't published before in some fashion.
Documentation Considerations
--
Testing Considerations
PSM integration test covers it. It would be good to have more specific tests but not economical right now.
Manually tested
agoric wallet show
and that Wallet UI shows the purse balances.