-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: add Makefile for testing events only
- Loading branch information
Showing
5 changed files
with
622 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
config := --account katana-0 \ | ||
--rpc http://0.0.0.0:7777 | ||
|
||
ob_cl = $(shell starkli class-hash target/dev/arkchain_orderbook.contract_class.json) | ||
ob_cl = $(shell starkli class-hash target/dev/arkchain_orderbook_event_mock.contract_class.json) | ||
ob_addr = 0x045dd7f47f2621491763ebf2095de7b4535487e3ffacde139a832c547c994a2f | ||
|
||
generate_artifacts: | ||
scarb build | ||
mkdir -p ../../../artifacts | ||
# For now, the json is duplicated to be able to run | ||
# cargo build -p diri from here, and from ark-services too. | ||
jq .abi ./target/dev/arkchain_orderbook.contract_class.json > ../../../artifacts/orderbook.json | ||
jq .abi ./target/dev/arkchain_orderbook.contract_class.json > ../../diri/artifacts/orderbook.json | ||
|
||
# Using max-fee 0 avoids starkli to run estimate_fee before actually sending the tx. | ||
# There are no fees on Solis. | ||
setup_orderbook: | ||
setup_orderbook_events: | ||
scarb build | ||
starkli declare target/dev/arkchain_orderbook.contract_class.json ${config} | ||
starkli deploy ${ob_cl} 0x517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973 ${config} --max-fee 0 --salt 0x1234 | ||
starkli declare target/dev/arkchain_orderbook_event_mock.contract_class.json ${config} | ||
starkli deploy ${ob_cl} ${config} --max-fee 0 --salt 0x1234 | ||
|
||
invoke_create_order: | ||
starkli invoke \ | ||
0x024df499c7b1b14c0e52ea237e26a7401ef70507cf72eaef105316dfb5a207a7 \ | ||
create_order \ | ||
0 0x1 0x2 0x3 0x4 0x5 0x6 u256:0x7 u256:0x1 u256:0x1 u256:0x2 10000 20000 str:broker 0 \ | ||
0x1 0x2 0x3 \ | ||
--max-fee-raw 10581100000000000 | ||
starkli invoke ${ob_addr} emit_order_placed ${config} | ||
starkli invoke ${ob_addr} emit_order_cancelled ${config} | ||
starkli invoke ${ob_addr} emit_order_fulfilled ${config} |
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
Oops, something went wrong.