Skip to content

Commit

Permalink
moved and added zero values
Browse files Browse the repository at this point in the history
  • Loading branch information
lmittmann committed Jul 16, 2023
1 parent 37f25d1 commit 1e679c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 2 additions & 6 deletions w3vm/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ import (
"github.com/ethereum/go-ethereum/params"
)

var (
uint0 uint64
)

// defaultChainConfig contains every protocol change introduced for Mainnet.
var defaultChainConfig = &params.ChainConfig{
// allEthashProtocolChanges contains every protocol change introduced for Mainnet.
var allEthashProtocolChanges = &params.ChainConfig{
ChainID: big.NewInt(1),
HomesteadBlock: new(big.Int),
DAOForkBlock: nil,
Expand Down
9 changes: 9 additions & 0 deletions w3vm/util.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
package w3vm

import "github.com/ethereum/go-ethereum/common"

// zero values
var (
addr0 common.Address
hash0 common.Hash
uint0 uint64
)

// nilToZero converts sets a pointer to the zero value if it is nil.
func nilToZero[T any](ptr *T) *T {
if ptr == nil {
Expand Down

0 comments on commit 1e679c4

Please sign in to comment.