Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
giladHaimov committed Jun 17, 2024
1 parent 3d7cac8 commit 8374aea
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1459,10 +1459,11 @@ func (bc *BlockChain) writeKnownBlock(block *types.Block) error {
return nil
}

// writeBlockWithState writes block, metadata and corresponding state data to the database. @lfm
// writeBlockWithState writes block, metadata and corresponding state data to the database
// @lfm commit a new block
func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.Receipt, logs []*types.Log, state *state.StateDB) error {
// Calculate the total difficulty of the block
ptd := bc.GetTd(block.ParentHash(), block.NumberU64()-1) //@lfm commit a new block
ptd := bc.GetTd(block.ParentHash(), block.NumberU64()-1)
if ptd == nil {
state.StopPrefetcher()
return consensus.ErrUnknownAncestor
Expand Down
10 changes: 5 additions & 5 deletions core/types/legacy_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ func (tx *LegacyTx) copy() TxData {
Data: common.CopyBytes(tx.Data),
Gas: tx.Gas,
// These are initialized below.
Value: new(big.Int),
GasPrice: new(big.Int),
V: new(big.Int),
R: new(big.Int),
S: new(big.Int),
Value: new(big.Int),

Check failure on line 70 in core/types/legacy_tx.go

View workflow job for this annotation

GitHub Actions / golang-lint (1.19.x, ubuntu-latest)

File is not `goimports`-ed (goimports)
GasPrice: new(big.Int),
V: new(big.Int),
R: new(big.Int),
S: new(big.Int),
OrigGasPrice: tx.OrigGasPrice,
}
if tx.Value != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ type TxData interface {
accessList() AccessList
data() []byte
gas() uint64
origGasPrice() *big.Int
gasPrice() *big.Int
origGasPrice() *big.Int
gasTipCap() *big.Int
gasFeeCap() *big.Int
value() *big.Int
Expand Down
2 changes: 1 addition & 1 deletion core/types/transaction_marshalling.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type txJSON struct {
AccessList *AccessList `json:"accessList,omitempty"`

// Only used for encoding:
Hash common.Hash `json:"hash"`
Hash common.Hash `json:"hash"`

Check failure on line 50 in core/types/transaction_marshalling.go

View workflow job for this annotation

GitHub Actions / golang-lint (1.19.x, ubuntu-latest)

File is not `goimports`-ed (goimports)
OrigGasPrice *hexutil.Big `json:"origGasPrice" rlp:"optional"`
}

Expand Down
6 changes: 3 additions & 3 deletions core/types/transaction_signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func MustSignNewTx(prv *ecdsa.PrivateKey, s Signer, txdata TxData) *Transaction
// Sender may cache the address, allowing it to be used regardless of
// signing method. The cache is invalidated if the cached signer does
// not match the signer used in the current call.
func Sender(signer Signer, tx *Transaction) (common.Address, error) { //@lfm
func Sender(signer Signer, tx *Transaction) (common.Address, error) {
if sc := tx.from.Load(); sc != nil {
sigCache := sc.(sigCache)
// If the signer used to derive from in a previous
Expand Down Expand Up @@ -369,9 +369,9 @@ func (s EIP155Signer) Sender(tx *Transaction) (common.Address, error) {
V, R, S := tx.RawSignatureValues()
V = new(big.Int).Sub(V, s.chainIdMul)
V.Sub(V, big8)
//@lfm >> tx hash calculation to obtain orig Sender address
//@lfm: crypto calc to obtain via tx hash the sender address
var sighash common.Hash
legacyTx, isLegacy := tx.inner.(*LegacyTx) //@lfm
legacyTx, isLegacy := tx.inner.(*LegacyTx)
if isLegacy && legacyTx.origGasPrice() != nil {
sighash = s.RecoveryHash(tx, legacyTx.origGasPrice())
} else {
Expand Down
6 changes: 3 additions & 3 deletions eth/gasprice/locaFeeMarket/nativediscount.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ const (
- y never exceeds maxAdjusted value
- smooth 'logarithmic' slope
*/
historicalMeanGasPrice = 35783571428 //wei
historicalSDGasPrice = 849870638 //wei
maxAdjusted = historicalMeanGasPrice + historicalSDGasPrice/2 // =36208506747wei
historicalMeanGasPrice = 35783571428 //wei
historicalSDGasPrice = 849870638 //wei
maxAdjusted = historicalMeanGasPrice + historicalSDGasPrice/2 // =36208506747wei
)

const (
Expand Down

0 comments on commit 8374aea

Please sign in to comment.