From e62fd0abe460a2c2fe4e70949bb2b493a421a05a Mon Sep 17 00:00:00 2001 From: AnilChinchawale Date: Sat, 12 Jan 2019 08:34:50 +0530 Subject: [PATCH] Fixed and updated blocksignerReader --- contracts/blockSignerReader.go | 2 +- contracts/smcUtils.go | 2 +- contracts/test.go | 2 +- contracts/utils.go | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/blockSignerReader.go b/contracts/blockSignerReader.go index ef523e1f68..46b72e889a 100644 --- a/contracts/blockSignerReader.go +++ b/contracts/blockSignerReader.go @@ -30,4 +30,4 @@ func GetSigners(statedb *state.StateDB, block *types.Block) []common.Address { } return rets -} \ No newline at end of file +} diff --git a/contracts/smcUtils.go b/contracts/smcUtils.go index 66f01af2c0..8c71c78164 100644 --- a/contracts/smcUtils.go +++ b/contracts/smcUtils.go @@ -31,4 +31,4 @@ func getLocFixedArrAtElement(slot uint64, index uint64, elementSize uint64) comm slotBig := new(big.Int).SetUint64(slot) arrBig := slotBig.Add(slotBig, new(big.Int).SetUint64(index*elementSize)) return common.BigToHash(arrBig) -} \ No newline at end of file +} diff --git a/contracts/test.go b/contracts/test.go index 05d1053345..5a7a99b209 100644 --- a/contracts/test.go +++ b/contracts/test.go @@ -279,4 +279,4 @@ package contracts // slotBig := new(big.Int).SetUint64(slot) // arrBig := slotBig.Add(slotBig, new(big.Int).SetUint64(index*elementSize)) // return common.BigToHash(arrBig) -//} \ No newline at end of file +//} diff --git a/contracts/utils.go b/contracts/utils.go index 21dd0f799c..cff416a6c8 100644 --- a/contracts/utils.go +++ b/contracts/utils.go @@ -374,7 +374,7 @@ func CalculateRewardForSigner(chainReward *big.Int, signers map[common.Address]* } // Get candidate owner by address. -func GetCandidatesOwnerBySigner(validator *contractValidator.XDCValidator, signerAddr common.Address) common.Address { +func GetCandidatesOwnerBySigner(validator *contractValidator.Kyc, signerAddr common.Address) common.Address { owner := signerAddr opts := new(bind.CallOpts) owner, err := validator.GetCandidateOwner(opts, signerAddr) @@ -387,7 +387,7 @@ func GetCandidatesOwnerBySigner(validator *contractValidator.XDCValidator, signe } // Calculate reward for holders. -func CalculateRewardForHolders(foudationWalletAddr common.Address, validator *contractValidator.XDCValidator, state *state.StateDB, signer common.Address, calcReward *big.Int) (error, map[common.Address]*big.Int) { +func CalculateRewardForHolders(foudationWalletAddr common.Address, validator *contractValidator.Kyc, state *state.StateDB, signer common.Address, calcReward *big.Int) (error, map[common.Address]*big.Int) { rewards, err := GetRewardBalancesRate(foudationWalletAddr, signer, calcReward, validator) if err != nil { return err, nil @@ -401,7 +401,7 @@ func CalculateRewardForHolders(foudationWalletAddr common.Address, validator *co } // Get reward balance rates for master node, founder and holders. -func GetRewardBalancesRate(foudationWalletAddr common.Address, masterAddr common.Address, totalReward *big.Int, validator *contractValidator.XDCValidator) (map[common.Address]*big.Int, error) { +func GetRewardBalancesRate(foudationWalletAddr common.Address, masterAddr common.Address, totalReward *big.Int, validator *contractValidator.Kyc) (map[common.Address]*big.Int, error) { owner := GetCandidatesOwnerBySigner(validator, masterAddr) balances := make(map[common.Address]*big.Int) rewardMaster := new(big.Int).Mul(totalReward, new(big.Int).SetInt64(common.RewardMasterPercent))