Skip to content

Commit

Permalink
Adjust whitelist to whitelist addresses (#59)
Browse files Browse the repository at this point in the history
* Reword whitelist

* Expand test for whitelist

* Fix indexing

* Remove reference to appease clippy
  • Loading branch information
p-offtermatt authored Aug 12, 2024
1 parent 4830b0a commit d4c4a7c
Show file tree
Hide file tree
Showing 13 changed files with 181 additions and 328 deletions.
44 changes: 10 additions & 34 deletions contracts/hydro/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,11 @@
"create_proposal": {
"type": "object",
"required": [
"covenant_params",
"description",
"title",
"tranche_id"
],
"properties": {
"covenant_params": {
"$ref": "#/definitions/CovenantParams"
},
"description": {
"type": "string"
},
Expand Down Expand Up @@ -134,17 +130,17 @@
{
"type": "object",
"required": [
"add_to_whitelist"
"add_account_to_whitelist"
],
"properties": {
"add_to_whitelist": {
"add_account_to_whitelist": {
"type": "object",
"required": [
"covenant_params"
"address"
],
"properties": {
"covenant_params": {
"$ref": "#/definitions/CovenantParams"
"address": {
"type": "string"
}
},
"additionalProperties": false
Expand All @@ -155,17 +151,17 @@
{
"type": "object",
"required": [
"remove_from_whitelist"
"remove_account_from_whitelist"
],
"properties": {
"remove_from_whitelist": {
"remove_account_from_whitelist": {
"type": "object",
"required": [
"covenant_params"
"address"
],
"properties": {
"covenant_params": {
"$ref": "#/definitions/CovenantParams"
"address": {
"type": "string"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -267,26 +263,6 @@
}
],
"definitions": {
"CovenantParams": {
"type": "object",
"required": [
"funding_destination_name",
"outgoing_channel_id",
"pool_id"
],
"properties": {
"funding_destination_name": {
"type": "string"
},
"outgoing_channel_id": {
"type": "string"
},
"pool_id": {
"type": "string"
}
},
"additionalProperties": false
},
"TrancheInfo": {
"type": "object",
"required": [
Expand Down
22 changes: 1 addition & 21 deletions contracts/hydro/schema/instantiate_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"initial_whitelist": {
"type": "array",
"items": {
"$ref": "#/definitions/CovenantParams"
"type": "string"
}
},
"lock_epoch_length": {
Expand Down Expand Up @@ -55,26 +55,6 @@
},
"additionalProperties": false,
"definitions": {
"CovenantParams": {
"type": "object",
"required": [
"funding_destination_name",
"outgoing_channel_id",
"pool_id"
],
"properties": {
"funding_destination_name": {
"type": "string"
},
"outgoing_channel_id": {
"type": "string"
},
"pool_id": {
"type": "string"
}
},
"additionalProperties": false
},
"Timestamp": {
"description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```",
"allOf": [
Expand Down
24 changes: 0 additions & 24 deletions contracts/hydro/schema/proposal_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,9 @@
},
"additionalProperties": false,
"definitions": {
"CovenantParams": {
"type": "object",
"required": [
"funding_destination_name",
"outgoing_channel_id",
"pool_id"
],
"properties": {
"funding_destination_name": {
"type": "string"
},
"outgoing_channel_id": {
"type": "string"
},
"pool_id": {
"type": "string"
}
},
"additionalProperties": false
},
"Proposal": {
"type": "object",
"required": [
"covenant_params",
"description",
"percentage",
"power",
Expand All @@ -45,9 +24,6 @@
"tranche_id"
],
"properties": {
"covenant_params": {
"$ref": "#/definitions/CovenantParams"
},
"description": {
"type": "string"
},
Expand Down
24 changes: 0 additions & 24 deletions contracts/hydro/schema/round_proposals_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,9 @@
},
"additionalProperties": false,
"definitions": {
"CovenantParams": {
"type": "object",
"required": [
"funding_destination_name",
"outgoing_channel_id",
"pool_id"
],
"properties": {
"funding_destination_name": {
"type": "string"
},
"outgoing_channel_id": {
"type": "string"
},
"pool_id": {
"type": "string"
}
},
"additionalProperties": false
},
"Proposal": {
"type": "object",
"required": [
"covenant_params",
"description",
"percentage",
"power",
Expand All @@ -48,9 +27,6 @@
"tranche_id"
],
"properties": {
"covenant_params": {
"$ref": "#/definitions/CovenantParams"
},
"description": {
"type": "string"
},
Expand Down
24 changes: 0 additions & 24 deletions contracts/hydro/schema/top_n_proposals_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,9 @@
},
"additionalProperties": false,
"definitions": {
"CovenantParams": {
"type": "object",
"required": [
"funding_destination_name",
"outgoing_channel_id",
"pool_id"
],
"properties": {
"funding_destination_name": {
"type": "string"
},
"outgoing_channel_id": {
"type": "string"
},
"pool_id": {
"type": "string"
}
},
"additionalProperties": false
},
"Proposal": {
"type": "object",
"required": [
"covenant_params",
"description",
"percentage",
"power",
Expand All @@ -48,9 +27,6 @@
"tranche_id"
],
"properties": {
"covenant_params": {
"$ref": "#/definitions/CovenantParams"
},
"description": {
"type": "string"
},
Expand Down
24 changes: 4 additions & 20 deletions contracts/hydro/schema/whitelist_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,15 @@
"whitelist": {
"type": "array",
"items": {
"$ref": "#/definitions/CovenantParams"
"$ref": "#/definitions/Addr"
}
}
},
"additionalProperties": false,
"definitions": {
"CovenantParams": {
"type": "object",
"required": [
"funding_destination_name",
"outgoing_channel_id",
"pool_id"
],
"properties": {
"funding_destination_name": {
"type": "string"
},
"outgoing_channel_id": {
"type": "string"
},
"pool_id": {
"type": "string"
}
},
"additionalProperties": false
"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"
}
}
}
Loading

0 comments on commit d4c4a7c

Please sign in to comment.