Skip to content

Commit

Permalink
fix schema
Browse files Browse the repository at this point in the history
  • Loading branch information
quasisamurai committed Feb 14, 2024
1 parent 8714134 commit 496340a
Show file tree
Hide file tree
Showing 11 changed files with 1,028 additions and 1,643 deletions.
2 changes: 1 addition & 1 deletion contracts/vesting-lp-pcl/examples/vesting-lp_schema.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cosmwasm_schema::write_api;
use vesting_base_pcl::msg::{ExecuteMsg, MigrateMsg, QueryMsg};
use vesting_base::msg::{ExecuteMsg, MigrateMsg, QueryMsg};
use vesting_lp_pcl::msg::InstantiateMsg;

fn main() {
Expand Down
67 changes: 65 additions & 2 deletions contracts/vesting-lp-pcl/schema/raw/instantiate.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"required": [
"owner",
"token_info_manager",
"vesting_managers"
"vesting_managers",
"vesting_token",
"xyk_vesting_lp_contract"
],
"properties": {
"owner": {
Expand All @@ -23,7 +25,68 @@
"items": {
"type": "string"
}
},
"vesting_token": {
"$ref": "#/definitions/AssetInfo"
},
"xyk_vesting_lp_contract": {
"type": "string"
}
},
"additionalProperties": false
"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"
},
"AssetInfo": {
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
"oneOf": [
{
"description": "Non-native Token",
"type": "object",
"required": [
"token"
],
"properties": {
"token": {
"type": "object",
"required": [
"contract_addr"
],
"properties": {
"contract_addr": {
"$ref": "#/definitions/Addr"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Native token",
"type": "object",
"required": [
"native_token"
],
"properties": {
"native_token": {
"type": "object",
"required": [
"denom"
],
"properties": {
"denom": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"contract_name": "vesting-lp",
"contract_name": "vesting-lp-pcl",
"contract_version": "1.1.0",
"idl_version": "1.0.0",
"instantiate": {
Expand All @@ -10,7 +10,9 @@
"required": [
"owner",
"token_info_manager",
"vesting_managers"
"vesting_managers",
"vesting_token",
"xyk_vesting_lp_contract"
],
"properties": {
"owner": {
Expand All @@ -27,9 +29,70 @@
"items": {
"type": "string"
}
},
"vesting_token": {
"$ref": "#/definitions/AssetInfo"
},
"xyk_vesting_lp_contract": {
"type": "string"
}
},
"additionalProperties": false
"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"
},
"AssetInfo": {
"description": "This enum describes available Token types. ## Examples ``` # use cosmwasm_std::Addr; # use astroport::asset::AssetInfo::{NativeToken, Token}; Token { contract_addr: Addr::unchecked(\"stake...\") }; NativeToken { denom: String::from(\"uluna\") }; ```",
"oneOf": [
{
"description": "Non-native Token",
"type": "object",
"required": [
"token"
],
"properties": {
"token": {
"type": "object",
"required": [
"contract_addr"
],
"properties": {
"contract_addr": {
"$ref": "#/definitions/Addr"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Native token",
"type": "object",
"required": [
"native_token"
],
"properties": {
"native_token": {
"type": "object",
"required": [
"denom"
],
"properties": {
"denom": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
]
}
}
},
"execute": {
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
3 changes: 0 additions & 3 deletions contracts/vesting-lp-pcl/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
pub mod contract;
pub mod msg;
pub mod state;

#[cfg(test)]
mod tests;
Loading

0 comments on commit 496340a

Please sign in to comment.