-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add create_wallet_with_custom_code
wallet helper function in miden-lib
#766
Comments
The PR: #767 |
this is related #550 The problem is storage and the reserved dataslots. However, I don't see why we can't merge a workaround until we have the correct package format |
If not critical, I'd prefer not to merge this as we should have a more general solution to accounts with custom code relatively soon (i.e., within the next month or so). |
Ok no worries. The partially fillable swap note for the order book note is working and has been extensively tested using mock-datastore. Is there a way to deploy a custom account to the miden localhost instance? I just need two extra "read-only" procedures in addition to the default account code, I want to deploy to miden-node this account:
|
The only way to do that is to create an account programmatically (e.g., instantiate the I think given the code you have above, instantiating |
After #935 is done (or maybe even as a part of it) we should be able to make account creation with custom code pretty straight-forward. We'd have some specialized methods for creating basic wallet and authentication components, and then, these could be combined into an account together with some custom components. For example, it could look something like this: let components = [
create_basic_wallet_component(),
create_RpoFalcon512_component(pub_key),
create_my_custom_component(),
];
let (account, seed) = create_account(init_seed, account_type, storage_mode, components); This is just an example interface - we could try to make things a bit more ergonomic. Maybe something like this: let (account, seed) = AccountBuilder::new(init_seed)
.with_storage_mode(AccountStorageMode::Public)
.with_basic_wallet()
.with_component(RpoFalcon512::new(pub_key))
.with_component(build_my_custom_component())
.build(); And faucets (or any other account) could be created using the same interface: let (account, seed) = AccountBuilder::new(init_seed)
.with_type(AccountType::FungibleFaucet)
.with_storage_mode(AccountStorageMode::Public)
.with_component(BasicFungibleFaucet::new(symbol, 8, Felt::new(2 << 63))),
.with_component(RpoFalcon512::new(pub_key))
.build(); |
Closed by #948. |
Feature description
Adding a
create_wallet_with_custom_code
function would make it easier to create wallets with custom code when using the miden-client.I propose adding a function in
miden-lib/src/accounts/wallets/mod.rs
that allows to pass in custom logic when creating a wallet. This function is pretty much a copy ofcreate_basic_wallet
but allows to pass in custom masm code when creating the wallet:Why is this feature needed?
Makes it easier to create wallets with custom logic when using Miden client.
The text was updated successfully, but these errors were encountered: