-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: initiliased testcases * admin function tests * fix: max total balance check * feat: block token test * disable limit test * feat: add failing tc for withdraw limit * fixed testcases after rebase * chore: added messaging mock * Update src/bridge/token_bridge.cairo Co-authored-by: Apoorv Sadana <[email protected]> * resolve comments * add reactivate and unblock * add reactivate and unblock * unblock tests * reactivate and unblock tests * resolved merge conflicts * make them unit * improve: not needed to deploy usdc in while mock testing --------- Co-authored-by: Apoorv Sadana <[email protected]>
- Loading branch information
1 parent
2b044ad
commit e6d2ab1
Showing
7 changed files
with
264 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,6 @@ pub mod constants; | |
|
||
pub mod mocks { | ||
pub mod erc20; | ||
pub mod messaging; | ||
} | ||
|
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,45 @@ | ||
use piltover::messaging::output_process::MessageToAppchain; | ||
#[starknet::interface] | ||
pub trait IMockMessaging<TState> { | ||
fn update_state_for_message(ref self: TState, message_hash: felt252); | ||
} | ||
|
||
#[starknet::contract] | ||
mod messaging_mock { | ||
use piltover::messaging::{ | ||
output_process::MessageToAppchain, messaging_cpt, | ||
messaging_cpt::InternalTrait as MessagingInternal, IMessaging | ||
}; | ||
use starknet::ContractAddress; | ||
use super::IMockMessaging; | ||
|
||
component!(path: messaging_cpt, storage: messaging, event: MessagingEvent); | ||
|
||
#[abi(embed_v0)] | ||
impl MessagingImpl = messaging_cpt::MessagingImpl<ContractState>; | ||
|
||
#[storage] | ||
struct Storage { | ||
#[substorage(v0)] | ||
messaging: messaging_cpt::Storage | ||
} | ||
|
||
#[event] | ||
#[derive(Drop, starknet::Event)] | ||
enum Event { | ||
#[flat] | ||
MessagingEvent: messaging_cpt::Event | ||
} | ||
|
||
#[constructor] | ||
fn constructor(ref self: ContractState, cancellation_delay_secs: u64) { | ||
self.messaging.initialize(cancellation_delay_secs); | ||
} | ||
|
||
#[abi(embed_v0)] | ||
impl MockMessagingImpl of IMockMessaging<ContractState> { | ||
fn update_state_for_message(ref self: ContractState, message_hash: felt252) { | ||
self.messaging.sn_to_appc_messages.write(message_hash, 0); | ||
} | ||
} | ||
} |
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.