mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 13:09:24 +00:00
* start Router contract * use calldata for function args * var name changes * start testing router contract * test with and without abi.encode * cleanup * why tf isn't tests/utils working * cleanup tests * remove unused files * wip * fix router contract and tests, add set/update public keys funcs * impl some Froms * make execute non-reentrant * cleanup * update Router to use ReentrancyGuard * update contract to use errors, use bitfield in Executed event, minor other fixes * wip * fix build issues from merge, tests ok * Router.sol cleanup * cleanup, uncomment stuff * bump ethers.rs version to latest * make contract functions take generic middleware * update build script to assert no compiler errors * hardcode pubkey parity into contract, update tests * Polish coins/ethereum in various ways --------- Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
31 lines
1010 B
Rust
31 lines
1010 B
Rust
pub use crate::abi::router::*;
|
|
|
|
/*
|
|
use crate::crypto::{ProcessedSignature, PublicKey};
|
|
use ethers::{contract::ContractFactory, prelude::*, solc::artifacts::contract::ContractBytecode};
|
|
use eyre::Result;
|
|
use std::{convert::From, fs::File, sync::Arc};
|
|
|
|
pub async fn router_update_public_key<M: Middleware + 'static>(
|
|
contract: &Router<M>,
|
|
public_key: &PublicKey,
|
|
signature: &ProcessedSignature,
|
|
) -> std::result::Result<Option<TransactionReceipt>, eyre::ErrReport> {
|
|
let tx = contract.update_public_key(public_key.px.to_bytes().into(), signature.into());
|
|
let pending_tx = tx.send().await?;
|
|
let receipt = pending_tx.await?;
|
|
Ok(receipt)
|
|
}
|
|
|
|
pub async fn router_execute<M: Middleware + 'static>(
|
|
contract: &Router<M>,
|
|
txs: Vec<Rtransaction>,
|
|
signature: &ProcessedSignature,
|
|
) -> std::result::Result<Option<TransactionReceipt>, eyre::ErrReport> {
|
|
let tx = contract.execute(txs, signature.into()).send();
|
|
let pending_tx = tx.send().await?;
|
|
let receipt = pending_tx.await?;
|
|
Ok(receipt)
|
|
}
|
|
*/
|