-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ermvrs/main
dev functions for deployment
- Loading branch information
Showing
7 changed files
with
89 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
target | ||
dev_signer | ||
dev_account | ||
dev_account | ||
sepolia | ||
sepolia_account |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
rosettacontracts_integrationtest::factory_tests::deploy_check_initials |
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 +1,30 @@ | ||
use openzeppelin_utils::serde::SerializedAppend; | ||
use rosettacontracts::accounts::base::{RosettaAccount, IRosettaAccountDispatcher, IRosettaAccountDispatcherTrait}; | ||
use rosettacontracts::factory::{Factory, IFactoryDispatcher, IFactoryDispatcherTrait}; | ||
use snforge_std::{declare, get_class_hash, ContractClassTrait, DeclareResultTrait}; | ||
use starknet::{EthAddress}; | ||
|
||
#[test] | ||
fn deploy_check_initials() { | ||
let account_contract_class = declare("RosettaAccount").unwrap().contract_class(); | ||
|
||
let factory_contract_class = declare("Factory").unwrap().contract_class(); | ||
|
||
let mut factory_calldata = array![]; | ||
|
||
factory_calldata.append_serde('123123'); | ||
factory_calldata.append_serde('0'); | ||
|
||
let (factory_contract_address, _) = factory_contract_class.deploy(@factory_calldata).unwrap(); | ||
|
||
let factory_dispatcher = IFactoryDispatcher { contract_address: factory_contract_address }; | ||
|
||
let ethereum_address: EthAddress = 0x11655f4Ee2A5B66F9DCbe758e9FcdCd3eBF95eE5.try_into().unwrap(); | ||
|
||
let precalculated_address = factory_dispatcher.precalculate_starknet_address(ethereum_address); | ||
|
||
let (account_contract_address, _) = account_contract_class.deploy(@array![ethereum_address.into()]).unwrap(); | ||
|
||
assert(precalculated_address == account_contract_address, 'precalculated address wrong'); | ||
// TODO: burayı fixle neden hata dönüyor ve debug print ekle | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### Eth Account used in tests | ||
0x11655f4Ee2A5B66F9DCbe758e9FcdCd3eBF95eE5 | ||
### Test transaction | ||
[ ] Transfer or approve of standard erc20 in starknet | ||
[ ] Account contruction etc. |