Skip to content

Commit 918892b

Browse files
authored
Fix install modules during instantiation (#537)
1 parent 95c055a commit 918892b

22 files changed

+25
-23
lines changed
36.9 KB
Binary file not shown.
5.41 KB
Binary file not shown.
0 Bytes
Binary file not shown.

framework/artifacts/checksums.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
8b2d56efcad1c987c8cc89d07268c5ce0ad4312b8eb196a7ca2f9242606bbda9 abstract_account-xion.wasm
2-
8c63cab7071fd5fc2ba5261a6fe1c864d93bc429037c22c3780bd94d6cdf6782 abstract_account.wasm
1+
4bf416becdfe632df49cf8a7462752961066253bc85e6ffdafd77980d0fd8edb abstract_account-xion.wasm
2+
b04a125da587f70baacb6767044dcea01272ceb41808a820a43bac08a65b4f57 abstract_account.wasm
33
55f36c4d96e50542da91b6b1cb6069fffb5ceda297fec483d21caae728ad0834 abstract_ans_host.wasm
44
80e0a350981b11d8964c998d906a9c222da7f86173485faf6675efb3e827d54b abstract_ibc_client.wasm
55
c320daf8e81a2e33252d30e436727085ca01ec81519b6b183aa62281c14b1fc6 abstract_ibc_host.wasm
66
45316f6d205dc28279484ab3aa5bc23df2e58da274aeb2d8d7a4fc25176bdc65 abstract_ica_client.wasm
77
496205b8d14615376ea9a5d12b002e9051e1cb17a1c34abc9ad91d50f7ff9bfd abstract_module_factory.wasm
8-
4a3f62f68a0de9a8831c7be31f6f5d35f59d63a408a3991b22788b1a30999d74 abstract_registry.wasm
8+
6041ca5e0f446878477d55ab174468581db51484a776da1efb506cd60d2e6276 abstract_registry.wasm

framework/contracts/account/src/contract.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ pub fn instantiate(
230230
// Install modules
231231
let (install_msgs, install_attribute) = _install_modules(
232232
deps.branch(),
233-
&env,
234233
install_modules,
235234
simulate_resp.total_required_funds,
235+
code_id,
236236
)?;
237237
response = response
238238
.add_submessages(install_msgs)

framework/contracts/account/src/migrate.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ pub fn migrate(mut deps: DepsMut, env: Env, _msg: MigrateMsg) -> AccountResult {
113113
)];
114114

115115
if !install_modules.is_empty() {
116+
let abstract_code_id =
117+
native_addrs::abstract_code_id(&deps.querier, env.contract.address.clone())?;
116118
// Install modules
117119
let (install_msgs, install_attribute) =
118-
_install_modules(deps, &env, install_modules, vec![])?;
120+
_install_modules(deps, install_modules, vec![], abstract_code_id)?;
119121
response = response
120122
.add_submessages(install_msgs)
121123
.add_attribute(install_attribute.key, install_attribute.value);

framework/contracts/account/src/modules.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ pub fn install_modules(
4848
// only owner can call this method
4949
ownership::assert_nested_owner(deps.storage, &deps.querier, &info.sender)?;
5050

51+
let abstract_code_id =
52+
native_addrs::abstract_code_id(&deps.querier, env.contract.address.clone())?;
5153
let (install_msgs, install_attribute) = _install_modules(
5254
deps.branch(),
53-
env,
5455
modules,
5556
info.funds, // We forward all the funds to the module_factory address for them to use in the install
57+
abstract_code_id,
5658
)?;
5759
let response = AccountResponse::new("install_modules", std::iter::once(install_attribute))
5860
.add_submessages(install_msgs);
@@ -64,16 +66,14 @@ pub fn install_modules(
6466
/// Adds the modules to the internal store for reference and adds them to the account allowlist if applicable.
6567
pub fn _install_modules(
6668
mut deps: DepsMut,
67-
env: &Env,
6869
modules: Vec<ModuleInstallConfig>,
6970
funds: Vec<Coin>,
71+
abstract_code_id: u64,
7072
) -> AccountResult<(Vec<SubMsg>, Attribute)> {
7173
let mut installed_modules = Vec::with_capacity(modules.len());
7274
let mut account_modules = Vec::with_capacity(modules.len());
7375
let account_id = ACCOUNT_ID.load(deps.storage)?;
7476

75-
let abstract_code_id =
76-
native_addrs::abstract_code_id(&deps.querier, env.contract.address.clone())?;
7777
let registry = RegistryContract::new(deps.as_ref(), abstract_code_id)?;
7878
let module_factory = ModuleFactoryContract::new(deps.as_ref(), abstract_code_id)?;
7979

-477 Bytes
Binary file not shown.
-477 Bytes
Binary file not shown.
-485 Bytes
Binary file not shown.
-477 Bytes
Binary file not shown.
961 Bytes
Binary file not shown.
-477 Bytes
Binary file not shown.
-484 Bytes
Binary file not shown.
-547 Bytes
Binary file not shown.
Binary file not shown.

modules/artifacts/calendar_app.wasm

-714 Bytes
Binary file not shown.

modules/artifacts/challenge_app.wasm

-718 Bytes
Binary file not shown.

modules/artifacts/checksums.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
dbfcde65d32dfaa6d492471cef10d6c56466da20edb0e95705fdc16551db57cd abstract_cw_staking-archway.wasm
2-
46726b5fd649f4055e7f6a87f5b70f5caca44ed71e951c6a726f90ebb7634e83 abstract_cw_staking-osmosis.wasm
3-
57b36cc7d4a6911829a670f4620905b903d6ee392217d8ec1e229181589ab884 abstract_cw_staking.wasm
4-
70f2cc1ff07aed735c641aac77538c6c99f212c1f50110c520e28104baf7b0c9 abstract_dex_adapter-archway.wasm
5-
08d0b4b0a2abe5c39bb9278baee443f63d386d32f205d588e846bf339579a77f abstract_dex_adapter-osmosis.wasm
6-
c0016bddc87dd02875e7a7eeb8b0d0c756545613ae196190cfbab6689abd943d abstract_dex_adapter.wasm
7-
06b8ab9f6cddbee2567fd93dfacd6b9c1be35b9385d3e2d766519a848e974b3a abstract_money_market_adapter.wasm
8-
921aa989cf86058764c374c9a4508b6c7f5f7db45efa92a0b70d242a307a0f55 abstract_subscription.wasm
9-
02b356e90610855969250a5926b5a38355144f3e285d5a1a165d4b412468c6a0 abstract_tendermint_staking_adapter.wasm
10-
8a66b033fbbbeaf5ab8e8a430f722878fd83635959c714953965bf25df1d3110 calendar_app.wasm
11-
a4ae90a75586beeb79568994d88525e01e97b0a8f499313032cc47cbb2eb9649 challenge_app.wasm
12-
0285c45e654b71b204bf7b388513a0d03a9bf030c66980e96543820cba400592 my_standalone.wasm
13-
d3d166beb995d4889635311c05c837927cada88b376a44c2073babac2d1d6f65 payment_app.wasm
14-
1668967eda09b2bfcc45250cecc1a2704f5156553f758e6cdf9b79eb7e0d8773 ping_pong.wasm
1+
6f792b0492cb13c4aea961021b9ab9da31669be1cdd68210232d95fa84e8de46 abstract_cw_staking-archway.wasm
2+
97c8b30f3c9afb97dd21c0a81a056b909dfff044766c660f42ce0b43cff82268 abstract_cw_staking-osmosis.wasm
3+
a5b1d56a977fe6175bf5260b4e6bc52a8dfdc046edaf82148aea93ac5730c52a abstract_cw_staking.wasm
4+
db7c43553bc5ee97ac02bb7d128665b49a1747c3192f9524f959e0069e90b7bf abstract_dex_adapter-archway.wasm
5+
e70a6afbe7fdc588a1fac977527e9cc3e0b0dcd8ea50c283a5a1619bde464c25 abstract_dex_adapter-osmosis.wasm
6+
c4aa1d3c350418a5d42a30f8434afdf4665d278269808de00a2f1e604a3277a9 abstract_dex_adapter.wasm
7+
27eb351a7a561eac58bb676880061edcc6d3a70758d965aa038d41ad2fe1417b abstract_money_market_adapter.wasm
8+
2c2226362a685c8d0fed590b1d144f4c16180a8e252815066acebbf19096c211 abstract_subscription.wasm
9+
e99848f4025ead8aa944de4094895d5d7311fe409b2271805f7f12b29ca67ccd abstract_tendermint_staking_adapter.wasm
10+
72856f4c121c9231cbc42fbb2368214a20e5d1ef19aaf19c5a408a00192d7276 calendar_app.wasm
11+
911c98e1b7551bfb1916e8327cbd183affc604a6a20ad7fe8d755a81ed7f5bd9 challenge_app.wasm
12+
6ed21d43f039bb4bf8a9aecc2f7b8bff0c143b0e18303f39198b970d8dc30b2f my_standalone.wasm
13+
da60215c941e18638c1c594f4bbaf8a6437a07bf2a07808298103f5c4f835f73 payment_app.wasm
14+
27eff77a24be2d33be753094acbecd7faa45b7d7dd40ee511beca74e8ffa3c72 ping_pong.wasm

modules/artifacts/my_standalone.wasm

-1 Bytes
Binary file not shown.

modules/artifacts/payment_app.wasm

-710 Bytes
Binary file not shown.

modules/artifacts/ping_pong.wasm

-593 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)