mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
API change names and add poolLoad, add maxFeeUSD
This commit is contained in:
@@ -209,7 +209,7 @@ func TestMain(m *testing.M) {
|
||||
panic(err)
|
||||
}
|
||||
// L2DB
|
||||
l2DB := l2db.NewL2DB(database, database, 10, 1000, 0.0, 24*time.Hour, apiConnCon)
|
||||
l2DB := l2db.NewL2DB(database, database, 10, 1000, 0.0, 1000.0, 24*time.Hour, apiConnCon)
|
||||
test.WipeDB(l2DB.DB()) // this will clean HistoryDB and L2DB
|
||||
// Config (smart contract constants)
|
||||
chainID := uint16(0)
|
||||
@@ -240,6 +240,7 @@ func TestMain(m *testing.M) {
|
||||
nodeConfig := &historydb.NodeConfig{
|
||||
MaxPoolTxs: 10,
|
||||
MinFeeUSD: 0,
|
||||
MaxFeeUSD: 10000000000,
|
||||
}
|
||||
if err := hdb.SetNodeConfig(nodeConfig); err != nil {
|
||||
panic(err)
|
||||
@@ -615,7 +616,7 @@ func TestTimeout(t *testing.T) {
|
||||
hdbTO := historydb.NewHistoryDB(databaseTO, databaseTO, apiConnConTO)
|
||||
require.NoError(t, err)
|
||||
// L2DB
|
||||
l2DBTO := l2db.NewL2DB(databaseTO, databaseTO, 10, 1000, 1.0, 24*time.Hour, apiConnConTO)
|
||||
l2DBTO := l2db.NewL2DB(databaseTO, databaseTO, 10, 1000, 1.0, 1000.0, 24*time.Hour, apiConnConTO)
|
||||
|
||||
// API
|
||||
apiGinTO := gin.Default()
|
||||
|
||||
@@ -145,8 +145,8 @@ func TestUpdateMetrics(t *testing.T) {
|
||||
assert.Greater(t, ni.StateAPI.Metrics.TransactionsPerBatch, float64(0))
|
||||
assert.Greater(t, ni.StateAPI.Metrics.BatchFrequency, float64(0))
|
||||
assert.Greater(t, ni.StateAPI.Metrics.TransactionsPerSecond, float64(0))
|
||||
assert.Greater(t, ni.StateAPI.Metrics.TotalAccounts, int64(0))
|
||||
assert.Greater(t, ni.StateAPI.Metrics.TotalBJJs, int64(0))
|
||||
assert.Greater(t, ni.StateAPI.Metrics.TokenAccounts, int64(0))
|
||||
assert.Greater(t, ni.StateAPI.Metrics.Wallets, int64(0))
|
||||
assert.Greater(t, ni.StateAPI.Metrics.AvgTransactionFee, float64(0))
|
||||
}
|
||||
|
||||
@@ -210,8 +210,8 @@ func TestGetState(t *testing.T) {
|
||||
assert.Greater(t, status.Metrics.TransactionsPerBatch, float64(0))
|
||||
assert.Greater(t, status.Metrics.BatchFrequency, float64(0))
|
||||
assert.Greater(t, status.Metrics.TransactionsPerSecond, float64(0))
|
||||
assert.Greater(t, status.Metrics.TotalAccounts, int64(0))
|
||||
assert.Greater(t, status.Metrics.TotalBJJs, int64(0))
|
||||
assert.Greater(t, status.Metrics.TokenAccounts, int64(0))
|
||||
assert.Greater(t, status.Metrics.Wallets, int64(0))
|
||||
assert.Greater(t, status.Metrics.AvgTransactionFee, float64(0))
|
||||
// Recommended fee
|
||||
// TODO: perform real asserts (not just greater than 0)
|
||||
|
||||
@@ -2569,9 +2569,9 @@ components:
|
||||
description: List of next coordinators to forge.
|
||||
items:
|
||||
$ref: '#/components/schemas/NextForger'
|
||||
NodeConfig:
|
||||
Node:
|
||||
type: object
|
||||
description: Configuration of the coordinator node. Note that this is specific for each coordinator.
|
||||
description: Configuration and metrics of the coordinator node. Note that this is specific for each coordinator.
|
||||
properties:
|
||||
forgeDelay:
|
||||
type: number
|
||||
@@ -2581,9 +2581,14 @@ components:
|
||||
forge at the maximum rate. Note that this is a configuration parameter of a node,
|
||||
so each coordinator may have a different value.
|
||||
example: 193.4
|
||||
poolLoad:
|
||||
type: number
|
||||
description: Number of pending transactions in the pool
|
||||
example: 23201
|
||||
additionalProperties: false
|
||||
required:
|
||||
- forgeDelay
|
||||
- poolLoad
|
||||
State:
|
||||
type: object
|
||||
description: Gobal variables of the network
|
||||
@@ -2600,8 +2605,8 @@ components:
|
||||
$ref: '#/components/schemas/StateWithdrawDelayer'
|
||||
recommendedFee:
|
||||
$ref: '#/components/schemas/RecommendedFee'
|
||||
nodeConfig:
|
||||
$ref: '#/components/schemas/NodeConfig'
|
||||
node:
|
||||
$ref: '#/components/schemas/Node'
|
||||
additionalProperties: false
|
||||
required:
|
||||
- network
|
||||
@@ -2610,7 +2615,7 @@ components:
|
||||
- auction
|
||||
- withdrawalDelayer
|
||||
- recommendedFee
|
||||
- nodeConfig
|
||||
- node
|
||||
StateNetwork:
|
||||
type: object
|
||||
description: Gobal statistics of the network
|
||||
@@ -2809,11 +2814,11 @@ components:
|
||||
type: number
|
||||
description: Average transactions per second in the last 24 hours.
|
||||
example: 302.3
|
||||
totalAccounts:
|
||||
tokenAccounts:
|
||||
type: integer
|
||||
description: Number of created accounts.
|
||||
example: 90473
|
||||
totalBJJs:
|
||||
wallets:
|
||||
type: integer
|
||||
description: Number of different registered BJJs.
|
||||
example: 23067
|
||||
@@ -2830,8 +2835,8 @@ components:
|
||||
- transactionsPerBatch
|
||||
- batchFrequency
|
||||
- transactionsPerSecond
|
||||
- totalAccounts
|
||||
- totalBJJs
|
||||
- tokenAccounts
|
||||
- wallets
|
||||
- avgTransactionFee
|
||||
- estimatedTimeToForgeL1
|
||||
PendingItems:
|
||||
|
||||
Reference in New Issue
Block a user