Skip to content

Commit

Permalink
Update schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Lacy committed Jan 31, 2025
1 parent cf63847 commit 37fca3d
Show file tree
Hide file tree
Showing 21 changed files with 1,032 additions and 296 deletions.
134 changes: 18 additions & 116 deletions contracts/babylon/schema/babylon-contract.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,19 @@
"null"
]
},
"ics20_channel_id": {
"description": "IBC information for ICS-020 rewards transfer. If not set, distributed rewards will be native to the Consumer",
"type": [
"string",
"null"
]
},
"network": {
"$ref": "#/definitions/Network"
},
"notify_cosmos_zone": {
"description": "notify_cosmos_zone indicates whether to send Cosmos zone messages notifying BTC-finalised headers. NOTE: If set to true, then the Cosmos zone needs to integrate the corresponding message handler as well",
"type": "boolean"
},
"transfer_info": {
"description": "IBC information for ICS-020 rewards transfer. If not set, distributed rewards will be native to the Consumer",
"anyOf": [
{
"$ref": "#/definitions/IbcTransferInfo"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
Expand All @@ -114,22 +110,6 @@
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
"type": "string"
},
"IbcTransferInfo": {
"type": "object",
"required": [
"channel_id",
"recipient"
],
"properties": {
"channel_id": {
"type": "string"
},
"recipient": {
"$ref": "#/definitions/Recipient"
}
},
"additionalProperties": false
},
"Network": {
"type": "string",
"enum": [
Expand All @@ -138,34 +118,6 @@
"signet",
"regtest"
]
},
"Recipient": {
"oneOf": [
{
"type": "object",
"required": [
"contract_addr"
],
"properties": {
"contract_addr": {
"type": "string"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"module_addr"
],
"properties": {
"module_addr": {
"type": "string"
}
},
"additionalProperties": false
}
]
}
}
},
Expand Down Expand Up @@ -221,7 +173,7 @@
"additionalProperties": false
},
{
"description": "`SendRewards` is a message sent by the finality contract, to send rewards to Babylon",
"description": "`SendRewards` is a message sent by the staking contract, to send rewards to the Babylon chain",
"type": "object",
"required": [
"send_rewards"
Expand All @@ -230,15 +182,12 @@
"send_rewards": {
"type": "object",
"required": [
"fp_distribution"
"to_address"
],
"properties": {
"fp_distribution": {
"description": "`fp_distribution` is the list of finality providers and their rewards",
"type": "array",
"items": {
"$ref": "#/definitions/RewardInfo"
}
"to_address": {
"description": "`to_address` is the address on the Babylon chain to send the rewards to",
"type": "string"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -368,26 +317,6 @@
}
},
"additionalProperties": false
},
"RewardInfo": {
"type": "object",
"required": [
"fp_pubkey_hex",
"reward"
],
"properties": {
"fp_pubkey_hex": {
"type": "string"
},
"reward": {
"$ref": "#/definitions/Uint128"
}
},
"additionalProperties": false
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
}
}
},
Expand Down Expand Up @@ -636,7 +565,7 @@
"additionalProperties": false
},
{
"description": "TransferInfo returns the IBC transfer information stored in the contract for ICS-020 rewards transfer. If not set, distributed rewards are native to the Consumer",
"description": "TransferInfo returns the IBC transfer information stored in the contract for ICS-020 rewards transfer.",
"type": "object",
"required": [
"transfer_info"
Expand Down Expand Up @@ -1644,38 +1573,11 @@
},
"transfer_info": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Nullable_TransferInfo",
"anyOf": [
{
"$ref": "#/definitions/TransferInfo"
},
{
"type": "null"
}
],
"definitions": {
"TransferInfo": {
"description": "IBC transfer (ICS-020) channel settings",
"type": "object",
"required": [
"address_type",
"channel_id",
"to_address"
],
"properties": {
"address_type": {
"type": "string"
},
"channel_id": {
"type": "string"
},
"to_address": {
"type": "string"
}
},
"additionalProperties": false
}
}
"title": "Nullable_String",
"type": [
"string",
"null"
]
}
}
}
33 changes: 5 additions & 28 deletions contracts/babylon/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"additionalProperties": false
},
{
"description": "`SendRewards` is a message sent by the finality contract, to send rewards to Babylon",
"description": "`SendRewards` is a message sent by the staking contract, to send rewards to the Babylon chain",
"type": "object",
"required": [
"send_rewards"
Expand All @@ -59,15 +59,12 @@
"send_rewards": {
"type": "object",
"required": [
"fp_distribution"
"to_address"
],
"properties": {
"fp_distribution": {
"description": "`fp_distribution` is the list of finality providers and their rewards",
"type": "array",
"items": {
"$ref": "#/definitions/RewardInfo"
}
"to_address": {
"description": "`to_address` is the address on the Babylon chain to send the rewards to",
"type": "string"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -197,26 +194,6 @@
}
},
"additionalProperties": false
},
"RewardInfo": {
"type": "object",
"required": [
"fp_pubkey_hex",
"reward"
],
"properties": {
"fp_pubkey_hex": {
"type": "string"
},
"reward": {
"$ref": "#/definitions/Uint128"
}
},
"additionalProperties": false
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
}
}
}
62 changes: 7 additions & 55 deletions contracts/babylon/schema/raw/instantiate.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,19 @@
"null"
]
},
"ics20_channel_id": {
"description": "IBC information for ICS-020 rewards transfer. If not set, distributed rewards will be native to the Consumer",
"type": [
"string",
"null"
]
},
"network": {
"$ref": "#/definitions/Network"
},
"notify_cosmos_zone": {
"description": "notify_cosmos_zone indicates whether to send Cosmos zone messages notifying BTC-finalised headers. NOTE: If set to true, then the Cosmos zone needs to integrate the corresponding message handler as well",
"type": "boolean"
},
"transfer_info": {
"description": "IBC information for ICS-020 rewards transfer. If not set, distributed rewards will be native to the Consumer",
"anyOf": [
{
"$ref": "#/definitions/IbcTransferInfo"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
Expand All @@ -110,22 +106,6 @@
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>. See also <https://github.com/CosmWasm/cosmwasm/blob/main/docs/MESSAGE_TYPES.md>.",
"type": "string"
},
"IbcTransferInfo": {
"type": "object",
"required": [
"channel_id",
"recipient"
],
"properties": {
"channel_id": {
"type": "string"
},
"recipient": {
"$ref": "#/definitions/Recipient"
}
},
"additionalProperties": false
},
"Network": {
"type": "string",
"enum": [
Expand All @@ -134,34 +114,6 @@
"signet",
"regtest"
]
},
"Recipient": {
"oneOf": [
{
"type": "object",
"required": [
"contract_addr"
],
"properties": {
"contract_addr": {
"type": "string"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"module_addr"
],
"properties": {
"module_addr": {
"type": "string"
}
},
"additionalProperties": false
}
]
}
}
}
2 changes: 1 addition & 1 deletion contracts/babylon/schema/raw/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"additionalProperties": false
},
{
"description": "TransferInfo returns the IBC transfer information stored in the contract for ICS-020 rewards transfer. If not set, distributed rewards are native to the Consumer",
"description": "TransferInfo returns the IBC transfer information stored in the contract for ICS-020 rewards transfer.",
"type": "object",
"required": [
"transfer_info"
Expand Down
37 changes: 5 additions & 32 deletions contracts/babylon/schema/raw/response_to_transfer_info.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,8 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Nullable_TransferInfo",
"anyOf": [
{
"$ref": "#/definitions/TransferInfo"
},
{
"type": "null"
}
],
"definitions": {
"TransferInfo": {
"description": "IBC transfer (ICS-020) channel settings",
"type": "object",
"required": [
"address_type",
"channel_id",
"to_address"
],
"properties": {
"address_type": {
"type": "string"
},
"channel_id": {
"type": "string"
},
"to_address": {
"type": "string"
}
},
"additionalProperties": false
}
}
"title": "Nullable_String",
"type": [
"string",
"null"
]
}
Loading

0 comments on commit 37fca3d

Please sign in to comment.