From 96f94966b7a1343389790d8261e335ce308072b8 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Mon, 6 Nov 2023 18:37:18 -0500 Subject: [PATCH] Restore accidentally deleted function --- coins/ethereum/src/contract.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/coins/ethereum/src/contract.rs b/coins/ethereum/src/contract.rs index bb1cafc1..f952d9d1 100644 --- a/coins/ethereum/src/contract.rs +++ b/coins/ethereum/src/contract.rs @@ -19,6 +19,19 @@ pub enum EthereumError { abigen!(Schnorr, "./artifacts/Schnorr.sol/Schnorr.json"); +pub async fn deploy_schnorr_verifier_contract( + client: Arc, LocalWallet>>, +) -> Result, LocalWallet>>> { + let path = "./artifacts/Schnorr.sol/Schnorr.json"; + let artifact: ContractBytecode = serde_json::from_reader(File::open(path).unwrap()).unwrap(); + let abi = artifact.abi.unwrap(); + let bin = artifact.bytecode.unwrap().object; + let factory = ContractFactory::new(abi, bin.into_bytes().unwrap(), client.clone()); + let contract = factory.deploy(())?.send().await?; + let contract = Schnorr::new(contract.address(), client); + Ok(contract) +} + pub async fn call_verify( contract: &Schnorr, LocalWallet>>, params: &ProcessedSignature,