forked from kkrt-labs/kakarot-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove nonce management, use starknet nonce (kkrt-labs#649)
This pr removes nonce management and uses starknet nonce wherever nonce is required. ## Pull request type <!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. --> Please check the type of change your PR introduces: - [ ] Bugfix - [x] Feature - [ ] Code style update (formatting, renaming) - [ ] Refactoring (no functional changes, no api changes) - [ ] Build related changes - [ ] Documentation content changes - [ ] Other (please describe): ## What is the current behavior? We currently manage nonce ourselves which causes multiple issues, migrating to starknet nonce is a better solution and the PR implements the required changes for that. Resolves kkrt-labs#648 ## What is the new behavior? - nonce management has been removed - we now use starknet nonce wherever required ## Other information - The rpc is already [using starknet nonce](https://github.com/kkrt-labs/kakarot-rpc/blob/d6e3676de6fc9e804dc751aa3493810c95957bba/crates/core/src/client/mod.rs#L338), which means that the current transactions by tools like metamask are already being signed with starknet nonce and not our own nonce when RPC is being used.
- Loading branch information
Showing
21 changed files
with
142 additions
and
205 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
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
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
41 changes: 29 additions & 12 deletions
41
tests/integration/solidity_contracts/PlainOpcodes/conftest.py
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,34 +1,51 @@ | ||
import pytest_asyncio | ||
|
||
|
||
@pytest_asyncio.fixture(scope="module") | ||
async def counter(deploy_solidity_contract, owner): | ||
return await deploy_solidity_contract("PlainOpcodes", "Counter", caller_eoa=owner) | ||
@pytest_asyncio.fixture(scope="session") | ||
def counter_deployer(addresses): | ||
return addresses[1] | ||
|
||
@pytest_asyncio.fixture(scope="session") | ||
def caller_deployer(addresses): | ||
return addresses[2] | ||
|
||
@pytest_asyncio.fixture(scope="module") | ||
async def caller(deploy_solidity_contract, owner): | ||
@pytest_asyncio.fixture(scope="session") | ||
def plain_opcodes_deployer(addresses): | ||
return addresses[3] | ||
|
||
@pytest_asyncio.fixture(scope="session") | ||
def safe_deployer(addresses): | ||
return addresses[4] | ||
|
||
|
||
@pytest_asyncio.fixture(scope="package") | ||
async def counter(deploy_solidity_contract, counter_deployer): | ||
return await deploy_solidity_contract("PlainOpcodes", "Counter", caller_eoa=counter_deployer) | ||
|
||
|
||
@pytest_asyncio.fixture(scope="package") | ||
async def caller(deploy_solidity_contract, caller_deployer): | ||
return await deploy_solidity_contract( | ||
"PlainOpcodes", | ||
"Caller", | ||
caller_eoa=owner, | ||
caller_eoa=caller_deployer, | ||
) | ||
|
||
|
||
@pytest_asyncio.fixture(scope="module") | ||
async def plain_opcodes(deploy_solidity_contract, owner, counter): | ||
@pytest_asyncio.fixture(scope="package") | ||
async def plain_opcodes(deploy_solidity_contract, plain_opcodes_deployer, counter): | ||
return await deploy_solidity_contract( | ||
"PlainOpcodes", | ||
"PlainOpcodes", | ||
counter.evm_contract_address, | ||
caller_eoa=owner, | ||
caller_eoa=plain_opcodes_deployer, | ||
) | ||
|
||
|
||
@pytest_asyncio.fixture(scope="module") | ||
async def safe(deploy_solidity_contract, owner): | ||
@pytest_asyncio.fixture(scope="package") | ||
async def safe(deploy_solidity_contract, safe_deployer): | ||
return await deploy_solidity_contract( | ||
"PlainOpcodes", | ||
"Safe", | ||
caller_eoa=owner, | ||
caller_eoa=safe_deployer | ||
) |
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
Oops, something went wrong.