Skip to content

Commit

Permalink
use v01 chain config for header deserialization for first field
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Jul 29, 2024
1 parent dfe6442 commit dc6e05b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion data/v3/header.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"chain_config": {
"Left": {
"base_fee": "0",
"bid_recipient": null,
"bid_recipient": "0x0000000000000000000000000000000000000000",
"chain_id": "35353",
"fee_contract": "0x0000000000000000000000000000000000000000",
"fee_recipient": "0x0000000000000000000000000000000000000000",
Expand Down
2 changes: 1 addition & 1 deletion sequencer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jf-signature = { workspace = true, features = ["bls", "schnorr"] }
jf-utils = { workspace = true } # TODO temporary: used only for test_rng()
jf-vid = { workspace = true }
libp2p = { workspace = true }
marketplace-solver = { git = "https://github.com/EspressoSystems/marketplace-solver.git", tag = "0.1.1" }
marketplace-solver = { git = "https://github.com/EspressoSystems/marketplace-solver.git", branch = "ab/marketplace-integration" }
num-traits = "0.2.18"
num_enum = "0.7"
paste = { workspace = true }
Expand Down
13 changes: 9 additions & 4 deletions types/src/reference_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn reference_chain_config() -> ChainConfig {
base_fee: 0.into(),
fee_contract: Some(Default::default()),
fee_recipient: Default::default(),
bid_recipient: None,
bid_recipient: Some(Default::default()),
}
}

Expand Down Expand Up @@ -151,7 +151,7 @@ async fn reference_header(version: Version) -> Header {

const REFERENCE_V1_HEADER_COMMITMENT: &str = "BLOCK~dh1KpdvvxSvnnPpOi2yI3DOg8h6ltr2Kv13iRzbQvtN2";
const REFERENCE_V2_HEADER_COMMITMENT: &str = "BLOCK~V0GJjL19nCrlm9n1zZ6gaOKEekSMCT6uR5P-h7Gi6UJR";
const REFERENCE_V3_HEADER_COMMITMENT: &str = "BLOCK~pD6_in2J8VzT6SshvvFUkNyMbx_h_gTtlU3WTmC6WedD";
const REFERENCE_V3_HEADER_COMMITMENT: &str = "BLOCK~oqbUzqJdG4JfWCDpCQWsLDjb47Rx_OH6KVsKQFOl4S2n";

fn reference_transaction<R>(ns_id: NamespaceId, rng: &mut R) -> Transaction
where
Expand Down Expand Up @@ -343,29 +343,34 @@ fn test_reference_fee_info() {
}

#[async_std::test]
async fn test_reference_header() {
async fn test_reference_header_v1() {
reference_test(
"v1",
"header",
reference_header(StaticVersion::<0, 1>::version()).await,
REFERENCE_V1_HEADER_COMMITMENT,
);
}

#[async_std::test]
async fn test_reference_header_v2() {
reference_test(
"v2",
"header",
reference_header(StaticVersion::<0, 2>::version()).await,
REFERENCE_V2_HEADER_COMMITMENT,
);
}

#[async_std::test]
async fn test_reference_header_v3() {
reference_test(
"v3",
"header",
reference_header(StaticVersion::<0, 3>::version()).await,
REFERENCE_V3_HEADER_COMMITMENT,
);
}

#[test]
fn test_reference_transaction() {
reference_test(
Expand Down
3 changes: 2 additions & 1 deletion types/src/v0/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use vbs::version::Version;

use crate::{
v0_1::{self, ChainConfig},
v0_2, v0_3,
v0_2,
v0_3::{self},
};

/// Each variant represents a specific minor version header.
Expand Down

0 comments on commit dc6e05b

Please sign in to comment.