set chain_id in test runtime

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
Cyrill Leutwiler
2024-09-28 19:17:41 +02:00
parent 287272b789
commit 066acc4663
3 changed files with 18 additions and 1 deletions
+16
View File
@@ -30,6 +30,14 @@ pragma solidity ^0.8;
},
"data": "fc9c8d39"
}
},
{
"Call": {
"dest": {
"Instantiated": 0
},
"data": "3af973b1"
}
}
]
}
@@ -43,4 +51,12 @@ contract Context {
function caller() public view returns (address ret) {
ret = msg.sender;
}
function chain_id() public view returns (uint) {
uint256 id;
assembly {
id := chainid()
}
return id;
}
}