-
Notifications
You must be signed in to change notification settings - Fork 11
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 #9 from mdehoog/refcell/client_block_tests
Feat: Client Blocks Test Happy Path
- Loading branch information
Showing
2 changed files
with
176 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
request_funds(1){ | ||
find_account{ | ||
currency = {"symbol":"ETH", "decimals":18}; | ||
random_account = find_balance({ | ||
"minimum_balance":{ | ||
"value": "0", | ||
"currency": {{currency}} | ||
}, | ||
"create_limit":1 | ||
}); | ||
}, | ||
// Create a separate scenario to request funds so that | ||
// the address we are using to request funds does not | ||
// get rolled back if funds do not yet exist. | ||
request{ | ||
loaded_account = find_balance({ | ||
"account_identifier": {{random_account.account_identifier}}, | ||
"minimum_balance":{ | ||
"value": "10000000000000", | ||
"currency": {{currency}} | ||
} | ||
}); | ||
} | ||
} | ||
transfer(1){ | ||
transfer{ | ||
transfer.network = {"network":"Goerli", "blockchain":"Optimism"}; | ||
currency = {"symbol":"ETH", "decimals":18}; | ||
sender = {"address":"0x791Ab321d86Ca11feD3AfDff3e1b6bAD093d1220"}; | ||
// Set the recipient_amount as some value <= sender.balance-max_fee | ||
max_fee = "84000000000000"; | ||
recipient_amount = random_number({"minimum": "100000000000000", "maximum": "1000000000000000"}); | ||
print_message({"recipient_amount":{{recipient_amount}}}); | ||
// Find recipient and construct operations | ||
sender_amount = 0 - {{recipient_amount}}; | ||
recipient = {"address":"0x622Fbe99b3A378FAC736bf29d7e23B85E18816eB"}; | ||
transfer.confirmation_depth = "1"; | ||
transfer.operations = [ | ||
{ | ||
"operation_identifier":{"index":0}, | ||
"type":"CALL", | ||
"account":{{sender}}, | ||
"amount":{ | ||
"value":{{sender_amount}}, | ||
"currency":{{currency}} | ||
} | ||
}, | ||
{ | ||
"operation_identifier":{"index":1}, | ||
"type":"CALL", | ||
"account":{{recipient}}, | ||
"amount":{ | ||
"value":{{recipient_amount}}, | ||
"currency":{{currency}} | ||
} | ||
} | ||
]; | ||
} | ||
} | ||
erc20_transfer(1){ | ||
transfer{ | ||
transfer.network = {"network":"Goerli", "blockchain":"Optimism"}; | ||
currency = {"symbol":"USDC", "decimals":6,"metadata": {"token_address": "0x62F3712A8A2bF3482F9Aa42F2C8296CF50774DDD"}}; | ||
sender = {"address":"0x4cdBd835fE18BD93ccA39A262Cff72dbAC99E24F"}; | ||
// Set the recipient_amount as some value <= sender.balance-max_fee | ||
max_fee = "84000000000000"; | ||
recipient_amount = "888"; | ||
print_message({"recipient_amount":{{recipient_amount}}}); | ||
// Find recipient and construct operations | ||
sender_amount = 0 - {{recipient_amount}}; | ||
recipient = {"address":"0x622Fbe99b3A378FAC736bf29d7e23B85E18816eB"}; | ||
transfer.confirmation_depth = "1"; | ||
transfer.operations = [ | ||
{ | ||
"operation_identifier":{"index":0}, | ||
"type":"PAYMENT", | ||
"account":{{sender}}, | ||
"amount":{ | ||
"value":{{sender_amount}}, | ||
"currency":{{currency}} | ||
} | ||
}, | ||
{ | ||
"operation_identifier":{"index":1}, | ||
"type":"PAYMENT", | ||
"account":{{recipient}}, | ||
"amount":{ | ||
"value":{{recipient_amount}}, | ||
"currency":{{currency}} | ||
} | ||
} | ||
]; | ||
} | ||
} |
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