-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: yileds calculations because of wrong getting from db * removes sender from response * removes author and pbftHash from response * WIP: migration for dags * WIP: add ForEachFromKey to storage * WIP: run migration manager * finalizes migration implementation * fixed typo * simplifies code * fix: dag migration and related foreach db method * adds migration to remove pbfthash * fix: wrong prefix --------- Co-authored-by: VargaElod23 <[email protected]> Co-authored-by: Előd Varga <[email protected]>
- Loading branch information
1 parent
7eed825
commit 31a9272
Showing
26 changed files
with
526 additions
and
269 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,5 @@ taraxa-indexer | |
|
||
.vscode | ||
|
||
data | ||
data | ||
backup* |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package chain | ||
|
||
import ( | ||
"github.com/Taraxa-project/taraxa-indexer/internal/common" | ||
) | ||
|
||
type initialValidator struct { | ||
Address string `json:"address"` | ||
Delegations map[string]string `json:"delegations"` | ||
} | ||
|
||
type DposConfig struct { | ||
BlocksPerYear string `json:"blocks_per_year"` | ||
DagProposersReward string `json:"dag_proposers_reward"` | ||
MaxBlockAuthorReward string `json:"max_block_author_reward"` | ||
EligibilityBalanceThreshold string `json:"eligibility_balance_threshold"` | ||
YieldPercentage string `json:"yield_percentage"` | ||
InitialValidators []initialValidator `json:"initial_validators"` | ||
} | ||
|
||
type PbftConfig struct { | ||
CommitteeSize string `json:"committee_size"` | ||
LambdaMs string `json:"lambda_ms"` | ||
} | ||
|
||
type GenesisObject struct { | ||
DagGenesisBlock DagBlock `json:"dag_genesis_block"` | ||
InitialBalances map[string]string `json:"initial_balances"` | ||
Pbft PbftConfig `json:"pbft"` | ||
Dpos DposConfig `json:"dpos"` | ||
} | ||
|
||
func (g *GenesisObject) ToChainConfig() (c *common.ChainConfig) { | ||
c = new(common.ChainConfig) | ||
c.CommitteeSize = common.ParseStringToBigInt(g.Pbft.CommitteeSize) | ||
c.BlocksPerYear = common.ParseStringToBigInt(g.Dpos.BlocksPerYear) | ||
c.YieldPercentage = common.ParseStringToBigInt(g.Dpos.YieldPercentage) | ||
c.DagProposersReward = common.ParseStringToBigInt(g.Dpos.DagProposersReward) | ||
c.MaxBlockAuthorReward = common.ParseStringToBigInt(g.Dpos.MaxBlockAuthorReward) | ||
c.EligibilityBalanceThreshold = common.ParseStringToBigInt(g.Dpos.EligibilityBalanceThreshold) | ||
return | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.