Merge pull request #210 from hermeznetwork/feature/api-config-const

Add config endpoint
This commit is contained in:
Eduard S
2020-10-21 13:30:00 +02:00
committed by GitHub
8 changed files with 261 additions and 91 deletions

View File

@@ -22,18 +22,18 @@ import (
// AuctionConstants are the constants of the Rollup Smart Contract
type AuctionConstants struct {
// Blocks per slot
BlocksPerSlot uint8
BlocksPerSlot uint8 `json:"blocksPerSlot"`
// Minimum bid when no one has bid yet
InitialMinimalBidding *big.Int
InitialMinimalBidding *big.Int `json:"initialMinimalBidding"`
// First block where the first slot begins
GenesisBlockNum int64
GenesisBlockNum int64 `json:"genesisBlockNum"`
// ERC777 token with which the bids will be made
TokenHEZ ethCommon.Address
TokenHEZ ethCommon.Address `json:"tokenHEZ"`
// HermezRollup smartcontract address
HermezRollup ethCommon.Address
HermezRollup ethCommon.Address `json:"hermezRollup"`
// Hermez Governanze Token smartcontract address who controls some parameters and collects HEZ fee
// Only for test
GovernanceAddress ethCommon.Address
GovernanceAddress ethCommon.Address `json:"governanceAddress"`
}
// SlotState is the state of a slot

View File

@@ -101,13 +101,13 @@ var (
// RollupPublicConstants are the constants of the Rollup Smart Contract
type RollupPublicConstants struct {
AbsoluteMaxL1L2BatchTimeout int64
TokenHEZ ethCommon.Address
Verifiers []RollupVerifierStruct
HermezAuctionContract ethCommon.Address
HermezGovernanceDAOAddress ethCommon.Address
SafetyAddress ethCommon.Address
WithdrawDelayerContract ethCommon.Address
AbsoluteMaxL1L2BatchTimeout int64 `json:"absoluteMaxL1L2BatchTimeout"`
TokenHEZ ethCommon.Address `json:"tokenHEZ"`
Verifiers []RollupVerifierStruct `json:"verifiers"`
HermezAuctionContract ethCommon.Address `json:"hermezAuctionContract"`
HermezGovernanceDAOAddress ethCommon.Address `json:"hermezGovernanceDAOAddress"`
SafetyAddress ethCommon.Address `json:"safetyAddress"`
WithdrawDelayerContract ethCommon.Address `json:"withdrawDelayerContract"`
}
// RollupVariables are the variables of the Rollup Smart Contract
@@ -133,8 +133,8 @@ func NewQueueStruct() *QueueStruct {
// RollupVerifierStruct is the information about verifiers of the Rollup Smart Contract
type RollupVerifierStruct struct {
MaxTx int64
NLevels int64
MaxTx int64 `json:"maxTx"`
NLevels int64 `json:"nlevels"`
}
// RollupState represents the state of the Rollup in the Smart Contract

View File

@@ -19,11 +19,11 @@ import (
// WDelayerConstants are the constants of the Rollup Smart Contract
type WDelayerConstants struct {
// Max Withdrawal Delay
MaxWithdrawalDelay uint64
MaxWithdrawalDelay uint64 `json:"maxWithdrawalDelay"`
// Max Emergency mode time
MaxEmergencyModeTime uint64
MaxEmergencyModeTime uint64 `json:"maxEmergencyModeTime"`
// HermezRollup smartcontract address
HermezRollup ethCommon.Address
HermezRollup ethCommon.Address `json:"hermezRollup"`
}
// DepositState is the state of Deposit