mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-05-01 06:27:55 +00:00
implement address and msg.sender
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use alloy_primitives::{FixedBytes, Keccak256, I256, U256};
|
||||
use alloy_primitives::{Address, FixedBytes, Keccak256, I256, U256};
|
||||
use alloy_sol_types::{sol, SolCall};
|
||||
use sha1::Digest;
|
||||
|
||||
@@ -280,3 +280,19 @@ fn block_timestamp() {
|
||||
let expected = U256::from(mock_runtime::State::BLOCK_TIMESTAMP);
|
||||
assert_eq!(received, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn address() {
|
||||
let state = assert_success(Contract::context_address(), true);
|
||||
let received = Address::from_slice(&state.output.data[12..]);
|
||||
let expected = Address::from(&mock_runtime::State::ADDRESS);
|
||||
assert_eq!(received, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn caller() {
|
||||
let state = assert_success(Contract::context_caller(), true);
|
||||
let received = Address::from_slice(&state.output.data[12..]);
|
||||
let expected = Address::from(&mock_runtime::State::CALLER);
|
||||
assert_eq!(received, expected);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user