You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So far only Worker::patch_state is available for users to patch values into, with #124 trying to add the rest (patch_account, patch_keys), but that hasn't had much progress for a while.
Instead of that, I suggest a simpler API that should be easier to add.
We can have a Worker::<Sandbox>::patch(AccountId) which very similar and consistent with APIs like {Account, Contract}::batch(AccountId) that can be a builder that takes multiple entries to patching state or keys, along with patching account as well:
worker.patch(AccountId).access_key(public_key,AccessKey::function_call_access()).access_key(public_key,AccessKey::full_access()).access_keys(impl Iterator<(PublicKey,AccessKey)>).state(key:&[u8], val:&[u8]).state(...).states(impl Iterator<(&[u8],&[u8])>).account(AccountDetails)// or change up the account from what's currently on the chain.account_from_current(|account:AccountDetails| {
account.balance = 10000;
account
}).await?;
We can also continue to provide the non-builder versions as well as to not require switching over to this syntax for users of patch_state already, and have two newer API surfaces patch_key(AccountId, AccessKey) and patch_account(AccountId, AccountDetails)
The text was updated successfully, but these errors were encountered:
So far only
Worker::patch_state
is available for users to patch values into, with #124 trying to add the rest (patch_account
,patch_keys
), but that hasn't had much progress for a while.Instead of that, I suggest a simpler API that should be easier to add.
We can have a
Worker::<Sandbox>::patch(AccountId)
which very similar and consistent with APIs like{Account, Contract}::batch(AccountId)
that can be a builder that takes multiple entries to patching state or keys, along with patching account as well:We can also continue to provide the non-builder versions as well as to not require switching over to this syntax for users of
patch_state
already, and have two newer API surfacespatch_key(AccountId, AccessKey)
andpatch_account(AccountId, AccountDetails)
The text was updated successfully, but these errors were encountered: