-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add emit events and update spec docs (#46)
* feat: adding events work in progress * feat: remove unused event types * docs: update 02_state.md * docs: update 06_params.md * docs: update 04_begin_block.md * docs: update 01_concepts.md * docs: update 03_state_transitions.md * docs: update minor stuff * docs: revert back to 'with' and have some spaces in between points * docs: apply feedbacks and suggestions * docs: apply suggestion * docs: apply suggestions from the review * docs: update x/budget/abci.go Co-authored-by: dongsam <[email protected]> * docs: update x/budget/spec/03_state_transitions.md Co-authored-by: dongsam <[email protected]> Co-authored-by: dongsam <[email protected]>
- Loading branch information
Showing
8 changed files
with
148 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
<!-- order: 2 --> | ||
|
||
# State | ||
|
||
## Budget | ||
|
||
The Budget structure is not stored in kv, but in parameters in the budget module as budgets. | ||
Budget object is not stored in KVStore. | ||
|
||
```go | ||
// Budget contains budget information | ||
type Budget struct { | ||
Name string // name defines the name of the budget | ||
Rate sdk.Dec // rate specifies the distributing amount by ratio of total budget source | ||
BudgetSourceAddress string // budget_source_address defines the bech32-encoded address that source of the budget | ||
CollectionAddress string // collection_address defines the bech32-encoded address of the budget pool to distribute | ||
StartTime time.Time // start_time specifies the start time of the budget | ||
EndTime time.Time // end_time specifies the end time of the budget | ||
Name string // name of the budget | ||
Rate sdk.Dec // distributing amount by ratio of total budget source | ||
BudgetSourceAddress string // bech32-encoded address that source of the budget | ||
CollectionAddress string // bech32-encoded address that collects budget from the budget source address | ||
StartTime time.Time // start time of the budget plan | ||
EndTime time.Time // end time of the budget plan | ||
} | ||
``` | ||
|
||
### Total collected coins | ||
+++ https://github.com/tendermint/budget/blob/master/proto/tendermint/budget/v1beta1/budget.proto#L25-L53 | ||
|
||
The total collected coins is cumulative coins collected in the budget since the bucket was created. | ||
The total collected coins for each budget are stored as follows: | ||
``` | ||
0x11 | BudgetName -> TotalCollectedCoins | ||
``` | ||
## TotalCollectedCoins | ||
|
||
Where `TotalCollectedCoins` is just a wrapper around `sdk.Coins`: | ||
```go | ||
// TotalCollectedCoins are cumulative coins collected in the budget since the bucket was created. | ||
type TotalCollectedCoins struct { | ||
TotalCollectedCoins sdk.Coins | ||
} | ||
``` | ||
|
||
+++ https://github.com/tendermint/budget/blob/master/proto/tendermint/budget/v1beta1/budget.proto#L55-L64 | ||
|
||
|
||
For the purpose of tracking total collected coins for a budget, budget name is used as key to find it in store. | ||
|
||
- TotalCollectedCoins: `0x11 | BudgetName -> TotalCollectedCoins` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters