Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Predeploy token fee and account contracts #115

Merged
merged 62 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
d4fd6b4
Predeploy fee token [skip ci]
FabijanC Apr 4, 2022
da569bb
Predeploy account [skip ci]
FabijanC Apr 5, 2022
da5c9c9
Add initial_balance to accounts (WIP)
FabijanC Apr 7, 2022
ee33376
Introduce predeployment CLI options (WIP) [skip ci]
FabijanC Apr 8, 2022
6eba25c
Create StarknetContract instance (WIP) [skip ci]
FabijanC Apr 14, 2022
c150ea6
Merge branch 'master' into predeploy
FabijanC May 9, 2022
138075d
Merge branch 'master' into predeploy
FabijanC May 16, 2022
edce3ba
Fix contract definition and address for fee token
FabijanC May 16, 2022
e0ab460
Merge branch 'master' into predeploy
FabijanC May 17, 2022
dfa2586
Merge branch 'master' into predeploy
FabijanC May 18, 2022
aee8221
Correctly handle uint256; set gas_price on block
FabijanC May 19, 2022
36a57c4
Merge branch 'master' into predeploy
FabijanC May 23, 2022
01bb841
Refactor wrapper initialization
FabijanC May 23, 2022
dd37930
Remove custom fee check
FabijanC May 23, 2022
ba089ff
Support getting account balance
FabijanC May 23, 2022
1229dcf
Merge branch 'master' into predeploy
FabijanC May 24, 2022
577dc0f
Remove debug info from erc20 artifact
FabijanC May 26, 2022
d24af2c
Cleanup TODOs
FabijanC May 26, 2022
97d183c
Allow int or float for gas_price and balance
FabijanC May 26, 2022
95d3dce
Start testing
FabijanC May 26, 2022
14f25b4
Merge branch 'master' into predeploy
FabijanC May 26, 2022
36f90b0
Fix reset
FabijanC May 27, 2022
bbd03cc
Merge branch 'master' into predeploy
FabijanC May 27, 2022
b9a4df1
Improve clean-up in dump tests
FabijanC May 27, 2022
6981557
Fix cleanup in postman test
FabijanC May 27, 2022
9c34909
Fix initialization
FabijanC May 27, 2022
1fad647
Fix fee estimation
FabijanC May 31, 2022
d6ceeb2
Issue a warning for a parsing imprecision
FabijanC May 31, 2022
4b600f5
Remove logging of token address
FabijanC May 31, 2022
e6232f8
Merge branch 'master' into predeploy
FabijanC May 31, 2022
04189a1
Use correct value for cairo_resource_fee_weights.n_steps
FabijanC May 31, 2022
6855193
Fix capturing devnet output in tests
FabijanC May 31, 2022
e0bdaee
Merge branch 'master' into predeploy (poetry.lock invalid)
FabijanC May 31, 2022
d0de253
Update content-hash in poetry.lock
FabijanC May 31, 2022
8f9e026
Test with resource_class: large
FabijanC May 31, 2022
6e01631
Revert to resource_class: medium
FabijanC Jun 1, 2022
fa1044b
Sleep 10 seconds in run_devnet_in_background
FabijanC Jun 1, 2022
bb6f1c1
Revert to 5 seconds sleep; Remove children killing in dumping tests
FabijanC Jun 1, 2022
a6b9975
Assure devnet is killed in dumping tests
FabijanC Jun 1, 2022
d101f6c
Change killing in postman test
FabijanC Jun 1, 2022
dce713e
Check fee charged in test
FabijanC Jun 1, 2022
78f8ecc
Test with parallel: false
FabijanC Jun 1, 2022
cf1c0e8
Revert to parallel: true
FabijanC Jun 1, 2022
a5fc16d
Extend timeouts
FabijanC Jun 1, 2022
c024d1d
Test without parallelization
FabijanC Jun 1, 2022
39fcac4
Modify timeouts; modify killing in postman
FabijanC Jun 1, 2022
6136964
Use parallelism: 1
FabijanC Jun 1, 2022
3caba1c
Update docs [skip ci]
FabijanC Jun 1, 2022
8369520
Update docs; rename get_account_balance
FabijanC Jun 2, 2022
352a401
Do lazy loading of definition in Account and FeeToken
FabijanC Jun 2, 2022
d9cbb17
Fix last commit
FabijanC Jun 2, 2022
399cad5
Fix lazy loading of account and fee token
FabijanC Jun 2, 2022
1750b02
Improve comments
FabijanC Jun 2, 2022
cf9335c
Rename CLI arg handle methods
FabijanC Jun 2, 2022
23df2a9
Warn not to use predeployed accounts on mainnet
FabijanC Jun 2, 2022
0a6dba1
Move default values form util to constants
FabijanC Jun 2, 2022
0893168
Use int instead of int_or_float
FabijanC Jun 2, 2022
36c34ee
Test insufficient balance
FabijanC Jun 2, 2022
bb63352
Replace kill with terminate_and_wait
FabijanC Jun 2, 2022
15c3e7e
Execute load_dumped before generate_accounts
FabijanC Jun 2, 2022
8db6e6c
Store fee_token internally
FabijanC Jun 3, 2022
b8b14f0
Restore parallelization
FabijanC Jun 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
docker:
- image: cimg/python:3.7.12-node
resource_class: medium
parallelism: 2
# parallelism: 2
steps:
- checkout
- run:
Expand All @@ -33,16 +33,17 @@ jobs:
command: ./scripts/compile_contracts.sh
- run:
name: Run pytest tests
parallel: true
# parallel: true
command: |
TESTFILES=$(
circleci tests glob test/test*.py |
circleci tests split --split-by=timings --timings-type=classname
)
mkdir -p test-results
poetry run pytest -s --junitxml=test-results/junit.xml -vv $TESTFILES
- store_test_results:
path: test-results
poetry run pytest -s -vv
# TESTFILES=$(
# circleci tests glob test/test*.py |
# circleci tests split --split-by=timings --timings-type=classname
# )
# mkdir -p test-results
# poetry run pytest -s --junitxml=test-results/junit.xml -vv $TESTFILES
# - store_test_results:
# path: test-results

test-py-max:
<<: *test-template
Expand Down
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,34 @@ Run a local instance of Starknet Devnet
optional arguments:
-h, --help show this help message and exit
-v, --version Print the version
--host HOST Specify the address to listen at; defaults to 127.0.0.1 (use the address the program outputs on start)
--host HOST Specify the address to listen at; defaults to
127.0.0.1 (use the address the program outputs on
start)
--port PORT, -p PORT Specify the port to listen at; defaults to 5050
--load-path LOAD_PATH
Specify the path from which the state is loaded on
startup
--dump-path DUMP_PATH
Specify the path to dump to
--dump-on DUMP_ON Specify when to dump; can dump on: exit, transaction
--lite-mode Applies all optimizations by disabling some
features. These can be applied individually
by using other flags instead of this one.
--lite-mode Applies all lite-mode-* optimizations by disabling some features.
--lite-mode-block-hash
Disables block hash calculation
--lite-mode-deploy-hash
Disables deploy tx hash calculation
--accounts ACCOUNTS Specify the number of accounts to be predeployed;
defaults to 10
--initial-balance INITIAL_BALANCE, -e INITIAL_BALANCE
Specify the initial balance of accounts to be
predeployed; defaults to 1e+21
--seed SEED Specify the seed for randomness of accounts to be
predeployed
--start-time START_TIME
Specify the start time of the genesis block
in Unix time
Specify the start time of the genesis block in Unix
time seconds
--gas-price GAS_PRICE, -g GAS_PRICE
Specify the gas price in wei per gas unit; defaults to
1e+11
```

You can run `starknet-devnet` in a separate shell, or you can run it in background with `starknet-devnet &`.
Expand Down
47 changes: 46 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ crypto-cpp-py = "^1.0.4"
[tool.poetry.dev-dependencies]
pylint = "~2.12.2"
web3 = "~5.28.0"
psutil = "~5.9.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand All @@ -34,8 +35,10 @@ starknet-devnet = "starknet_devnet.server:main"
[tool.pytest.ini_options]
markers = [
"account",
"account_predeployed",
"call",
"deploy",
"fee_token",
"invoke",
"restart",
"state_update",
Expand Down
Loading