core: fix unnecessary conversion (#1565)

This commit is contained in:
wit liu 2025-09-24 07:55:14 +08:00 committed by GitHub
parent 6c2315f9a5
commit 2b658e7934
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View file

@ -291,7 +291,7 @@ func (w *wizard) makeGenesis() {
fmt.Println()
fmt.Println("How many blocks before checkpoint need to prepare new set of masternodes? (default = 450)")
if input != nil {
genesis.Config.XDPoS.Gap = uint64(input.Gap)
genesis.Config.XDPoS.Gap = input.Gap
} else {
genesis.Config.XDPoS.Gap = uint64(w.readDefaultInt(450))
}
@ -314,7 +314,7 @@ func (w *wizard) makeGenesis() {
} else {
yield = uint64(w.readDefaultInt(10))
}
blocksPerYear := uint64(31536000 / genesis.Config.XDPoS.Period)
blocksPerYear := 31536000 / genesis.Config.XDPoS.Period
epochsPerYear := blocksPerYear / genesis.Config.XDPoS.Epoch
rewardsPerYear := float64(threshold) * (float64(yield) / float64(100))
rewardPerEpochPerMN := uint64(rewardsPerYear / float64(epochsPerYear))

View file

@ -130,7 +130,7 @@ func testFork(t *testing.T, blockchain *BlockChain, i, n int, full bool, compara
func printChain(bc *BlockChain) {
for i := bc.CurrentBlock().Number().Uint64(); i > 0; i-- {
b := bc.GetBlockByNumber(uint64(i))
b := bc.GetBlockByNumber(i)
fmt.Printf("\t%x %v\n", b.Hash(), b.Difficulty())
}
}

View file

@ -58,7 +58,7 @@ func getLendingNonce(userAddress common.Address) (uint64, error) {
s := result.(string)
s = strings.TrimPrefix(s, "0x")
n, err := strconv.ParseUint(s, 16, 32)
return uint64(n), err
return n, err
}
func (l *LendingMsg) computeHash() common.Hash {

View file

@ -67,7 +67,7 @@ func getNonce(t *testing.T, userAddress common.Address) (uint64, error) {
s := result.(string)
s = strings.TrimPrefix(s, "0x")
n, err := strconv.ParseUint(s, 16, 32)
return uint64(n), err
return n, err
}
func testSendOrder(t *testing.T, amount, price *big.Int, side string, status string, orderID uint64) {