Skip to content

Commit 1ee46d1

Browse files
authored
Merge pull request #243 from CosmWasm/update-to-0.14.0-beta1
Update to 0.14.0 beta1
2 parents 2ee88aa + 738608d commit 1ee46d1

File tree

95 files changed

+445
-382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+445
-382
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/cw1-subkeys/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ crate-type = ["cdylib", "rlib"]
1414

1515
[features]
1616
backtraces = ["cosmwasm-std/backtraces"]
17-
# use library feature to disable all init/handle/query exports
17+
# use library feature to disable all instantiate/execute/query exports
1818
library = []
1919

2020
[dependencies]
2121
cw0 = { path = "../../packages/cw0", version = "0.5.0" }
2222
cw1 = { path = "../../packages/cw1", version = "0.5.0" }
2323
cw2 = { path = "../../packages/cw2", version = "0.5.0" }
2424
cw1-whitelist = { path = "../cw1-whitelist", version = "0.5.0", features = ["library"] }
25-
cosmwasm-std = { version = "0.14.0-alpha2", features = ["iterator", "staking"] }
25+
cosmwasm-std = { version = "0.14.0-beta1", features = ["iterator", "staking"] }
2626
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.5.0", features = ["iterator"] }
2727
schemars = "0.7"
2828
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
2929
thiserror = { version = "1.0.20" }
3030

3131
[dev-dependencies]
32-
cosmwasm-schema = { version = "0.14.0-alpha2" }
32+
cosmwasm-schema = { version = "0.14.0-beta1" }

contracts/cw1-subkeys/examples/schema.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ use cosmwasm_schema::{export_schema, export_schema_with_title, remove_schemas, s
55

66
use cw1_subkeys::msg::{AllAllowancesResponse, HandleMsg, QueryMsg};
77
use cw1_subkeys::state::Allowance;
8-
use cw1_whitelist::msg::{AdminListResponse, InitMsg};
8+
use cw1_whitelist::msg::{AdminListResponse, InstantiateMsg};
99

1010
fn main() {
1111
let mut out_dir = current_dir().unwrap();
1212
out_dir.push("schema");
1313
create_dir_all(&out_dir).unwrap();
1414
remove_schemas(&out_dir).unwrap();
1515

16-
export_schema(&schema_for!(InitMsg), &out_dir);
16+
export_schema(&schema_for!(InstantiateMsg), &out_dir);
1717
export_schema_with_title(&mut schema_for!(HandleMsg), &out_dir, "HandleMsg");
1818
export_schema_with_title(&mut schema_for!(QueryMsg), &out_dir, "QueryMsg");
1919
export_schema(&schema_for!(Allowance), &out_dir);

contracts/cw1-subkeys/schema/handle_msg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@
507507
"type": "string"
508508
},
509509
"msg": {
510-
"description": "msg is the json-encoded InitMsg struct (as raw Binary)",
510+
"description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)",
511511
"allOf": [
512512
{
513513
"$ref": "#/definitions/Binary"

contracts/cw1-subkeys/schema/init_msg.json renamed to contracts/cw1-subkeys/schema/instantiate_msg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"title": "InitMsg",
3+
"title": "InstantiateMsg",
44
"type": "object",
55
"required": [
66
"admins",

contracts/cw1-subkeys/schema/query_msg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@
430430
"type": "string"
431431
},
432432
"msg": {
433-
"description": "msg is the json-encoded InitMsg struct (as raw Binary)",
433+
"description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)",
434434
"allOf": [
435435
{
436436
"$ref": "#/definitions/Binary"

contracts/cw1-subkeys/src/contract.rs

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ use cosmwasm_std::{
99
use cw0::{maybe_canonical, Expiration};
1010
use cw1::CanExecuteResponse;
1111
use cw1_whitelist::{
12-
contract::{execute_freeze, execute_update_admins, init as whitelist_init, query_admin_list},
13-
msg::InitMsg,
12+
contract::{
13+
execute_freeze, execute_update_admins, instantiate as whitelist_instantiate,
14+
query_admin_list,
15+
},
16+
msg::InstantiateMsg,
1417
state::ADMIN_LIST,
1518
};
1619
use cw2::set_contract_version;
@@ -27,8 +30,13 @@ use cw_storage_plus::Bound;
2730
const CONTRACT_NAME: &str = "crates.io:cw1-subkeys";
2831
const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");
2932

30-
pub fn init(mut deps: DepsMut, env: Env, info: MessageInfo, msg: InitMsg) -> StdResult<Response> {
31-
let result = whitelist_init(deps.branch(), env, info, msg)?;
33+
pub fn instantiate(
34+
mut deps: DepsMut,
35+
env: Env,
36+
info: MessageInfo,
37+
msg: InstantiateMsg,
38+
) -> StdResult<Response> {
39+
let result = whitelist_instantiate(deps.branch(), env, info, msg)?;
3240
set_contract_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;
3341
Ok(result)
3442
}
@@ -419,7 +427,7 @@ mod tests {
419427

420428
use super::*;
421429

422-
// this will set up the init for other tests
430+
// this will set up instantiation for other tests
423431
fn setup_test_case(
424432
mut deps: DepsMut,
425433
info: &MessageInfo,
@@ -428,12 +436,12 @@ mod tests {
428436
allowances: &[Coin],
429437
expirations: &[Expiration],
430438
) {
431-
// Init a contract with admins
432-
let init_msg = InitMsg {
439+
// Instantiate a contract with admins
440+
let instantiate_msg = InstantiateMsg {
433441
admins: admins.to_vec(),
434442
mutable: true,
435443
};
436-
init(deps.branch(), mock_env(), info.clone(), init_msg).unwrap();
444+
instantiate(deps.branch(), mock_env(), info.clone(), instantiate_msg).unwrap();
437445

438446
// Add subkeys with initial allowances
439447
for (spender, expiration) in spenders.iter().zip(expirations) {
@@ -633,12 +641,12 @@ mod tests {
633641
};
634642

635643
let info = mock_info(owner.clone(), &[]);
636-
// Init a contract with admins
637-
let init_msg = InitMsg {
644+
// Instantiate a contract with admins
645+
let instantiate_msg = InstantiateMsg {
638646
admins: admins.clone(),
639647
mutable: true,
640648
};
641-
init(deps.as_mut(), mock_env(), info.clone(), init_msg).unwrap();
649+
instantiate(deps.as_mut(), mock_env(), info.clone(), instantiate_msg).unwrap();
642650

643651
let setup_perm_msg1 = HandleMsg::SetPermissions {
644652
spender: spender1.clone(),
@@ -709,12 +717,12 @@ mod tests {
709717

710718
let info = mock_info(owner, &[]);
711719

712-
// Init a contract with admins
713-
let init_msg = InitMsg {
720+
// Instantiate a contract with admins
721+
let instantiate_msg = InstantiateMsg {
714722
admins: admins.clone(),
715723
mutable: true,
716724
};
717-
init(deps.as_mut(), mock_env(), info.clone(), init_msg).unwrap();
725+
instantiate(deps.as_mut(), mock_env(), info.clone(), instantiate_msg).unwrap();
718726

719727
let setup_perm_msg1 = HandleMsg::SetPermissions {
720728
spender: spender1.clone(),
@@ -1234,12 +1242,12 @@ mod tests {
12341242
};
12351243

12361244
let info = mock_info(owner.clone(), &[]);
1237-
// Init a contract with admins
1238-
let init_msg = InitMsg {
1245+
// Instantiate a contract with admins
1246+
let instantiate_msg = InstantiateMsg {
12391247
admins: admins.clone(),
12401248
mutable: true,
12411249
};
1242-
init(deps.as_mut(), mock_env(), info.clone(), init_msg).unwrap();
1250+
instantiate(deps.as_mut(), mock_env(), info.clone(), instantiate_msg).unwrap();
12431251

12441252
let setup_perm_msg1 = HandleMsg::SetPermissions {
12451253
spender: spender1.clone(),
@@ -1387,12 +1395,12 @@ mod tests {
13871395
};
13881396

13891397
let info = mock_info(owner.clone(), &[]);
1390-
// Init a contract with admins
1391-
let init_msg = InitMsg {
1398+
// Instantiate a contract with admins
1399+
let instantiate_msg = InstantiateMsg {
13921400
admins: admins.clone(),
13931401
mutable: true,
13941402
};
1395-
init(deps.as_mut(), mock_env(), info.clone(), init_msg).unwrap();
1403+
instantiate(deps.as_mut(), mock_env(), info.clone(), instantiate_msg).unwrap();
13961404

13971405
// setup permission and then allowance and check if changed
13981406
let setup_perm_msg = HandleMsg::SetPermissions {

contracts/cw1-whitelist/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ crate-type = ["cdylib", "rlib"]
1414

1515
[features]
1616
backtraces = ["cosmwasm-std/backtraces"]
17-
# use library feature to disable all init/handle/query exports
17+
# use library feature to disable all instantiate/execute/query exports
1818
library = []
1919

2020
[dependencies]
2121
cw0 = { path = "../../packages/cw0", version = "0.5.0" }
2222
cw1 = { path = "../../packages/cw1", version = "0.5.0" }
2323
cw2 = { path = "../../packages/cw2", version = "0.5.0" }
24-
cosmwasm-std = { version = "0.14.0-alpha2", features = ["iterator"] }
24+
cosmwasm-std = { version = "0.14.0-beta1", features = ["iterator"] }
2525
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.5.0", features = ["iterator"] }
2626
schemars = "0.7"
2727
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
2828
thiserror = { version = "1.0.20" }
2929

3030
[dev-dependencies]
31-
cosmwasm-schema = { version = "0.14.0-alpha2" }
31+
cosmwasm-schema = { version = "0.14.0-beta1" }

contracts/cw1-whitelist/examples/schema.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ use std::fs::create_dir_all;
33

44
use cosmwasm_schema::{export_schema, export_schema_with_title, remove_schemas, schema_for};
55

6-
use cw1_whitelist::msg::{AdminListResponse, HandleMsg, InitMsg, QueryMsg};
6+
use cw1_whitelist::msg::{AdminListResponse, HandleMsg, InstantiateMsg, QueryMsg};
77

88
fn main() {
99
let mut out_dir = current_dir().unwrap();
1010
out_dir.push("schema");
1111
create_dir_all(&out_dir).unwrap();
1212
remove_schemas(&out_dir).unwrap();
1313

14-
export_schema(&schema_for!(InitMsg), &out_dir);
14+
export_schema(&schema_for!(InstantiateMsg), &out_dir);
1515
export_schema_with_title(&mut schema_for!(HandleMsg), &out_dir, "HandleMsg");
1616
export_schema_with_title(&mut schema_for!(QueryMsg), &out_dir, "QueryMsg");
1717
export_schema(&schema_for!(AdminListResponse), &out_dir);

contracts/cw1-whitelist/schema/handle_msg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@
348348
"type": "string"
349349
},
350350
"msg": {
351-
"description": "msg is the json-encoded InitMsg struct (as raw Binary)",
351+
"description": "msg is the JSON-encoded InstantiateMsg struct (as raw Binary)",
352352
"allOf": [
353353
{
354354
"$ref": "#/definitions/Binary"

0 commit comments

Comments
 (0)