File tree Expand file tree Collapse file tree 2 files changed +20
-11
lines changed
Expand file tree Collapse file tree 2 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -153,14 +153,13 @@ fn verify_checksum(bytes: &[u8], expected_checksum: &str) {
153153
154154/// Returns the directory that will be used to store the deposit contract ABI.
155155fn abi_dir ( ) -> PathBuf {
156- let base = env:: var ( "CARGO_MANIFEST_DIR " )
157- . expect ( "should know manifest dir" )
156+ let base = env:: var ( "OUT_DIR " )
157+ . expect ( "should know out dir" )
158158 . parse :: < PathBuf > ( )
159- . expect ( "should parse manifest dir as path" )
160- . join ( "contracts" ) ;
159+ . expect ( "should parse out dir as path" ) ;
161160
162161 std:: fs:: create_dir_all ( base. clone ( ) )
163- . expect ( "should be able to create abi directory in manifest " ) ;
162+ . expect ( "should be able to create abi directory in out dir " ) ;
164163
165164 base
166165}
Original file line number Diff line number Diff line change @@ -44,15 +44,25 @@ impl From<SszDecodeError> for Error {
4444
4545pub const CONTRACT_DEPLOY_GAS : usize = 4_000_000 ;
4646pub const DEPOSIT_GAS : usize = 400_000 ;
47- pub const ABI : & [ u8 ] = include_bytes ! ( "../contracts/v0.12.1_validator_registration.json" ) ;
48- pub const BYTECODE : & [ u8 ] = include_bytes ! ( "../contracts/v0.12.1_validator_registration.bytecode" ) ;
47+ pub const ABI : & [ u8 ] = include_bytes ! ( concat!(
48+ env!( "OUT_DIR" ) ,
49+ "/v0.12.1_validator_registration.json"
50+ ) ) ;
51+ pub const BYTECODE : & [ u8 ] = include_bytes ! ( concat!(
52+ env!( "OUT_DIR" ) ,
53+ "/v0.12.1_validator_registration.bytecode"
54+ ) ) ;
4955pub const DEPOSIT_DATA_LEN : usize = 420 ; // lol
5056
5157pub mod testnet {
52- pub const ABI : & [ u8 ] =
53- include_bytes ! ( "../contracts/v0.12.1_testnet_validator_registration.json" ) ;
54- pub const BYTECODE : & [ u8 ] =
55- include_bytes ! ( "../contracts/v0.12.1_testnet_validator_registration.bytecode" ) ;
58+ pub const ABI : & [ u8 ] = include_bytes ! ( concat!(
59+ env!( "OUT_DIR" ) ,
60+ "/v0.12.1_testnet_validator_registration.json"
61+ ) ) ;
62+ pub const BYTECODE : & [ u8 ] = include_bytes ! ( concat!(
63+ env!( "OUT_DIR" ) ,
64+ "/v0.12.1_testnet_validator_registration.bytecode"
65+ ) ) ;
5666}
5767
5868pub fn encode_eth1_tx_data ( deposit_data : & DepositData ) -> Result < Vec < u8 > , Error > {
You can’t perform that action at this time.
0 commit comments