Skip to content

Commit

Permalink
Remove MT (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM committed Jun 6, 2024
1 parent 6953fac commit f64c3d2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
30 changes: 21 additions & 9 deletions config/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/0xPolygonHermez/zkevm-sequence-sender/etherman"
"github.com/0xPolygonHermez/zkevm-sequence-sender/log"
"github.com/0xPolygonHermez/zkevm-sequence-sender/merkletree"
"github.com/0xPolygonHermez/zkevm-sequence-sender/state"
"github.com/ethereum/go-ethereum/common"
"github.com/urfave/cli/v2"
Expand All @@ -24,10 +23,23 @@ type NetworkConfig struct {
}

type network string

const mainnet network = "mainnet"
const testnet network = "testnet"
const custom network = "custom"
type leafType uint8

const (
mainnet network = "mainnet"
testnet network = "testnet"
custom network = "custom"
// LeafTypeBalance specifies that leaf stores Balance
LeafTypeBalance leafType = 0
// LeafTypeNonce specifies that leaf stores Nonce
LeafTypeNonce leafType = 1
// LeafTypeCode specifies that leaf stores Code
LeafTypeCode leafType = 2
// LeafTypeStorage specifies that leaf stores Storage Value
LeafTypeStorage leafType = 3
// LeafTypeSCLength specifies that leaf stores Storage Value
LeafTypeSCLength leafType = 4
)

// GenesisFromJSON is the config file for network_custom
type GenesisFromJSON struct {
Expand Down Expand Up @@ -128,23 +140,23 @@ func LoadGenesisFromJSONString(jsonStr string) (NetworkConfig, error) {
if account.Balance != "" && account.Balance != "0" {
action := &state.GenesisAction{
Address: account.Address,
Type: int(merkletree.LeafTypeBalance),
Type: int(LeafTypeBalance),
Value: account.Balance,
}
cfg.Genesis.Actions = append(cfg.Genesis.Actions, action)
}
if account.Nonce != "" && account.Nonce != "0" {
action := &state.GenesisAction{
Address: account.Address,
Type: int(merkletree.LeafTypeNonce),
Type: int(LeafTypeNonce),
Value: account.Nonce,
}
cfg.Genesis.Actions = append(cfg.Genesis.Actions, action)
}
if account.Bytecode != "" {
action := &state.GenesisAction{
Address: account.Address,
Type: int(merkletree.LeafTypeCode),
Type: int(LeafTypeCode),
Bytecode: account.Bytecode,
}
cfg.Genesis.Actions = append(cfg.Genesis.Actions, action)
Expand All @@ -153,7 +165,7 @@ func LoadGenesisFromJSONString(jsonStr string) (NetworkConfig, error) {
for storageKey, storageValue := range account.Storage {
action := &state.GenesisAction{
Address: account.Address,
Type: int(merkletree.LeafTypeStorage),
Type: int(LeafTypeStorage),
StoragePosition: storageKey,
Value: storageValue,
}
Expand Down
17 changes: 0 additions & 17 deletions merkletree/leaf.go

This file was deleted.

0 comments on commit f64c3d2

Please sign in to comment.