mirror of
https://github.com/serai-dex/serai.git
synced 2024-11-16 17:07:35 +00:00
Restore accidentally deleted function
This commit is contained in:
parent
b65ba17007
commit
96f94966b7
1 changed files with 13 additions and 0 deletions
|
@ -19,6 +19,19 @@ pub enum EthereumError {
|
|||
|
||||
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)
|
||||
}
|
||||
|
||||
pub async fn call_verify(
|
||||
contract: &Schnorr<SignerMiddleware<Provider<Http>, LocalWallet>>,
|
||||
params: &ProcessedSignature,
|
||||
|
|
Loading…
Reference in a new issue