Skip to content

Commit

Permalink
refactor: rename bonding-manager.epochs to reward buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
kerber0x committed May 9, 2024
1 parent efb05a4 commit e61863f
Show file tree
Hide file tree
Showing 13 changed files with 231 additions and 225 deletions.
106 changes: 53 additions & 53 deletions contracts/liquidity_hub/bonding-manager/schema/bonding-manager.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"type": "string"
},
"grace_period": {
"description": "Grace period the maximum age of a epoch bucket before it's considered expired and fees are forwarded from it",
"description": "Grace period the maximum age of a reward bucket before it's considered expired and fees are forwarded from it",
"type": "integer",
"format": "uint64",
"minimum": 0.0
Expand Down Expand Up @@ -185,7 +185,7 @@
]
},
{
"description": "Creates a new bucket for the rewards flowing from this time on, i.e. to be distributed in the upcoming epoch. Also, forwards the expiring epoch (only 21 epochs are live at a given moment)",
"description": "Epoch Changed hook implementation. Creates a new reward bucket for the rewards flowing from this time on, i.e. to be distributed in the upcoming epoch. Also, forwards the expiring reward bucket (only 21 of them are live at a given moment)",
"type": "object",
"required": [
"epoch_changed_hook"
Expand Down Expand Up @@ -538,7 +538,7 @@
]
},
{
"description": "Returns the [Epoch]s that can be claimed by an address.",
"description": "Returns the [RewardBucket]s that can be claimed by an address.",
"type": "object",
"required": [
"claimable"
Expand All @@ -548,7 +548,7 @@
"type": "object",
"properties": {
"address": {
"description": "The address to check for claimable epochs. If none is provided, all possible epochs stored in the contract that can potentially be claimed are returned.",
"description": "The address to check for claimable reward buckets. If none is provided, all possible reward buckets stored in the contract that can potentially be claimed are returned.",
"type": [
"string",
"null"
Expand Down Expand Up @@ -706,17 +706,17 @@
},
"claimable": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ClaimableEpochsResponse",
"title": "ClaimableRewardBucketsResponse",
"type": "object",
"required": [
"epochs"
"reward_buckets"
],
"properties": {
"epochs": {
"description": "The epochs that can be claimed by the address.",
"reward_buckets": {
"description": "The reward buckets that can be claimed by the address.",
"type": "array",
"items": {
"$ref": "#/definitions/Epoch"
"$ref": "#/definitions/RewardBucket"
}
}
},
Expand All @@ -737,49 +737,6 @@
}
}
},
"Epoch": {
"type": "object",
"required": [
"available",
"claimed",
"global_index",
"id",
"start_time",
"total"
],
"properties": {
"available": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
},
"claimed": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
},
"global_index": {
"$ref": "#/definitions/GlobalIndex"
},
"id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"start_time": {
"$ref": "#/definitions/Timestamp"
},
"total": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
}
},
"additionalProperties": false
},
"GlobalIndex": {
"type": "object",
"required": [
Expand Down Expand Up @@ -821,6 +778,49 @@
},
"additionalProperties": false
},
"RewardBucket": {
"type": "object",
"required": [
"available",
"claimed",
"epoch_id",
"epoch_start_time",
"global_index",
"total"
],
"properties": {
"available": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
},
"claimed": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
},
"epoch_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"epoch_start_time": {
"$ref": "#/definitions/Timestamp"
},
"global_index": {
"$ref": "#/definitions/GlobalIndex"
},
"total": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
}
},
"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 Expand Up @@ -873,7 +873,7 @@
]
},
"grace_period": {
"description": "Grace period the maximum age of a epoch bucket before it's considered expired and fees are forwarded from it",
"description": "Grace period the maximum age of a reward bucket before it's considered expired and fees are forwarded from it",
"type": "integer",
"format": "uint64",
"minimum": 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
]
},
{
"description": "Creates a new bucket for the rewards flowing from this time on, i.e. to be distributed in the upcoming epoch. Also, forwards the expiring epoch (only 21 epochs are live at a given moment)",
"description": "Epoch Changed hook implementation. Creates a new reward bucket for the rewards flowing from this time on, i.e. to be distributed in the upcoming epoch. Also, forwards the expiring reward bucket (only 21 of them are live at a given moment)",
"type": "object",
"required": [
"epoch_changed_hook"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"type": "string"
},
"grace_period": {
"description": "Grace period the maximum age of a epoch bucket before it's considered expired and fees are forwarded from it",
"description": "Grace period the maximum age of a reward bucket before it's considered expired and fees are forwarded from it",
"type": "integer",
"format": "uint64",
"minimum": 0.0
Expand Down
4 changes: 2 additions & 2 deletions contracts/liquidity_hub/bonding-manager/schema/raw/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
]
},
{
"description": "Returns the [Epoch]s that can be claimed by an address.",
"description": "Returns the [RewardBucket]s that can be claimed by an address.",
"type": "object",
"required": [
"claimable"
Expand All @@ -167,7 +167,7 @@
"type": "object",
"properties": {
"address": {
"description": "The address to check for claimable epochs. If none is provided, all possible epochs stored in the contract that can potentially be claimed are returned.",
"description": "The address to check for claimable reward buckets. If none is provided, all possible reward buckets stored in the contract that can potentially be claimed are returned.",
"type": [
"string",
"null"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ClaimableEpochsResponse",
"title": "ClaimableRewardBucketsResponse",
"type": "object",
"required": [
"epochs"
"reward_buckets"
],
"properties": {
"epochs": {
"description": "The epochs that can be claimed by the address.",
"reward_buckets": {
"description": "The reward buckets that can be claimed by the address.",
"type": "array",
"items": {
"$ref": "#/definitions/Epoch"
"$ref": "#/definitions/RewardBucket"
}
}
},
Expand All @@ -31,49 +31,6 @@
}
}
},
"Epoch": {
"type": "object",
"required": [
"available",
"claimed",
"global_index",
"id",
"start_time",
"total"
],
"properties": {
"available": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
},
"claimed": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
},
"global_index": {
"$ref": "#/definitions/GlobalIndex"
},
"id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"start_time": {
"$ref": "#/definitions/Timestamp"
},
"total": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
}
},
"additionalProperties": false
},
"GlobalIndex": {
"type": "object",
"required": [
Expand Down Expand Up @@ -115,6 +72,49 @@
},
"additionalProperties": false
},
"RewardBucket": {
"type": "object",
"required": [
"available",
"claimed",
"epoch_id",
"epoch_start_time",
"global_index",
"total"
],
"properties": {
"available": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
},
"claimed": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
},
"epoch_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"epoch_start_time": {
"$ref": "#/definitions/Timestamp"
},
"global_index": {
"$ref": "#/definitions/GlobalIndex"
},
"total": {
"type": "array",
"items": {
"$ref": "#/definitions/Coin"
}
}
},
"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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
]
},
"grace_period": {
"description": "Grace period the maximum age of a epoch bucket before it's considered expired and fees are forwarded from it",
"description": "Grace period the maximum age of a reward bucket before it's considered expired and fees are forwarded from it",
"type": "integer",
"format": "uint64",
"minimum": 0.0
Expand Down
Loading

0 comments on commit e61863f

Please sign in to comment.