Skip to content

Commit

Permalink
Add ICQ funds manager handling (#107)
Browse files Browse the repository at this point in the history
* Add draft of ICQ funds manager handling

* Fix instantiate message to include icq managers

* Fix test message assertion

* Add query for contract managers

* Add testcase for icq manager list

* Remove unused imports

* Check for is_some only and add sender to attributes

* Reuse validate_icq_manager more

* Simplify filter_map matching

* Fix clippy

* Handle initial manager list setup correctly

* Regenerate schema

* Fix test by removing address from icq managers

* Recompile
  • Loading branch information
p-offtermatt authored Sep 17, 2024
1 parent da964a3 commit 1ff392b
Show file tree
Hide file tree
Showing 14 changed files with 508 additions and 21 deletions.
4 changes: 2 additions & 2 deletions artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
c1b1dd099f55746e72dfe541d92cf09c480abb67ffbdf711a56cffb37c0a3f30 hydro.wasm
0320254a30298260030dda411339b131f570003f4adf7db566df865d2797f2e2 tribute.wasm
4ad15ff8b752847e4be69a002ab5a0edba947fcb54963826d6de0bdadf72f7bf hydro.wasm
09b09f9fad3ce0af3bee15a6497e0c562de69f4ec8dfd55a8b60b851d3cc590c tribute.wasm
Binary file modified artifacts/hydro.wasm
Binary file not shown.
Binary file modified artifacts/tribute.wasm
Binary file not shown.
67 changes: 67 additions & 0 deletions contracts/hydro/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,69 @@
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"add_i_c_q_manager"
],
"properties": {
"add_i_c_q_manager": {
"type": "object",
"required": [
"address"
],
"properties": {
"address": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"remove_i_c_q_manager"
],
"properties": {
"remove_i_c_q_manager": {
"type": "object",
"required": [
"address"
],
"properties": {
"address": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"withdraw_i_c_q_funds"
],
"properties": {
"withdraw_i_c_q_funds": {
"type": "object",
"required": [
"amount"
],
"properties": {
"amount": {
"$ref": "#/definitions/Uint128"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
],
"definitions": {
Expand All @@ -302,6 +365,10 @@
}
},
"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"
}
}
}
87 changes: 87 additions & 0 deletions contracts/hydro/schema/hydro_full_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"first_round_start",
"hub_connection_id",
"hub_transfer_channel_id",
"icq_managers",
"icq_update_period",
"initial_whitelist",
"lock_epoch_length",
Expand All @@ -26,6 +27,12 @@
"hub_transfer_channel_id": {
"type": "string"
},
"icq_managers": {
"type": "array",
"items": {
"type": "string"
}
},
"icq_update_period": {
"type": "integer",
"format": "uint64",
Expand Down Expand Up @@ -390,6 +397,69 @@
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"add_i_c_q_manager"
],
"properties": {
"add_i_c_q_manager": {
"type": "object",
"required": [
"address"
],
"properties": {
"address": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"remove_i_c_q_manager"
],
"properties": {
"remove_i_c_q_manager": {
"type": "object",
"required": [
"address"
],
"properties": {
"address": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"withdraw_i_c_q_funds"
],
"properties": {
"withdraw_i_c_q_funds": {
"type": "object",
"required": [
"amount"
],
"properties": {
"amount": {
"$ref": "#/definitions/Uint128"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
],
"definitions": {
Expand All @@ -408,6 +478,10 @@
}
},
"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 @@ -757,6 +831,19 @@
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"i_c_q_managers"
],
"properties": {
"i_c_q_managers": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
Expand Down
7 changes: 7 additions & 0 deletions contracts/hydro/schema/instantiate_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"first_round_start",
"hub_connection_id",
"hub_transfer_channel_id",
"icq_managers",
"icq_update_period",
"initial_whitelist",
"lock_epoch_length",
Expand All @@ -25,6 +26,12 @@
"hub_transfer_channel_id": {
"type": "string"
},
"icq_managers": {
"type": "array",
"items": {
"type": "string"
}
},
"icq_update_period": {
"type": "integer",
"format": "uint64",
Expand Down
13 changes: 13 additions & 0 deletions contracts/hydro/schema/query_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,19 @@
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"i_c_q_managers"
],
"properties": {
"i_c_q_managers": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
Expand Down
Loading

0 comments on commit 1ff392b

Please sign in to comment.