-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support in test environment for sepolia network (#793)
- Loading branch information
Showing
10 changed files
with
216 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,141 +1,22 @@ | ||
use beerus::gen::{ | ||
Address, BroadcastedDeclareTxn, BroadcastedDeclareTxnV3, | ||
BroadcastedDeclareTxnV3Type, BroadcastedDeclareTxnV3Version, | ||
BroadcastedDeployAccountTxn, BroadcastedInvokeTxn, BroadcastedTxn, | ||
ContractClass, ContractClassEntryPointsByType, DaMode, DeployAccountTxn, | ||
DeployAccountTxnV3, DeployAccountTxnV3Type, DeployAccountTxnV3Version, | ||
Felt, InvokeTxn, InvokeTxnV3, InvokeTxnV3Type, InvokeTxnV3Version, | ||
ResourceBounds, ResourceBoundsMapping, SierraEntryPoint, U128, U64, | ||
}; | ||
|
||
#[allow(dead_code)] | ||
pub fn declare_transaction() -> BroadcastedDeclareTxn { | ||
BroadcastedDeclareTxn::BroadcastedDeclareTxnV3( | ||
dummy_declare_transaction_v3(), | ||
) | ||
} | ||
|
||
pub const COMPILED_ACCOUNT_CONTRACT_V2: &str = | ||
include_str!("../clob/compiled_account_contract_v2.txt"); | ||
#[allow(dead_code)] | ||
pub fn estimate_fee_transaction() -> BroadcastedTxn { | ||
BroadcastedTxn::BroadcastedDeclareTxn( | ||
BroadcastedDeclareTxn::BroadcastedDeclareTxnV3( | ||
dummy_declare_transaction_v3(), | ||
), | ||
) | ||
} | ||
|
||
pub const COMPILED_ACCOUNT_CONTRACT_V3: &str = | ||
include_str!("../clob/compiled_account_contract_v3.txt"); | ||
#[allow(dead_code)] | ||
pub fn invoke_transaction() -> BroadcastedInvokeTxn { | ||
BroadcastedInvokeTxn(InvokeTxn::InvokeTxnV3(dummy_invoke_transaction_v3())) | ||
} | ||
|
||
pub const DECLARE_ACCOUNT_V2: &str = | ||
include_str!("../clob/declare_account_v2.txt"); | ||
#[allow(dead_code)] | ||
pub fn deploy_transaction() -> BroadcastedDeployAccountTxn { | ||
BroadcastedDeployAccountTxn(DeployAccountTxn::DeployAccountTxnV3( | ||
dummy_deploy_transaction_v3(), | ||
)) | ||
} | ||
pub const DECLARE_ACCOUNT_V3: &str = | ||
include_str!("../clob/declare_account_v3.txt"); | ||
|
||
#[allow(dead_code)] | ||
fn dummy_declare_transaction_v3() -> BroadcastedDeclareTxnV3 { | ||
BroadcastedDeclareTxnV3 { | ||
account_deployment_data: vec![Felt::try_new("0x0").unwrap()], | ||
compiled_class_hash: Felt::try_new("0x0").unwrap(), | ||
contract_class: ContractClass { | ||
sierra_program: vec![Felt::try_new("0x1").unwrap()], | ||
contract_class_version: "0.1.0".to_string(), | ||
entry_points_by_type: ContractClassEntryPointsByType { | ||
constructor: vec![SierraEntryPoint { | ||
selector: Felt::try_new("0x2").unwrap(), | ||
function_idx: 2, | ||
}], | ||
external: vec![ | ||
SierraEntryPoint { | ||
selector: Felt::try_new("0x3").unwrap(), | ||
function_idx: 3, | ||
}, | ||
SierraEntryPoint { | ||
selector: Felt::try_new("0x4").unwrap(), | ||
function_idx: 4, | ||
}, | ||
], | ||
l1_handler: vec![], | ||
}, | ||
abi: Some("some_abi".to_string()), | ||
}, | ||
fee_data_availability_mode: DaMode::L1, | ||
nonce: Felt::try_new("0x0").unwrap(), | ||
r#type: BroadcastedDeclareTxnV3Type::Declare, | ||
signature: vec![Felt::try_new("0x5").unwrap()], | ||
sender_address: Address(Felt::try_new("0x6").unwrap()), | ||
version: | ||
BroadcastedDeclareTxnV3Version::V0x100000000000000000000000000000003, | ||
nonce_data_availability_mode: DaMode::L1, | ||
paymaster_data: vec![Felt::try_new("0x7").unwrap()], | ||
resource_bounds: ResourceBoundsMapping { | ||
l1_gas: ResourceBounds { | ||
max_amount: U64::try_new("0x0").unwrap(), | ||
max_price_per_unit: U128::try_new("0x0").unwrap(), | ||
}, | ||
l2_gas: ResourceBounds { | ||
max_amount: U64::try_new("0x0").unwrap(), | ||
max_price_per_unit: U128::try_new("0x0").unwrap(), | ||
}, | ||
}, | ||
tip: U64::try_new("0x0").unwrap(), | ||
} | ||
} | ||
|
||
pub const CLASS_HASH: &str = | ||
"0x6b46f84b1bbb779e588a9c5f577907c3dfb66e6b13cf4c4f480d4fb1677c2ba"; | ||
#[allow(dead_code)] | ||
fn dummy_invoke_transaction_v3() -> InvokeTxnV3 { | ||
InvokeTxnV3 { | ||
account_deployment_data: vec![Felt::try_new("0x0").unwrap()], | ||
calldata: vec![Felt::try_new("0x1").unwrap()], | ||
fee_data_availability_mode: DaMode::L1, | ||
nonce: Felt::try_new("0x2").unwrap(), | ||
nonce_data_availability_mode: DaMode::L1, | ||
paymaster_data: vec![Felt::try_new("0x1").unwrap()], | ||
r#type: InvokeTxnV3Type::Invoke, | ||
resource_bounds: ResourceBoundsMapping { | ||
l1_gas: ResourceBounds { | ||
max_amount: U64::try_new("0x0").unwrap(), | ||
max_price_per_unit: U128::try_new("0x0").unwrap(), | ||
}, | ||
l2_gas: ResourceBounds { | ||
max_amount: U64::try_new("0x0").unwrap(), | ||
max_price_per_unit: U128::try_new("0x0").unwrap(), | ||
}, | ||
}, | ||
sender_address: Address(Felt::try_new("0x3").unwrap()), | ||
signature: vec![Felt::try_new("0x4").unwrap()], | ||
tip: U64::try_new("0x0").unwrap(), | ||
version: InvokeTxnV3Version::V0x3, | ||
} | ||
} | ||
|
||
pub const CONTRACT_ADDRESS: &str = | ||
"0x5f177e96c32bcc09607d9e2adf1864b8a8dc54c7fb5a283afac58f2b6ddc7da"; | ||
#[allow(dead_code)] | ||
fn dummy_deploy_transaction_v3() -> DeployAccountTxnV3 { | ||
DeployAccountTxnV3 { | ||
class_hash: Felt::try_new("0x0").unwrap(), | ||
constructor_calldata: vec![Felt::try_new("0x1").unwrap()], | ||
contract_address_salt: Felt::try_new("0x2").unwrap(), | ||
fee_data_availability_mode: DaMode::L1, | ||
nonce: Felt::try_new("0x3").unwrap(), | ||
nonce_data_availability_mode: DaMode::L1, | ||
paymaster_data: vec![Felt::try_new("0x4").unwrap()], | ||
r#type: DeployAccountTxnV3Type::DeployAccount, | ||
resource_bounds: ResourceBoundsMapping { | ||
l1_gas: ResourceBounds { | ||
max_amount: U64::try_new("0x0").unwrap(), | ||
max_price_per_unit: U128::try_new("0x0").unwrap(), | ||
}, | ||
l2_gas: ResourceBounds { | ||
max_amount: U64::try_new("0x0").unwrap(), | ||
max_price_per_unit: U128::try_new("0x0").unwrap(), | ||
}, | ||
}, | ||
signature: vec![Felt::try_new("0x5").unwrap()], | ||
tip: U64::try_new("0x0").unwrap(), | ||
version: DeployAccountTxnV3Version::V0x3, | ||
} | ||
} | ||
pub const SENDER_ADDRESS: &str = | ||
"0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.