Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port #208 and #210 to main #215

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/208-add-per-tranche-info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add an extra query for lockups that includes information about when lockups can vote again.
([\#208](https://github.com/informalsystems/hydro/pull/208))
4 changes: 2 additions & 2 deletions artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
7484fa071c23b28d098783485ba478e364c72d2c22ca32fd8a441eca87a10855 hydro.wasm
0841521ae53a4370c19cd0f272e876fc0b943a70778706c935f99cd1513c3907 tribute.wasm
271cdf6a7ab3a331489f0f65303d8622150fe8bdd1e038374904963a8d1f4760 hydro.wasm
48b02ce4eff5854c96cab81c60fd8ab510620b43f594bb1607841fb6c092e2e0 tribute.wasm
Binary file modified artifacts/hydro.wasm
Binary file not shown.
Binary file modified artifacts/tribute.wasm
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "AllUserLockupsWithTrancheInfosResponse",
"type": "object",
"required": [
"lockups_with_per_tranche_infos"
],
"properties": {
"lockups_with_per_tranche_infos": {
"type": "array",
"items": {
"$ref": "#/definitions/LockupWithPerTrancheInfo"
}
}
},
"additionalProperties": false,
"definitions": {
"Coin": {
"type": "object",
"required": [
"amount",
"denom"
],
"properties": {
"amount": {
"$ref": "#/definitions/Uint128"
},
"denom": {
"type": "string"
}
},
"additionalProperties": false
},
"LockEntry": {
"type": "object",
"required": [
"funds",
"lock_end",
"lock_id",
"lock_start"
],
"properties": {
"funds": {
"$ref": "#/definitions/Coin"
},
"lock_end": {
"$ref": "#/definitions/Timestamp"
},
"lock_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"lock_start": {
"$ref": "#/definitions/Timestamp"
}
},
"additionalProperties": false
},
"LockEntryWithPower": {
"type": "object",
"required": [
"current_voting_power",
"lock_entry"
],
"properties": {
"current_voting_power": {
"$ref": "#/definitions/Uint128"
},
"lock_entry": {
"$ref": "#/definitions/LockEntry"
}
},
"additionalProperties": false
},
"LockupWithPerTrancheInfo": {
"type": "object",
"required": [
"lock_with_power",
"per_tranche_info"
],
"properties": {
"lock_with_power": {
"$ref": "#/definitions/LockEntryWithPower"
},
"per_tranche_info": {
"type": "array",
"items": {
"$ref": "#/definitions/PerTrancheLockupInfo"
}
}
},
"additionalProperties": false
},
"PerTrancheLockupInfo": {
"type": "object",
"required": [
"next_round_lockup_can_vote",
"tranche_id"
],
"properties": {
"current_voted_on_proposal": {
"type": [
"integer",
"null"
],
"format": "uint64",
"minimum": 0.0
},
"next_round_lockup_can_vote": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"tranche_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
"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": [
{
"$ref": "#/definitions/Uint64"
}
]
},
"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"
},
"Uint64": {
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 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 `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
"type": "string"
}
}
}
173 changes: 173 additions & 0 deletions contracts/hydro/schema/hydro_full_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,39 @@
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"all_user_lockups_with_tranche_infos"
],
"properties": {
"all_user_lockups_with_tranche_infos": {
"type": "object",
"required": [
"address",
"limit",
"start_from"
],
"properties": {
"address": {
"type": "string"
},
"limit": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"start_from": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
Expand Down Expand Up @@ -2009,6 +2042,146 @@
}
}
},
"all_user_lockups_with_tranche_infos": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "AllUserLockupsWithTrancheInfosResponse",
"type": "object",
"required": [
"lockups_with_per_tranche_infos"
],
"properties": {
"lockups_with_per_tranche_infos": {
"type": "array",
"items": {
"$ref": "#/definitions/LockupWithPerTrancheInfo"
}
}
},
"additionalProperties": false,
"definitions": {
"Coin": {
"type": "object",
"required": [
"amount",
"denom"
],
"properties": {
"amount": {
"$ref": "#/definitions/Uint128"
},
"denom": {
"type": "string"
}
},
"additionalProperties": false
},
"LockEntry": {
"type": "object",
"required": [
"funds",
"lock_end",
"lock_id",
"lock_start"
],
"properties": {
"funds": {
"$ref": "#/definitions/Coin"
},
"lock_end": {
"$ref": "#/definitions/Timestamp"
},
"lock_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"lock_start": {
"$ref": "#/definitions/Timestamp"
}
},
"additionalProperties": false
},
"LockEntryWithPower": {
"type": "object",
"required": [
"current_voting_power",
"lock_entry"
],
"properties": {
"current_voting_power": {
"$ref": "#/definitions/Uint128"
},
"lock_entry": {
"$ref": "#/definitions/LockEntry"
}
},
"additionalProperties": false
},
"LockupWithPerTrancheInfo": {
"type": "object",
"required": [
"lock_with_power",
"per_tranche_info"
],
"properties": {
"lock_with_power": {
"$ref": "#/definitions/LockEntryWithPower"
},
"per_tranche_info": {
"type": "array",
"items": {
"$ref": "#/definitions/PerTrancheLockupInfo"
}
}
},
"additionalProperties": false
},
"PerTrancheLockupInfo": {
"type": "object",
"required": [
"next_round_lockup_can_vote",
"tranche_id"
],
"properties": {
"current_voted_on_proposal": {
"type": [
"integer",
"null"
],
"format": "uint64",
"minimum": 0.0
},
"next_round_lockup_can_vote": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"tranche_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
"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": [
{
"$ref": "#/definitions/Uint64"
}
]
},
"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"
},
"Uint64": {
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 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 `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
"type": "string"
}
}
},
"whitelist_admins": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "WhitelistAdminsResponse",
Expand Down
33 changes: 33 additions & 0 deletions contracts/hydro/schema/query_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,39 @@
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"all_user_lockups_with_tranche_infos"
],
"properties": {
"all_user_lockups_with_tranche_infos": {
"type": "object",
"required": [
"address",
"limit",
"start_from"
],
"properties": {
"address": {
"type": "string"
},
"limit": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"start_from": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
Expand Down
Loading
Loading