Closed mikiw closed 3 months ago
TODO: https://github.com/0xSpaceShard/starknet-devnet-rs/issues/474 is fixed by this PR buy remember to add test for that
I also tried to fix hardcoded nonces
in blocks_on_demand_tests
but I couldn't.
I tried to use predeployed_account.lock().unwrap().set_block_id(BlockId::Tag(BlockTag::Pending));
but it led to the problem with a clone the method clone exists for struct SingleOwnerAccount<JsonRpcClient<HttpTransport>, LocalWallet>, but its trait bounds were not satisfied
.
https://github.com/0xSpaceShard/starknet-devnet-rs/compare/main...pending-block-improvments-test-check-nonce-bug here is a branch - Alea iacta est
if anyone can fix it it would be great, maybe my rust skills are not sufficient.
I would just wait for starknet-rs update and just remove it later.
Usage related changes
fix of starknet_getNonce on block_id=pending
Development related changes
after an answer from Noa is clearer that we should always have a pending block (even if it's empty) and a pending state (even if it's the same as latest state)
new logic assumes that we always operate on a pending state and clone it to state once a new block is mined
since pending block and state are always there
block-on-demand
mode is only responsible for block creationChecklist:
./scripts/format.sh
./scripts/clippy_check.sh
./scripts/check_unused_deps.sh
./scripts/check_spelling.sh
./website/README.md