-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve base + blockfrost module maintainability (#120)
* UPDATE. including base.py and blockfrost.py in mypy check * UPDATE. converting dataclass DTOs to have concrete values at all times * REFACTOR. provide all required values for ProtocolParameters in the instantiation step * ADD. adding ogmios specific integration tests * ADD. adding a stub extra_entropy value for FixedChainContext * REFACTOR. pulling out JSON type to a dedicated types module * ADD. adding type hints for BlockFrostChainContext attributes * UPDATE. explicitly specifying type information of Blockfrost API's epoch value * ADD. adding min_pool_cost to blockfrost ProtocolParameters instantiation * UPDATE. lovelace_amount variable should be an integer value * ADD. adding a nested Nativescript test case before attempting to improve readability of NativeScript.from_dict() class method * ADD. adding ogmios parsing integration test UPDATE. improve NativeScript.from_dict() by pulling out primitive list building step * UPDATE. renaming script_json serializing method name * UPDATE. enforcing immutability for GenesisParameters and ProtocolParameters * REFACTOR. renaming JSON type to JsonDict to infer JSON object is represented
- Loading branch information
1 parent
374b505
commit 7787695
Showing
9 changed files
with
181 additions
and
82 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from retry import retry | ||
|
||
from .base import TEST_RETRIES, TestBase | ||
|
||
|
||
class TestProtocolParam(TestBase): | ||
@retry(tries=TEST_RETRIES, backoff=1.5, delay=6, jitter=(0, 4)) | ||
def test_protocol_param_cost_models(self): | ||
protocol_param = self.chain_context.protocol_param | ||
|
||
cost_models = protocol_param.cost_models | ||
for _, cost_model in cost_models.items(): | ||
assert "addInteger-cpu-arguments-intercept" in cost_model | ||
assert "addInteger-cpu-arguments-slope" in cost_model |
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.