Skip to content

Commit

Permalink
feat: origin
Browse files Browse the repository at this point in the history
  • Loading branch information
Eikix committed Oct 5, 2023
1 parent 399bde1 commit f96e2f8
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion crates/evm/src/tests/test_execution_context.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ use evm::context::{
use evm::memory::{Memory, MemoryTrait};
use evm::model::Event;
use evm::stack::{Stack, StackTrait};
use evm::tests::test_utils::{setup_call_context, setup_execution_context, CallContextPartialEq};
use evm::tests::test_utils::{
setup_call_context, setup_execution_context, setup_nested_execution_context,
CallContextPartialEq
};
use evm::tests::test_utils;
use starknet::testing::{set_contract_address, set_caller_address};
use starknet::{EthAddress, ContractAddress};
Expand Down Expand Up @@ -166,3 +169,17 @@ fn test_child_return_data() {
// Then
assert(child_return_data == array![1, 2, 3].span(), 'wrong child_return_data');
}


#[test]
#[available_gas(300000)]
fn test_origin() {
// Given
let mut execution_context = setup_nested_execution_context();

// When
let origin = execution_context.origin();

// Then
assert(origin == evm_address(), 'wrong child_return_data');
}

0 comments on commit f96e2f8

Please sign in to comment.