Fix accumulated bugs

This commit is contained in:
Luke Parker
2023-11-06 18:12:53 -05:00
parent c9003874ad
commit b65ba17007
8 changed files with 10 additions and 140 deletions

View File

@@ -17,20 +17,7 @@ pub enum EthereumError {
VerificationError,
}
abigen!(Schnorr, "./artifacts/Schnorr.sol/Schnorr.json",);
pub async fn deploy_schnorr_verifier_contract(
client: Arc<SignerMiddleware<Provider<Http>, LocalWallet>>,
) -> Result<Schnorr<SignerMiddleware<Provider<Http>, 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)
}
abigen!(Schnorr, "./artifacts/Schnorr.sol/Schnorr.json");
pub async fn call_verify(
contract: &Schnorr<SignerMiddleware<Provider<Http>, LocalWallet>>,