-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2b44eb
commit 08209e7
Showing
4 changed files
with
75 additions
and
62 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,32 @@ | ||
import fd58 | ||
import test_suite.invoke_pb2 as invoke_pb | ||
import test_suite.vm_pb2 as vm_pb | ||
import test_suite.context_pb2 as context_pb | ||
|
||
|
||
def transform_fixture(fixture: vm_pb.SyscallFixture): | ||
""" | ||
Example: | ||
accounts = fixture.input.instr_ctx.accounts | ||
program_id = fixture.input.instr_ctx.program_id | ||
program_account = context_pb.AcctState() | ||
program_account.address = program_id | ||
program_account.lamports = 123456789 | ||
program_account.executable = True | ||
program_account.data = b'\x00' * 100 | ||
program_account.rent_epoch = (1 << 64) - 1 | ||
program_account.owner = fd58.dec32(b"BPFLoaderUpgradeab1e11111111111111111111111") | ||
for i in range(len(accounts)): | ||
if accounts[i].address == program_id: | ||
if accounts[i].owner == fd58.dec32(b"BPFLoader1111111111111111111111111111111111"): | ||
return | ||
fixture.input.instr_ctx.accounts[i].CopyFrom(program_account) | ||
return | ||
fixture.input.instr_ctx.accounts.extend([program_account]) | ||
""" | ||
pass |
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