Add EIP-7636 support (#6793)

* Add eip7636 support

* Add `version()` to the `lighthouse_version` crate and make the `enr.rs` file use it.

* Hardcode version, Add `client_name()`, remove unneeded flag.

* Make it use the new function.

* Make cargo fmt zip it
This commit is contained in:
JKinc
2025-01-21 00:24:14 +00:00
committed by GitHub
parent 7a0388ef2a
commit 33c1648022
3 changed files with 34 additions and 1 deletions

View File

@@ -48,6 +48,22 @@ pub fn version_with_platform() -> String {
format!("{}/{}-{}", VERSION, Target::arch(), Target::os())
}
/// Returns semantic versioning information only.
///
/// ## Example
///
/// `1.5.1`
pub fn version() -> &'static str {
"6.0.1"
}
/// Returns the name of the current client running.
///
/// This will usually be "Lighthouse"
pub fn client_name() -> &'static str {
"Lighthouse"
}
#[cfg(test)]
mod test {
use super::*;
@@ -64,4 +80,14 @@ mod test {
VERSION
);
}
#[test]
fn semantic_version_formatting() {
let re = Regex::new(r"^[0-9]+\.[0-9]+\.[0-9]+").unwrap();
assert!(
re.is_match(version()),
"semantic version doesn't match regex: {}",
version()
);
}
}