diff --git a/README.md b/README.md index 6995a9fd86..cd7cb0ff56 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ Then: ```sh git clone https://github.com/astriaorg/astria.git cd astria +git submodule update --init cargo build --release ``` diff --git a/crates/astria-bridge-withdrawer/build.rs b/crates/astria-bridge-withdrawer/build.rs index 18a400b907..9aea5056e2 100644 --- a/crates/astria-bridge-withdrawer/build.rs +++ b/crates/astria-bridge-withdrawer/build.rs @@ -1,32 +1,42 @@ +use std::path::Path; + use ethers::contract::Abigen; +fn emit_rerun_if_changed(file: &str) { + assert!( + Path::new(file).is_file(), + "rerun-if-changed file does not exist at `{file}`" + ); + println!("cargo:rerun-if-changed={file}"); +} + fn main() -> Result<(), Box> { astria_build_info::emit("bridge-withdrawer-v")?; - println!("cargo:rerun-if-changed=ethereum/src/AstriaWithdrawer.sol"); - println!("cargo:rerun-if-changed=ethereum/src/IAstriaWithdrawer.sol"); - println!("cargo:rerun-if-changed=ethereum/src/AstriaBridgeableERC20.sol"); + emit_rerun_if_changed("astria-bridge-contracts/src/AstriaWithdrawer.sol"); + emit_rerun_if_changed("astria-bridge-contracts/src/IAstriaWithdrawer.sol"); + emit_rerun_if_changed("astria-bridge-contracts/src/AstriaBridgeableERC20.sol"); Abigen::new( "IAstriaWithdrawer", - "./astria-bridge-contracts/out/IAstriaWithdrawer.sol/IAstriaWithdrawer.json", + "astria-bridge-contracts/out/IAstriaWithdrawer.sol/IAstriaWithdrawer.json", )? .generate()? - .write_to_file("./src/bridge_withdrawer/ethereum/generated/astria_withdrawer_interface.rs")?; + .write_to_file("src/bridge_withdrawer/ethereum/generated/astria_withdrawer_interface.rs")?; Abigen::new( "AstriaWithdrawer", - "./astria-bridge-contracts/out/AstriaWithdrawer.sol/AstriaWithdrawer.json", + "astria-bridge-contracts/out/AstriaWithdrawer.sol/AstriaWithdrawer.json", )? .generate()? - .write_to_file("./src/bridge_withdrawer/ethereum/generated/astria_withdrawer.rs")?; + .write_to_file("src/bridge_withdrawer/ethereum/generated/astria_withdrawer.rs")?; Abigen::new( "AstriaBridgeableERC20", - "./astria-bridge-contracts/out/AstriaBridgeableERC20.sol/AstriaBridgeableERC20.json", + "astria-bridge-contracts/out/AstriaBridgeableERC20.sol/AstriaBridgeableERC20.json", )? .generate()? - .write_to_file("./src/bridge_withdrawer/ethereum/generated/astria_bridgeable_erc20.rs")?; + .write_to_file("src/bridge_withdrawer/ethereum/generated/astria_bridgeable_erc20.rs")?; Ok(()) }