-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make genesis block timestamp hardcoded. (#2476)
Genesis block need to always have the same timestamp. We updated `formats` that changed the leap seconds and changed the timestamp of genesis. This PR hardcode it forever. ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [x] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [x] I have created follow-up issues caused by this PR and linked them here --------- Co-authored-by: Green Baneling <[email protected]>
- Loading branch information
1 parent
f9f719a
commit 96a16cc
Showing
8 changed files
with
63 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#![allow(non_snake_case)] | ||
use crate::tests_helper::{ | ||
LatestFuelCoreDriver, | ||
IGNITION_TESTNET_SNAPSHOT, | ||
}; | ||
use latest_fuel_core_type::fuel_tx::Bytes32; | ||
use std::str::FromStr; | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn test__genesis_block__hash() { | ||
// Given | ||
let latest_node = LatestFuelCoreDriver::spawn(&[ | ||
"--debug", | ||
"--poa-instant", | ||
"true", | ||
"--snapshot", | ||
IGNITION_TESTNET_SNAPSHOT, | ||
"--enable-relayer", | ||
"--relayer", | ||
"https://google.com", | ||
"--relayer-da-deploy-height", | ||
"5791365", | ||
"--relayer-v2-listening-contracts", | ||
"0x768f9459E3339A1F7d59CcF24C80Eb4A711a01FB", | ||
]) | ||
.await | ||
.unwrap(); | ||
|
||
// When | ||
let original_block = latest_node | ||
.client | ||
.block_by_height(0u32.into()) | ||
.await | ||
.expect("Failed to get blocks") | ||
.expect("Genesis block should exists"); | ||
// Then | ||
// The hash of the genesis block should always be | ||
// `0x19ac99bf59711aca047b28443e599e26f733291c2fa45f5f309b2c5c9712b215` | ||
// regardless of the changes that we made. | ||
assert_eq!( | ||
original_block.id, | ||
Bytes32::from_str( | ||
"0x19ac99bf59711aca047b28443e599e26f733291c2fa45f5f309b2c5c9712b215" | ||
) | ||
.unwrap() | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters