Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning res.result on Transaction Call #5

Merged
merged 4 commits into from
Dec 13, 2023

Conversation

elicbarbieri
Copy link
Contributor

Added the runtime for the FullMath.sol contract (used by UniV3) to tests.

pytest/test.py Outdated
evm.insert_account_info(address, AccountInfo(code=load_contract_bin("full_math.bin")))

# mulDivRoundingUp() -> 64 * 8 / 3
result = evm.call_raw(caller=address2, to=address, data=bytes.fromhex(f"0af8b27f{encode_uint(64)}{encode_uint(8)}{encode_uint(3)}"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result = evm.call_raw(caller=address2, to=address, data=bytes.fromhex(f"0af8b27f{encode_uint(64)}{encode_uint(8)}{encode_uint(3)}"))
result = evm.call_raw_committing(caller=address2, to=address, data=bytes.fromhex(f"0af8b27f{encode_uint(64)}{encode_uint(8)}{encode_uint(3)}"))

src/evm.rs Outdated
@@ -137,7 +137,7 @@ impl EVM {
to: &str,
value: Option<U256>,
data: Option<Vec<u8>>,
) -> PyResult<()> {
) -> PyResult<String> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be left as a byte array so that it can be converted with int.frombytes(..., byteorder='big')

@gakonst gakonst merged commit 8bee707 into paradigmxyz:master Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants