-
Notifications
You must be signed in to change notification settings - Fork 471
Expand file tree
/
Copy pathblobs.py
More file actions
64 lines (53 loc) · 1.94 KB
/
Copy pathblobs.py
File metadata and controls
64 lines (53 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""Test specification for blob tests."""
from typing import Callable, ClassVar, Generator, List, Sequence, Type
from execution_testing.base_types import Alloc
from execution_testing.base_types.base_types import Hash
from execution_testing.client_clis import TransitionTool
from execution_testing.execution import BaseExecute, BlobTransaction
from execution_testing.fixtures import (
FixtureFormat,
)
from execution_testing.test_types import (
NetworkWrappedTransaction,
Transaction,
)
from .base import BaseTest, ExecuteFormat, FillResult, LabeledExecuteFormat
class BlobsTest(BaseTest):
"""Test specification for blob tests."""
pre: Alloc
txs: List[NetworkWrappedTransaction | Transaction]
nonexisting_blob_hashes: List[Hash] | None = None
get_blobs_version: int | None = None
cell_mask: int | None = None
supported_execute_formats: ClassVar[Sequence[LabeledExecuteFormat]] = [
LabeledExecuteFormat(
BlobTransaction,
"blob_transaction_test",
"A test that executes a blob transaction",
),
]
def generate(
self,
*,
t8n: TransitionTool,
fixture_format: FixtureFormat,
) -> FillResult:
"""Generate the list of test fixtures."""
del t8n
raise Exception(f"Unknown fixture format: {fixture_format}")
def execute(
self,
*,
execute_format: ExecuteFormat,
) -> BaseExecute:
"""Generate the list of test fixtures."""
if execute_format == BlobTransaction:
return BlobTransaction(
txs=self.txs,
nonexisting_blob_hashes=self.nonexisting_blob_hashes,
get_blobs_version=self.get_blobs_version,
cell_mask=self.cell_mask,
)
raise Exception(f"Unsupported execute format: {execute_format}")
BlobsTestSpec = Callable[[str], Generator[BlobsTest, None, None]]
BlobsTestFiller = Type[BlobsTest]