Updates API to new changes

This commit is contained in:
laisolizq
2020-12-04 11:09:59 +01:00
parent 329d2796c6
commit 75c6d8f14e
5 changed files with 20 additions and 23 deletions

View File

@@ -369,6 +369,7 @@ func TestMain(m *testing.M) {
Outbidding: uint16(1), Outbidding: uint16(1),
SlotDeadline: uint8(20), SlotDeadline: uint8(20),
BootCoordinator: ethCommon.HexToAddress("0x1111111111111111111111111111111111111111"), BootCoordinator: ethCommon.HexToAddress("0x1111111111111111111111111111111111111111"),
BootCoordinatorURL: "https://boot.coordinator.io",
ClosedAuctionSlots: uint16(2), ClosedAuctionSlots: uint16(2),
OpenAuctionSlots: uint16(5), OpenAuctionSlots: uint16(5),
} }

View File

@@ -2697,6 +2697,10 @@ components:
- $ref: '#/components/schemas/EthereumAddress' - $ref: '#/components/schemas/EthereumAddress'
- description: Ethereum address of the boot coordinator. - description: Ethereum address of the boot coordinator.
- example: "0x997dc4262BCDbf85190C01c996b4C06a461d2430" - example: "0x997dc4262BCDbf85190C01c996b4C06a461d2430"
bootCoordinatorUrl:
type: string
description: Boot Coordinator URL
example: "https://boot.coordinator.io"
slotDeadline: slotDeadline:
type: integer type: integer
description: Number of blocks after the beginning of a slot after which any coordinator can forge if the winner has not forged any batch in that slot. description: Number of blocks after the beginning of a slot after which any coordinator can forge if the winner has not forged any batch in that slot.
@@ -2733,6 +2737,7 @@ components:
required: required:
- ethereumBlockNum - ethereumBlockNum
- bootCoordinator - bootCoordinator
- bootCoordinatorUrl
- slotDeadline - slotDeadline
- closedAuctionSlots - closedAuctionSlots
- openAuctionSlots - openAuctionSlots
@@ -2804,21 +2809,16 @@ components:
properties: properties:
ethereumBlockNum: ethereumBlockNum:
$ref: '#/components/schemas/EthBlockNum' $ref: '#/components/schemas/EthBlockNum'
hermezGovernanceDAOAddress: hermezGovernanceAddress:
allOf: allOf:
- $ref: '#/components/schemas/EthereumAddress' - $ref: '#/components/schemas/EthereumAddress'
- description: Ethereum address of the governance DAO. - description: Ethereum address of the governance.
- example: "0x667dc4262BCDbf85190C01c996b4C06a461d2430" - example: "0x667dc4262BCDbf85190C01c996b4C06a461d2430"
whiteHackGroupAddress: emergencyCouncilAddress:
allOf: allOf:
- $ref: '#/components/schemas/EthereumAddress' - $ref: '#/components/schemas/EthereumAddress'
- description: Ethereum Address that can claim the funds in an emergency when the maximum emergency mode time is exceeded. - description: Ethereum Address that can claim the funds in an emergency when the maximum emergency mode time is exceeded.
- example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430" - example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
hermezKeeperAddress:
allOf:
- $ref: '#/components/schemas/EthereumAddress'
- description: Ethereum Address that can enable emergency mode and modify the delay to make a withdrawal.
- example: "0x557dc4262BCDbf85190C01c996b4C06a461d2430"
withdrawalDelay: withdrawalDelay:
allOf: allOf:
- $ref: '#/components/schemas/EthBlockNum' - $ref: '#/components/schemas/EthBlockNum'
@@ -2835,9 +2835,8 @@ components:
additionalProperties: false additionalProperties: false
required: required:
- ethereumBlockNum - ethereumBlockNum
- hermezGovernanceDAOAddress - hermezGovernanceAddress
- whiteHackGroupAddress - emergencyCouncilAddress
- hermezKeeperAddress
- withdrawalDelay - withdrawalDelay
- emergencyModeStartingTime - emergencyModeStartingTime
- emergencyMode - emergencyMode
@@ -2925,16 +2924,11 @@ components:
- $ref: '#/components/schemas/EthereumAddress' - $ref: '#/components/schemas/EthereumAddress'
- description: Ethereum address of the auction smart contract. - description: Ethereum address of the auction smart contract.
- example: "0x111dc4262BCDbf85190C01c996b4C06a461d2430" - example: "0x111dc4262BCDbf85190C01c996b4C06a461d2430"
hermezGovernanceDAOAddress: hermezGovernanceAddress:
allOf: allOf:
- $ref: '#/components/schemas/EthereumAddress' - $ref: '#/components/schemas/EthereumAddress'
- description: Ethereum address of the governanceDAO. - description: Ethereum address of the governance.
- example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430" - example: "0x222dc4262BCDbf85190C01c996b4C06a461d2430"
safetyAddress:
allOf:
- $ref: '#/components/schemas/EthereumAddress'
- description: Ethereum address of the safety.
- example: "0x333dc4262BCDbf85190C01c996b4C06a461d2430"
withdrawDelayerContract: withdrawDelayerContract:
allOf: allOf:
- $ref: '#/components/schemas/EthereumAddress' - $ref: '#/components/schemas/EthereumAddress'
@@ -2945,8 +2939,7 @@ components:
- absoluteMaxL1L2BatchTimeout - absoluteMaxL1L2BatchTimeout
- verifiers - verifiers
- hermezAuctionContract - hermezAuctionContract
- hermezGovernanceDAOAddress - hermezGovernanceAddress
- safetyAddress
- withdrawDelayerContract - withdrawDelayerContract
additionalProperties: false additionalProperties: false
maxFeeIdxCoordinator: maxFeeIdxCoordinator:

View File

@@ -25,7 +25,6 @@ type AuctionConstants struct {
// HermezRollup smartcontract address // HermezRollup smartcontract address
HermezRollup ethCommon.Address `json:"hermezRollup"` HermezRollup ethCommon.Address `json:"hermezRollup"`
// Hermez Governanze Token smartcontract address who controls some parameters and collects HEZ fee // Hermez Governanze Token smartcontract address who controls some parameters and collects HEZ fee
// Only for test
GovernanceAddress ethCommon.Address `json:"governanceAddress"` GovernanceAddress ethCommon.Address `json:"governanceAddress"`
} }
@@ -54,7 +53,7 @@ func (c *AuctionConstants) RelativeBlock(blockNum int64) int64 {
// AuctionVariables are the variables of the Auction Smart Contract // AuctionVariables are the variables of the Auction Smart Contract
type AuctionVariables struct { type AuctionVariables struct {
EthBlockNum int64 `json:"ethereumBlockNum" meddler:"eth_block_num"` EthBlockNum int64 `json:"ethereumBlockNum" meddler:"eth_block_num"`
// Boot Coordinator Address // Donation Address
DonationAddress ethCommon.Address `json:"donationAddress" meddler:"donation_address" validate:"required"` DonationAddress ethCommon.Address `json:"donationAddress" meddler:"donation_address" validate:"required"`
// Boot Coordinator Address // Boot Coordinator Address
BootCoordinator ethCommon.Address `json:"bootCoordinator" meddler:"boot_coordinator" validate:"required"` BootCoordinator ethCommon.Address `json:"bootCoordinator" meddler:"boot_coordinator" validate:"required"`

View File

@@ -12,7 +12,7 @@ CREATE TABLE coordinator (
bidder_addr BYTEA NOT NULL, bidder_addr BYTEA NOT NULL,
forger_addr BYTEA NOT NULL, forger_addr BYTEA NOT NULL,
eth_block_num BIGINT NOT NULL REFERENCES block (eth_block_num) ON DELETE CASCADE, eth_block_num BIGINT NOT NULL REFERENCES block (eth_block_num) ON DELETE CASCADE,
url VARCHAR(200) NOT NULL url BYTEA NOT NULL
); );
CREATE TABLE batch ( CREATE TABLE batch (

View File

@@ -669,6 +669,10 @@ func (c *AuctionClient) AuctionVariables() (auctionVariables *common.AuctionVari
return tracerr.Wrap(err) return tracerr.Wrap(err)
} }
auctionVariables.BootCoordinator = *bootCoordinator auctionVariables.BootCoordinator = *bootCoordinator
auctionVariables.BootCoordinatorURL, err = c.auction.BootCoordinatorURL(nil)
if err != nil {
return tracerr.Wrap(err)
}
auctionVariables.ClosedAuctionSlots, err = c.AuctionGetClosedAuctionSlots() auctionVariables.ClosedAuctionSlots, err = c.AuctionGetClosedAuctionSlots()
if err != nil { if err != nil {
return tracerr.Wrap(err) return tracerr.Wrap(err)