mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Rust 1.80
Preserves the fn accessors within the Monero crates so that we can use statics in some cfgs yet not all (in order to provide support for more low-memory devices) with the exception of `H` (which truly should be cached).
This commit is contained in:
@@ -40,17 +40,14 @@ fn generators(prefix: &'static str, path: &str) {
|
||||
.write_all(
|
||||
format!(
|
||||
"
|
||||
static GENERATORS_CELL: OnceLock<Generators> = OnceLock::new();
|
||||
pub(crate) fn GENERATORS() -> &'static Generators {{
|
||||
GENERATORS_CELL.get_or_init(|| Generators {{
|
||||
G: std_shims::vec![
|
||||
{G_str}
|
||||
],
|
||||
H: std_shims::vec![
|
||||
{H_str}
|
||||
],
|
||||
}})
|
||||
}}
|
||||
pub(crate) static GENERATORS: LazyLock<Generators> = LazyLock::new(|| Generators {{
|
||||
G: std_shims::vec![
|
||||
{G_str}
|
||||
],
|
||||
H: std_shims::vec![
|
||||
{H_str}
|
||||
],
|
||||
}});
|
||||
",
|
||||
)
|
||||
.as_bytes(),
|
||||
@@ -67,12 +64,9 @@ fn generators(prefix: &'static str, path: &str) {
|
||||
.write_all(
|
||||
format!(
|
||||
r#"
|
||||
static GENERATORS_CELL: OnceLock<Generators> = OnceLock::new();
|
||||
pub(crate) fn GENERATORS() -> &'static Generators {{
|
||||
GENERATORS_CELL.get_or_init(|| {{
|
||||
monero_generators::bulletproofs_generators(b"{prefix}")
|
||||
}})
|
||||
}}
|
||||
pub(crate) static GENERATORS: LazyLock<Generators> = LazyLock::new(|| {{
|
||||
monero_generators::bulletproofs_generators(b"{prefix}")
|
||||
}});
|
||||
"#,
|
||||
)
|
||||
.as_bytes(),
|
||||
|
||||
Reference in New Issue
Block a user