mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-20 13:44:31 +00:00
consensus, internal, contracts: remove extra hash and string conversions (#830)
* consensus, internal: remove extra hash conversions * contracts: remove extra string conversions
This commit is contained in:
parent
33b16b5efe
commit
d6b136ed7c
4 changed files with 4 additions and 4 deletions
|
|
@ -353,7 +353,7 @@ func (f *Forensics) FindAncestorBlockHash(chain consensus.ChainReader, firstBloc
|
|||
}
|
||||
|
||||
// Now, they are on the same starting line, we try find the common ancestor
|
||||
for lowerBlockNumHash.Hex() != higherBlockNumberHash.Hex() {
|
||||
for lowerBlockNumHash != higherBlockNumberHash {
|
||||
lowerBlockNumHash = chain.GetHeaderByHash(lowerBlockNumHash).ParentHash
|
||||
higherBlockNumberHash = chain.GetHeaderByHash(higherBlockNumberHash).ParentHash
|
||||
// Append the path
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ func TestYourTurnInitialV2(t *testing.T) {
|
|||
assert.NotNil(t, snap)
|
||||
masterNodes := adaptor.EngineV1.GetMasternodesFromCheckpointHeader(block900.Header())
|
||||
for i := 0; i < len(masterNodes); i++ {
|
||||
assert.Equal(t, masterNodes[i].Hex(), snap.NextEpochCandidates[i].Hex())
|
||||
assert.Equal(t, masterNodes[i], snap.NextEpochCandidates[i])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ func TestSendTxSign(t *testing.T) {
|
|||
t.Fatalf("Can't get signers: %v", err)
|
||||
}
|
||||
|
||||
if signers[0].String() != oldBlocks[blockHash].String() {
|
||||
if signers[0] != oldBlocks[blockHash] {
|
||||
t.Errorf("Tx sign for block signer not match %v - %v", signers[0].String(), oldBlocks[blockHash].String())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ func (s *PublicTxPoolAPI) Inspect() map[string]map[string]map[string]string {
|
|||
// Define a formatter to flatten a transaction into a string
|
||||
var format = func(tx *types.Transaction) string {
|
||||
if to := tx.To(); to != nil {
|
||||
return fmt.Sprintf("%s: %v wei + %v gas × %v wei", tx.To().Hex(), tx.Value(), tx.Gas(), tx.GasPrice())
|
||||
return fmt.Sprintf("%s: %v wei + %v gas × %v wei", to, tx.Value(), tx.Gas(), tx.GasPrice())
|
||||
}
|
||||
return fmt.Sprintf("contract creation: %v wei + %v gas × %v wei", tx.Value(), tx.Gas(), tx.GasPrice())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue