generated from ApeWorX/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use new Config to get custom network abilities (#24)
- Loading branch information
Showing
6 changed files
with
78 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from ape_ethereum.transactions import TransactionType | ||
|
||
from ape_polygon.ecosystem import PolygonConfig | ||
|
||
|
||
def test_gas_limit(polygon): | ||
assert polygon.config.local.gas_limit == "max" | ||
|
||
|
||
def test_default_transaction_type(polygon): | ||
assert polygon.config.mainnet.default_transaction_type == TransactionType.DYNAMIC | ||
|
||
|
||
def test_mainnet_fork_not_configured(): | ||
obj = PolygonConfig.model_validate({}) | ||
assert obj.mainnet_fork.required_confirmations == 0 | ||
|
||
|
||
def test_mainnet_fork_configured(): | ||
data = {"mainnet_fork": {"required_confirmations": 555}} | ||
obj = PolygonConfig.model_validate(data) | ||
assert obj.mainnet_fork.required_confirmations == 555 | ||
|
||
|
||
def test_custom_network(): | ||
data = {"apenet": {"required_confirmations": 333}} | ||
obj = PolygonConfig.model_validate(data) | ||
assert obj.apenet.required_confirmations == 333 |
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