Skip to content

Commit

Permalink
Replace hard-coded version constants with derived values
Browse files Browse the repository at this point in the history
The `TestConfig` `new` function references two hard-coded values
related to the version of the sequencer to run.  These values have been
hard coded to `2` and `3` to indicate the versions of the sequencer that
we have been developing with.  However, the version `3` and the logic
that ensues from it is based on the assumption that version `3` will be
the marketplace, which is the value it has had historically up to this point.

Because of the change of this version's number, and the errors that
will result when we assign some other version of the sequencer to `3`,
We've opted to instead reference the static version values of the
allocated values for each of the versions for this transition.  This should
make it clear, and accurate, of which sequencer version we're
referencing, and at which point they should change.
  • Loading branch information
Ayiga committed Jan 10, 2025
1 parent 681c956 commit ea449b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::{anyhow, Result};
use client::SequencerClient;
use espresso_types::{FeeAmount, MarketplaceVersion};
use espresso_types::{FeeAmount, FeeVersion, MarketplaceVersion};
use ethers::prelude::*;
use futures::future::join_all;
use std::{fmt, str::FromStr, time::Duration};
Expand Down Expand Up @@ -82,10 +82,10 @@ impl TestConfig {
// which is the initial mainnet version without any upgrades.
let sequencer_version: u8 = dotenvy::var("INTEGRATION_TEST_SEQUENCER_VERSION")
.map(|v| v.parse().unwrap())
.unwrap_or(2);
.unwrap_or(FeeVersion::version().minor as u8);

// Varies between v0 and v3.
let load_generator_url = if sequencer_version >= 3 {
let load_generator_url = if sequencer_version >= MarketplaceVersion::version().minor as u8 {
url_from_port(dotenvy::var(
"ESPRESSO_SUBMIT_TRANSACTIONS_PRIVATE_RESERVE_PORT",
)?)?
Expand Down

0 comments on commit ea449b8

Please sign in to comment.