-
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
- Loading branch information
Showing
14 changed files
with
190 additions
and
164 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 |
---|---|---|
@@ -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
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
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.