Skip to content

Commit

Permalink
Modified test raw_call.fe
Browse files Browse the repository at this point in the history
  • Loading branch information
saifkatoutatcom authored and saifalkatout committed Sep 28, 2023
1 parent a7790c2 commit 76483a2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions crates/tests/fixtures/files/raw_call.fe
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
use std::buf::{
RawCallBuffer,
MemoryBufferReader,
MemoryBufferWriter
MemoryBufferWriter,
MemoryBuffer
}
use std::evm

contract Foo {
pub unsafe fn __call__() {
if evm::call_data_load(offset: 0) == 42 {
evm::mstore(offset: 0, value: 26)
evm::return_mem(offset: 0, len: 32)
//evm::mstore(offset: 0, value: 26)
let mut buf:MemoryBuffer = MemoryBuffer::new(
len:32
)
let mut writer: MemoryBufferWriter = buf.writer()
writer.write(value: 26)
evm::return_mem(buf)
} else if evm::call_data_load(offset: 0) == 26 {
revert
}
Expand All @@ -28,7 +34,6 @@ fn test_raw_call(mut ctx: Context) {

writer.write(value: 42)
assert ctx.raw_call(addr: address(foo), value: 0, buf)

let mut reader: MemoryBufferReader = buf.reader()
assert reader.read_u256() == 26

Expand Down

0 comments on commit 76483a2

Please sign in to comment.