Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Add comments to origin/Document-transactionl1_handler module (#888)
Browse files Browse the repository at this point in the history
* added comments to origin/Document-transactionl1_handler-module

* modified comments

* Test multi syscall (#687)

* create multy syscall

* remove the replace syscall, it failed because the contract adress didn't match

* added library call_syscall

* wip

* wip

* wip

* wip

* work in progress

* remove .sjon files from starknet_programs

* finished implemented all the syscalls

* reorder code, create one call to syscall

* fix pull bug

* Update tests/multi_syscall_test.rs

Co-authored-by: Matías Ignacio González <maigonzalez@fi.uba.ar>

* Update starknet_programs/cairo1/multi_syscall_test.cairo

Co-authored-by: Matías Ignacio González <maigonzalez@fi.uba.ar>

* Update starknet_programs/cairo1/contract_a.cairo

Co-authored-by: Matías Ignacio González <maigonzalez@fi.uba.ar>

* Update tests/multi_syscall_test.rs

Co-authored-by: Matías Ignacio González <maigonzalez@fi.uba.ar>

* added test syscall for deploy

* make format changes

* corrected make clippy error

* get_caller_address and get_contract_address return a adress

* failed of get_contract_address

* failed of get_contract_address

* wip

* modify the selector entrypoint_selector to be function specific

* wip

* wip

* wip

* add input to cairo functions

* coorect format problem

* wip

* wip

* wip

* remove format problem

* Fix sierra class hash calculation (#886)

* reproduce bug

* use pythonic formatter

* rename test

* fix test

* cargo fmt

* Fail with an Err transactions whose calculated fee exceed `max_fee` (#892)

* Make tx fail when actual_fee exceeds max_fee

* Changed test

* Formatting

* Fix logic

* Leave fail only without charging

* Change test

* Fix test broken by better fee calc

* Fixed test fee

* Update fee on test_deploy_account

* Remove comment

---------

Co-authored-by: Juan Bono <juanbono94@gmail.com>

* Fix test_get_nonce_at (#910)

* Fix test_get_nonce_at

* Rely on another contract

* fix get_sorted_events bug (#912)

* fix get_sorted_events bug

* fmt

* fix clippy

---------

Co-authored-by: Estéfano Bargas <estefano.bargas@fing.edu.uy>

* Added documentations to syscalls/deprecated_syscall_handler module (#883)

* added comments to file syscalls/deprecated_syscall_handler-module'

* Update src/syscalls/deprecated_syscall_handler.rs

Co-authored-by: Matías Ignacio González <maigonzalez@fi.uba.ar>

* Update src/syscalls/deprecated_syscall_handler.rs

Co-authored-by: Matías Ignacio González <maigonzalez@fi.uba.ar>

---------

Co-authored-by: fannyguthmann <fanny.guthmann@post.idc.ac.il>
Co-authored-by: Juan Bono <juanbono94@gmail.com>
Co-authored-by: Matías Ignacio González <maigonzalez@fi.uba.ar>

* wip

* Modify the tests

* fixed clippy errors

---------

Co-authored-by: fannyguthmann <fanny.guthmann@post.idc.ac.il>
Co-authored-by: Matías Ignacio González <maigonzalez@fi.uba.ar>
Co-authored-by: SantiagoPittella <pittellasantiago@gmail.com>
Co-authored-by: Juan Bono <juanbono94@gmail.com>
Co-authored-by: Estéfano Bargas <estefano.bargas@fing.edu.uy>

* Parse internal calls (#915)

* Added comments to core/contract_address module (#900)

Co-authored-by: fannyguthmann <fanny.guthmann@post.idc.ac.il>

* Add more transaction tests and fee investigation (#914)

* add function for getting tx and refactor tests

* improve imports

* separe tests into 2 groups

* fix test

* add comments

* format

* cargo clippy

* add details to every test

* add fee discrepancy to test doc

* cargo fmt

* improve imports

* added safety element

---------

Co-authored-by: fannyguthmann <fanny.guthmann@post.idc.ac.il>
Co-authored-by: Matías Ignacio González <maigonzalez@fi.uba.ar>
Co-authored-by: SantiagoPittella <pittellasantiago@gmail.com>
Co-authored-by: Juan Bono <juanbono94@gmail.com>
Co-authored-by: Estéfano Bargas <estefano.bargas@fing.edu.uy>
Co-authored-by: Santiago Pittella <87827390+SantiagoPittella@users.noreply.github.com>
  • Loading branch information
7 people committed Nov 20, 2023
1 parent b825aec commit 3065378
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/transaction/l1_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use num_traits::Zero;

#[allow(dead_code)]
#[derive(Debug, Getters, Clone)]
/// Represents an L1Handler transaction in the StarkNet network.
pub struct L1Handler {
#[getset(get = "pub")]
hash_value: Felt252,
Expand All @@ -38,6 +39,7 @@ pub struct L1Handler {
}

impl L1Handler {
/// Constructor creates a new [L1Handler] instance.
pub fn new(
contract_address: Address,
entry_point_selector: Felt252,
Expand Down Expand Up @@ -66,7 +68,12 @@ impl L1Handler {
hash_value,
)
}

/// Creates a new [L1Handler] instance with a specified transaction hash.
///
/// # Safety
///
/// `tx_hash` will be assumed to be the same as would result from calling
/// `calculate_transaction_hash_common`. Non-compliance will result in silent misbehavior.
pub fn new_with_tx_hash(
contract_address: Address,
entry_point_selector: Felt252,
Expand Down Expand Up @@ -191,6 +198,8 @@ impl L1Handler {
L1_HANDLER_VERSION.into(),
))
}

/// Creates a L1Handler for simulation purposes.
pub(crate) fn create_for_simulation(
&self,
skip_validate: bool,
Expand Down Expand Up @@ -234,6 +243,7 @@ mod test {
utils::Address,
};

/// Test the correct execution of the L1Handler.
#[test]
fn test_execute_l1_handler() {
let l1_handler = L1Handler::new(
Expand Down Expand Up @@ -293,6 +303,8 @@ mod test {
assert_eq!(tx_exec, expected_tx_exec)
}

/// Helper function to construct the expected transaction execution info.
/// Expected output of the L1Handler's execution.
fn expected_tx_exec_info() -> TransactionExecutionInfo {
TransactionExecutionInfo {
validate_info: None,
Expand Down

0 comments on commit 3065378

Please sign in to comment.