mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Reorganize smart contract types, udate eth tests, etc.
- Move smart contract constants and structs for variables to
common/{ethrollup.go, ethauction.go, ethwdelayer.go}:
- This removes repeated code of the structs for variables
- Allows reusing the constants and variables from all modules without
import cycles
- Remove unused common/scvars.go
- In common.BlockData, split data from each smart contract into a sepparate
field (Rollup, Auction, WDelayer). This affects the structures that til uses
as output, and HistoryDB in the AddBlockSCData.
- In Synchronizer:
- Pass starting block of each smart contract as config, instead of
incorrectly using the genesis block found in the acution constant (which
has a very different meaning)
- Use variable structs from common instead of an internal copy
- Synchronize more stuff (resolve some TODOs)
- Fix some issues found after initial testing with ganache
- In eth:
- In auction.go: Add method to get constants
- Update README to use ganache instead of buidlerevm as local blockchain
for testing
- Update env variables and test vectors to pass the tests with the
deployment in the ganache testnet.
- Use ethereum keys derived from paths (hdwallet) in testing to avoid
hardcoding private keys and generate the same keys from a mnemonic used
in the ganache tesnet.
This commit is contained in:
13
api/state.go
13
api/state.go
@@ -3,15 +3,14 @@ package api
|
||||
import (
|
||||
"github.com/hermeznetwork/hermez-node/common"
|
||||
"github.com/hermeznetwork/hermez-node/db/historydb"
|
||||
"github.com/hermeznetwork/hermez-node/eth"
|
||||
)
|
||||
|
||||
// Status define status of the network
|
||||
type Status struct {
|
||||
Network historydb.Network `json:"network"`
|
||||
Metrics historydb.Metrics `json:"metrics"`
|
||||
Rollup eth.RollupVariables `json:"rollup"`
|
||||
Auction eth.AuctionVariables `json:"auction"`
|
||||
WithdrawalDelayer eth.WDelayerVariables `json:"withdrawalDelayer"`
|
||||
RecommendedFee common.RecommendedFee `json:"recommendedFee"`
|
||||
Network historydb.Network `json:"network"`
|
||||
Metrics historydb.Metrics `json:"metrics"`
|
||||
Rollup common.RollupVariables `json:"rollup"`
|
||||
Auction common.AuctionVariables `json:"auction"`
|
||||
WithdrawalDelayer common.WDelayerVariables `json:"withdrawalDelayer"`
|
||||
RecommendedFee common.RecommendedFee `json:"recommendedFee"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user