Skip to content

Commit

Permalink
feat: block gas
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Aug 1, 2022
1 parent e191109 commit 1286c59
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions starknet_py/net/client_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ class StarknetBlock:
root: int
transactions: List[Transaction]
timestamp: int
gas_price: int


@dataclass
Expand Down
1 change: 1 addition & 0 deletions starknet_py/net/gateway_schemas/gateway_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class StarknetBlockSchema(Schema):
required=True,
)
timestamp = fields.Integer(data_key="timestamp", required=True)
gas_price = fields.Integer(data_key="gas_price")

@post_load
def make_dataclass(self, data, **kwargs):
Expand Down
1 change: 1 addition & 0 deletions starknet_py/net/rpc_schemas/rpc_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class StarknetBlockSchema(Schema):
required=True,
)
timestamp = fields.Integer(data_key="timestamp", required=True)
gas_price = fields.Integer(data_key="gas_price")

@post_load
def make_dataclass(self, data, **kwargs) -> StarknetBlock:
Expand Down
2 changes: 2 additions & 0 deletions starknet_py/tests/e2e/client/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ async def test_get_block_by_hash(
assert block == StarknetBlock(
block_number=block_with_deploy_number,
block_hash=block_with_deploy_hash,
gas_price=60_000_000_000,
parent_block_hash=0x0,
root=block_with_deploy_root,
status=BlockStatus.ACCEPTED_ON_L2,
Expand Down Expand Up @@ -140,6 +141,7 @@ async def test_get_block_by_number(
assert block == StarknetBlock(
block_number=block_with_deploy_number,
block_hash=block_with_deploy_hash,
gas_price=60_000_000_000,
parent_block_hash=0x0,
root=block_with_deploy_root,
status=BlockStatus.ACCEPTED_ON_L2,
Expand Down

0 comments on commit 1286c59

Please sign in to comment.