mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
OUT_DIR > artifacts
This commit is contained in:
@@ -6,7 +6,7 @@ license = "AGPL-3.0-only"
|
||||
repository = "https://github.com/serai-dex/serai/tree/develop/networks/ethereum/schnorr"
|
||||
authors = ["Luke Parker <lukeparker5132@gmail.com>", "Elizabeth Binks <elizabethjbinks@gmail.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.79"
|
||||
rust-version = "1.81"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
use std::{env, fs};
|
||||
|
||||
fn main() {
|
||||
build_solidity_contracts::build("contracts", "artifacts").unwrap();
|
||||
let artifacts_path = env::var("OUT_DIR").unwrap().to_string() + "/ethereum-schnorr-contract";
|
||||
if !fs::exists(&artifacts_path).unwrap() {
|
||||
fs::create_dir(&artifacts_path).unwrap();
|
||||
}
|
||||
build_solidity_contracts::build("contracts", &artifacts_path).unwrap();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
/// The initialization bytecode of the Schnorr library.
|
||||
pub const INIT_BYTECODE: &str = include_str!("../artifacts/Schnorr.bin");
|
||||
pub const INIT_BYTECODE: &str =
|
||||
include_str!(concat!(env!("OUT_DIR"), "/ethereum-schnorr-contract/Schnorr.bin"));
|
||||
|
||||
mod public_key;
|
||||
pub use public_key::PublicKey;
|
||||
|
||||
@@ -17,11 +17,11 @@ use alloy_node_bindings::{Anvil, AnvilInstance};
|
||||
|
||||
use crate::{PublicKey, Signature};
|
||||
|
||||
#[allow(warnings)]
|
||||
#[allow(needless_pass_by_value)]
|
||||
#[allow(clippy::all)]
|
||||
#[allow(clippy::ignored_unit_patterns)]
|
||||
#[allow(clippy::redundant_closure_for_method_calls)]
|
||||
#[expect(warnings)]
|
||||
#[expect(needless_pass_by_value)]
|
||||
#[expect(clippy::all)]
|
||||
#[expect(clippy::ignored_unit_patterns)]
|
||||
#[expect(clippy::redundant_closure_for_method_calls)]
|
||||
mod abi {
|
||||
alloy_sol_types::sol!("contracts/tests/Schnorr.sol");
|
||||
pub(crate) use TestSchnorr::*;
|
||||
@@ -40,7 +40,14 @@ async fn setup_test() -> (AnvilInstance, Arc<RootProvider<SimpleRequest>>, Addre
|
||||
let _: () = provider
|
||||
.raw_request(
|
||||
"anvil_setCode".into(),
|
||||
[address.to_string(), include_str!("../artifacts/TestSchnorr.bin-runtime").to_string()],
|
||||
[
|
||||
address.to_string(),
|
||||
include_str!(concat!(
|
||||
env!("OUT_DIR"),
|
||||
"/ethereum-schnorr-contract/TestSchnorr.bin-runtime"
|
||||
))
|
||||
.to_string(),
|
||||
],
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user