Skip to content

Commit

Permalink
fix: execute cargo clippy and cargo schema
Browse files Browse the repository at this point in the history
  • Loading branch information
loloicci committed Feb 9, 2024
1 parent f4e503e commit 7defcca
Show file tree
Hide file tree
Showing 33 changed files with 983 additions and 82 deletions.
2 changes: 1 addition & 1 deletion contracts/burner/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ mod tests {
let res = migrate(deps.as_mut(), mock_env(), msg).unwrap();
// check payout
assert_eq!(1, res.messages.len());
let msg = res.messages.get(0).expect("no message");
let msg = res.messages.first().expect("no message");
assert_eq!(
msg,
&SubMsg::new(BankMsg::Send {
Expand Down
164 changes: 164 additions & 0 deletions contracts/call-number/schema/raw/execute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ExecuteMsg",
"oneOf": [
{
"type": "object",
"required": [
"add"
],
"properties": {
"add": {
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"sub"
],
"properties": {
"sub": {
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"mul"
],
"properties": {
"mul": {
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"submsg_reply_add"
],
"properties": {
"submsg_reply_add": {
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"submsg_reply_sub"
],
"properties": {
"submsg_reply_sub": {
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"submsg_reply_mul"
],
"properties": {
"submsg_reply_mul": {
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"log_query"
],
"properties": {
"log_query": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"log_query_dyn"
],
"properties": {
"log_query_dyn": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
}
]
}
20 changes: 20 additions & 0 deletions contracts/call-number/schema/raw/instantiate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "InstantiateMsg",
"type": "object",
"required": [
"callee_addr"
],
"properties": {
"callee_addr": {
"$ref": "#/definitions/Addr"
}
},
"additionalProperties": false,
"definitions": {
"Addr": {
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
"type": "string"
}
}
}
98 changes: 98 additions & 0 deletions contracts/call-number/schema/raw/query.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "QueryMsg",
"oneOf": [
{
"type": "object",
"required": [
"add"
],
"properties": {
"add": {
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"sub"
],
"properties": {
"sub": {
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"mul"
],
"properties": {
"mul": {
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"number_dyn"
],
"properties": {
"number_dyn": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"number"
],
"properties": {
"number": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
}
]
}
15 changes: 15 additions & 0 deletions contracts/call-number/schema/raw/response_to_add.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NumberResponse",
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
15 changes: 15 additions & 0 deletions contracts/call-number/schema/raw/response_to_mul.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NumberResponse",
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
15 changes: 15 additions & 0 deletions contracts/call-number/schema/raw/response_to_number.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NumberResponse",
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
15 changes: 15 additions & 0 deletions contracts/call-number/schema/raw/response_to_number_dyn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NumberResponse",
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
15 changes: 15 additions & 0 deletions contracts/call-number/schema/raw/response_to_sub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NumberResponse",
"type": "object",
"required": [
"value"
],
"properties": {
"value": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
}
Loading

0 comments on commit 7defcca

Please sign in to comment.