Skip to content

Commit f54a8f9

Browse files
authored
Merge pull request #577 from axone-protocol/refactor/rationalize-empty-msg-api
2 parents 1eb8c8c + 8a559af commit f54a8f9

File tree

7 files changed

+46
-27
lines changed

7 files changed

+46
-27
lines changed

.releaserc.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ branches:
44
plugins:
55
- - "@semantic-release/commit-analyzer"
66
- preset: conventionalcommits
7+
releaseRules:
8+
- type: build
9+
scope: deps
10+
release: patch
11+
- type: build
12+
scope: deps-dev
13+
release: patch
14+
- type: refactor
15+
release: patch
16+
- type: style
17+
release: patch
18+
- type: ci
19+
release: patch
20+
- type: chore
21+
release: patch
22+
- type: docs
23+
release: patch
24+
- breaking: true
25+
release: major
726
- - "@semantic-release/release-notes-generator"
827
- preset: conventionalcommits
928
- - "@semantic-release/changelog"

contracts/axone-cognitarium/src/contract.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub mod execute {
159159
#[cfg_attr(not(feature = "library"), entry_point)]
160160
pub fn query(deps: Deps<'_>, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
161161
match msg {
162-
QueryMsg::Store => to_json_binary(&query::store(deps)?),
162+
QueryMsg::Store {} => to_json_binary(&query::store(deps)?),
163163
QueryMsg::Select { query } => to_json_binary(&query::select(deps, query)?),
164164
QueryMsg::Describe { query, format } => {
165165
to_json_binary(&query::describe(deps, query, format.unwrap_or_default())?)
@@ -1249,7 +1249,7 @@ mod tests {
12491249
)
12501250
.unwrap();
12511251

1252-
let res = query(deps.as_ref(), mock_env(), QueryMsg::Store);
1252+
let res = query(deps.as_ref(), mock_env(), QueryMsg::Store {});
12531253
assert!(res.is_ok());
12541254
assert_eq!(
12551255
from_json::<StoreResponse>(&res.unwrap()).unwrap(),

contracts/axone-cognitarium/src/msg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub enum QueryMsg {
8585
///
8686
/// Returns information about the triple store.
8787
#[returns(StoreResponse)]
88-
Store,
88+
Store {},
8989

9090
/// # Select
9191
///

contracts/axone-law-stone/src/contract.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn execute(
6161
) -> Result<Response, ContractError> {
6262
nonpayable(&info)?;
6363
match msg {
64-
ExecuteMsg::BreakStone => execute::break_stone(deps, env, info),
64+
ExecuteMsg::BreakStone {} => execute::break_stone(deps, env, info),
6565
}
6666
}
6767

@@ -125,8 +125,8 @@ pub mod execute {
125125
pub fn query(deps: Deps<'_, LogicCustomQuery>, env: Env, msg: QueryMsg) -> StdResult<Binary> {
126126
match msg {
127127
QueryMsg::Ask { query } => to_json_binary(&query::ask(deps, env, query)?),
128-
QueryMsg::Program => to_json_binary(&query::program(deps)?),
129-
QueryMsg::ProgramCode => to_json_binary(&query::program_code(deps)?),
128+
QueryMsg::Program {} => to_json_binary(&query::program(deps)?),
129+
QueryMsg::ProgramCode {} => to_json_binary(&query::program_code(deps)?),
130130
}
131131
}
132132

@@ -886,7 +886,7 @@ mod tests {
886886
deps.as_mut(),
887887
env.clone(),
888888
info.clone(),
889-
ExecuteMsg::BreakStone,
889+
ExecuteMsg::BreakStone {},
890890
);
891891
assert!(result.is_err());
892892
assert_eq!(
@@ -979,7 +979,7 @@ mod tests {
979979
deps.as_mut(),
980980
mock_env(),
981981
info.clone(),
982-
ExecuteMsg::BreakStone,
982+
ExecuteMsg::BreakStone {},
983983
)
984984
.unwrap();
985985

@@ -1089,7 +1089,7 @@ mod tests {
10891089
deps.as_mut(),
10901090
mock_env(),
10911091
mock_info(case.0, &[]),
1092-
ExecuteMsg::BreakStone,
1092+
ExecuteMsg::BreakStone {},
10931093
);
10941094

10951095
match case.3 {
@@ -1141,7 +1141,7 @@ mod tests {
11411141
deps.as_mut(),
11421142
mock_env(),
11431143
mock_info("creator", &[]),
1144-
ExecuteMsg::BreakStone,
1144+
ExecuteMsg::BreakStone {},
11451145
);
11461146
assert!(res.is_ok());
11471147
assert_eq!(res.ok().unwrap().messages.len(), 0);

contracts/axone-law-stone/src/msg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub enum ExecuteMsg {
2222
/// - Forget the main program (i.e. or at least unpin it).
2323
/// Only the contract admin is authorized to break it, if any.
2424
/// If already broken, this is a no-op.
25-
BreakStone,
25+
BreakStone {},
2626
}
2727

2828
/// Query messages
@@ -44,15 +44,15 @@ pub enum QueryMsg {
4444
/// This includes the contract address of the `objectarium` and the program object ID,
4545
/// where the law program's code can be accessed.
4646
#[returns(ProgramResponse)]
47-
Program,
47+
Program {},
4848

4949
/// # ProgramCode
5050
/// Fetches the raw code of the law program tied to this contract.
5151
///
5252
/// If the law stone is broken, the query may fail if the program is no longer available in the
5353
/// `Objectarium`.
5454
#[returns(Binary)]
55-
ProgramCode,
55+
ProgramCode {},
5656
}
5757

5858
/// # ProgramResponse

docs/axone-cognitarium.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,9 @@ Query messages
430430

431431
Returns information about the triple store.
432432

433-
| literal |
434-
| --------- |
435-
| `"store"` |
433+
| parameter | description |
434+
| --------- | -------------------------- |
435+
| `store` | _(Required.) _ **object**. |
436436

437437
### QueryMsg::Select
438438

@@ -876,4 +876,4 @@ Represents a condition in a [WhereClause].
876876

877877
---
878878

879-
_Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `axone-cognitarium.json` (`ddcfdef446357b86`)_
879+
_Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `axone-cognitarium.json` (`72125c91d0c7acd2`)_

docs/axone-law-stone.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ Execute messages
3131

3232
Break the stone making this contract unusable, by clearing all the related resources: - Unpin all the pinned objects on `axone-objectarium` contracts, if any. - Forget the main program (i.e. or at least unpin it). Only the contract admin is authorized to break it, if any. If already broken, this is a no-op.
3333

34-
| literal |
35-
| --------------- |
36-
| `"break_stone"` |
34+
| parameter | description |
35+
| ------------- | -------------------------- |
36+
| `break_stone` | _(Required.) _ **object**. |
3737

3838
## QueryMsg
3939

@@ -56,19 +56,19 @@ Retrieves the location metadata of the law program bound to this contract.
5656

5757
This includes the contract address of the `objectarium` and the program object ID, where the law program's code can be accessed.
5858

59-
| literal |
60-
| ----------- |
61-
| `"program"` |
59+
| parameter | description |
60+
| --------- | -------------------------- |
61+
| `program` | _(Required.) _ **object**. |
6262

6363
### QueryMsg::ProgramCode
6464

6565
Fetches the raw code of the law program tied to this contract.
6666

6767
If the law stone is broken, the query may fail if the program is no longer available in the `Objectarium`.
6868

69-
| literal |
70-
| ---------------- |
71-
| `"program_code"` |
69+
| parameter | description |
70+
| -------------- | -------------------------- |
71+
| `program_code` | _(Required.) _ **object**. |
7272

7373
## Responses
7474

@@ -134,4 +134,4 @@ A string containing Base64-encoded data.
134134

135135
---
136136

137-
_Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `axone-law-stone.json` (`96a9a3b253c6a3fc`)_
137+
_Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `axone-law-stone.json` (`a0a965a7234a8b34`)_

0 commit comments

Comments
 (0)