-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from DanielSchiavini/fix/deployment-rpc
fix: deployment issue for production RPC
- Loading branch information
Showing
5 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import boa | ||
|
||
from boa_zksync.types import ZksyncComputation | ||
|
||
_required_fields = {"gas": "0x0", "value": "0x0", "input": "0x00", "gasUsed": "0x0"} | ||
|
||
|
||
def test_from_debug_trace_nested(): | ||
sender = boa.env.generate_address() | ||
to = boa.env.generate_address() | ||
result = boa.env.generate_address().canonical_address | ||
output = { | ||
"from": sender, | ||
"to": to, | ||
"output": boa.env.generate_address(), | ||
"calls": [ | ||
{ | ||
"from": boa.env.generate_address(), | ||
"to": boa.env.generate_address(), | ||
"output": boa.env.generate_address(), | ||
"calls": [], | ||
**_required_fields, | ||
}, | ||
{ | ||
"from": sender, | ||
"to": to, | ||
"output": "0x" + result.hex(), | ||
"calls": [], | ||
**_required_fields, | ||
}, | ||
{ | ||
"from": boa.env.generate_address(), | ||
"to": boa.env.generate_address(), | ||
"output": boa.env.generate_address(), | ||
"calls": [], | ||
**_required_fields, | ||
}, | ||
], | ||
} | ||
assert ZksyncComputation.from_debug_trace(output).output == result | ||
|
||
|
||
def test_from_debug_trace_production_mode(): | ||
# in production the real transaction output is directly in the result | ||
# when running via the era test node, more contracts are actually included | ||
result = boa.env.generate_address().canonical_address | ||
output = { | ||
"from": boa.env.generate_address(), | ||
"to": boa.env.generate_address(), | ||
"output": "0x" + result.hex(), | ||
"calls": [], | ||
**_required_fields, | ||
} | ||
assert ZksyncComputation.from_debug_trace(output).output == result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.