This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
errors.py
57 lines (50 loc) · 1.73 KB
/
errors.py
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
import random
wrong_payload_errors_legacy = [
{"fields": {"gas": 1.0}, "error": "Transaction had invalid fields: {'gas': 1.0}"},
{
"fields": {"gas": "test"},
"error": "Transaction had invalid fields: {'gas': 'test'}",
},
{"fields": {"gas": [1]}, "error": "Transaction had invalid fields: {'gas': [1]}"},
]
wrong_payload_errors_eip1559 = wrong_payload_errors_legacy.copy()
# noinspection PyTypeChecker
wrong_payload_errors_eip1559.extend(
(
{
"fields": {"maxFeePerGas": 1.0},
"error": "Transaction had invalid fields: {'maxFeePerGas': 1.0}",
},
{
"fields": {"maxFeePerGas": "test"},
"error": "Transaction had invalid fields: {'maxFeePerGas': 'test'}",
},
{
"fields": {"maxFeePerGas": [1]},
"error": "Transaction had invalid fields: {'maxFeePerGas': [1]}",
},
{
"fields": {"maxPriorityFeePerGas": "test"},
"error": "Transaction had invalid fields: {'maxPriorityFeePerGas': 'test'}",
},
)
)
chain_id = random.randint(2000, 100000)
wrong_fields_errors_common = [
{
"fields": {"chainId": chain_id},
"error": f"INTERNAL_ERROR: rlp parse transaction: invalid chainID, {chain_id} (expected 1337)",
}
]
for i in [0, 1, 10000, 20199]:
wrong_fields_errors_common.append(
{"fields": {"gas": i}, "error": "INTERNAL_ERROR: IntrinsicGas"}
)
wrong_fields_errors_legacy = []
wrong_fields_errors_eip1559 = [
{"fields": {"maxFeePerGas": 0}, "error": "FEE_TOO_LOW: fee too low"},
{"fields": {"maxFeePerGas": 6}, "error": "FEE_TOO_LOW: fee too low"},
]
# maxPriorityFee ={
# "test: ""Transaction is sent with gas value = 'test'"
# }