-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetch.toml
162 lines (126 loc) · 6.59 KB
/
fetch.toml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#
# Fetching a web3 is in 3 steps :
# 1/ Parsing the URL
# 2/ Calling the smartcontract
# 3/ Processing the contract return
# Each step has his own test groups, this test group focus on the plumbing between the steps.
#
name = "Fetch: Do the whole process"
type = "fetch"
[groups.manual-mode]
name = "Fetch manual mode"
standards = ["ERC-4804", "ERC-6860"]
[[groups.manual-mode.tests]]
name = "Make a basic call"
url = "web3://0x9A595bc28F1c40ab96247E8157A2b0A6762E7543/lalala"
outputAsString = "404"
httpCode = 200
httpHeaders = {Content-Type = "text/html"}
[[groups.manual-mode.tests]]
name = "Make a basic call, with mime casting"
url = "web3://0x9A595bc28F1c40ab96247E8157A2b0A6762E7543/lalala.svg"
outputAsString = "404"
httpCode = 200
httpHeaders = {Content-Type = "image/svg+xml"}
[groups.auto-mode]
name = "Fetch auto mode"
standards = ["ERC-4804", "ERC-6860"]
[[groups.auto-mode.tests]]
name = "Make a call without ?returns"
url = "web3://0xA5aFC9fE76a28fB12C60954Ed6e2e5f8ceF64Ff2/resourceName"
outputAsString = "???"
httpCode = 200
httpHeaders = {}
[[groups.auto-mode.tests]]
name = "Make a call with a bad method name"
url = "web3://0xA5aFC9fE76a28fB12C60954Ed6e2e5f8ceF64Ff2/xxxxxxx"
error = { label = "The contract returned no data (\"0x\").\n\nThis could be due to any of the following:\n - The contract does not have the requested function,\n - The parameters passed to the contract function may be invalid, or\n - The address is not a contract.", httpCode = 400 }
# ERC-6860 and ERC-4840 returns numbers in auto mode differently
[groups.auto-mode-erc-4840]
name = "Fetch auto mode (ERC-4804)"
standards = ["ERC-4804"]
[[groups.auto-mode-erc-4840.tests]]
name = "Make a call with ?returns fetching 2 numbers"
url = "web3://0xA5aFC9fE76a28fB12C60954Ed6e2e5f8ceF64Ff2/levelAndTile/2/50?returns=(uint256,uint256)"
outputAsString = "[\"1\",\"36\"]"
httpCode = 200
httpHeaders = {Content-type = "application/json"}
[[groups.auto-mode-erc-4840.tests]]
name = "Make a call with ?returns fetching 2 numbers on sepolia"
url = "web3://0x10fE786Dc7Cb9527197C24c53d7330D3db329524:11155111/levelAndTile/2/50?returns=(uint256,uint256)"
outputAsString = "[\"1\",\"36\"]"
httpCode = 200
httpHeaders = {Content-type = "application/json"}
[[groups.auto-mode-erc-4840.tests]]
name = "Make a call with ?returns fetching an array of numbers on web3Q galileo"
url = "web3://0x8a7297d333b0243c766029ac31a712eef6451846:3334/getValue?returns=(uint256[])"
outputAsString = "[[\"1456\",\"1235\",\"8673\"]]"
httpCode = 200
httpHeaders = {Content-type = "application/json"}
# ERC-6860 and ERC-4840 returns numbers in auto mode differently
[groups.auto-mode-erc-6860]
name = "Fetch auto mode (ERC-6860)"
standards = ["ERC-6860"]
[[groups.auto-mode-erc-6860.tests]]
name = "Make a call with ?returns fetching 2 numbers"
url = "web3://0xA5aFC9fE76a28fB12C60954Ed6e2e5f8ceF64Ff2/levelAndTile/2/50?returns=(uint256,uint256)"
outputAsString = "[\"0x1\",\"0x24\"]"
httpCode = 200
httpHeaders = {Content-Type = "application/json"}
[[groups.auto-mode-erc-6860.tests]]
name = "Make a call with ?returns fetching 2 numbers on sepolia"
url = "web3://0x10fE786Dc7Cb9527197C24c53d7330D3db329524:11155111/levelAndTile/2/50?returns=(uint256,uint256)"
outputAsString = "[\"0x1\",\"0x24\"]"
httpCode = 200
httpHeaders = {Content-Type = "application/json"}
[[groups.auto-mode-erc-6860.tests]]
name = "Make a call with ?returns fetching an array of numbers on web3Q galileo"
url = "web3://0x8a7297d333b0243c766029ac31a712eef6451846:3334/getValue?returns=(uint256[])"
outputAsString = "[[\"0x5b0\",\"0x4d3\",\"0x21e1\"]]"
httpCode = 200
httpHeaders = {Content-Type = "application/json"}
[[groups.auto-mode-erc-6860.tests]]
name = "Make a call with ?returns fetching an array of tuple"
url = "web3://0x4e1f41613c9084fdb9e34e11fae9412427480e56/structureData/1702732089?returns=((uint,uint,uint,uint,uint)[20])"
outputAsString = "[[[\"0x1\",\"0x10\",\"0x471a40\",\"0x471a40\",\"0x1df648\"],[\"0x2\",\"0x40\",\"0x40a380\",\"0x40a380\",\"0x3495e8\"],[\"0x3\",\"0x40\",\"0x40a380\",\"0x40a380\",\"0x48c900\"],[\"0x4\",\"0x100\",\"0x33b600\",\"0x33b600\",\"0x5f68a0\"],[\"0x5\",\"0x100\",\"0x33b600\",\"0x33b600\",\"0x739bb8\"],[\"0x6\",\"0x240\",\"0x26c880\",\"0x26c880\",\"0x87ced0\"],[\"0x7\",\"0x240\",\"0x26c880\",\"0x26c880\",\"0x9c01e8\"],[\"0x8\",\"0x240\",\"0x26c880\",\"0x26c880\",\"0xbec030\"],[\"0x9\",\"0x100\",\"0x33b600\",\"0x33b600\",\"0xd086c0\"],[\"0xa\",\"0x400\",\"0x19db00\",\"0x19db00\",\"0xebff70\"],[\"0xb\",\"0x400\",\"0x19db00\",\"0x19db00\",\"0xf414ba\"],[\"0xc\",\"0x100\",\"0x33b600\",\"0x33b600\",\"0x111facc\"],[\"0xd\",\"0x900\",\"0x0\",\"0x0\",\"0x1289b47\"],[\"0xe\",\"0x900\",\"0x0\",\"0x0\",\"0x13f3bc1\"],[\"0xf\",\"0x240\",\"0x26c880\",\"0x26c880\",\"0x15d21d4\"],[\"0x10\",\"0x240\",\"0x26c880\",\"0x26c880\",\"0x165371e\"],[\"0x11\",\"0x100\",\"0x33b600\",\"0x33b600\",\"0x180b0a8\"],[\"0x12\",\"0x40\",\"0x40a380\",\"0x40a380\",\"0x199bdab\"],[\"0x13\",\"0x40\",\"0x40a380\",\"0x40a380\",\"0x1ab8515\"],[\"0x14\",\"0x10\",\"0x471a40\",\"0x471a40\",\"0x1cbd7b0\"]]]"
httpCode = 200
httpHeaders = {Content-Type = "application/json"}
[groups.resource-request-mode]
name = "Fetch resourceRequest mode"
standards = ["ERC-6944"]
# Todo: Replace with a deployed contract returning a less huge output
[[groups.resource-request-mode.tests]]
name = "Call with path and query"
url = "web3://0x2b51A751d3c7d3554E28DC72C3b032E5f56Aa656/view/1234?x=1&b=2"
httpCode = 200
httpHeaders = {Content-type = "text/html"}
[[groups.resource-request-mode.tests]]
name = "Call returning 404"
url = "web3://0x2b51A751d3c7d3554E28DC72C3b032E5f56Aa656/xxxxx"
outputAsString = ""
httpCode = 404
httpHeaders = {}
[groups.resource-request-mode-with-chunks]
name = "Fetch resourceRequest mode with chunks"
standards = ["ERC-7617"]
[[groups.resource-request-mode-with-chunks.tests]]
name = "Fetch a body made of 3 chunks"
url = "web3://0x64850db133e088fc1657c7bf9c00303d36d92736:11155111/getFile/abcd"
outputAsString = "startmiddleend"
httpCode = 200
httpHeaders = {}
[groups.resource-request-mode-with-compression]
name = "Fetch resourceRequest mode with compression"
standards = ["ERC-7618"]
[[groups.resource-request-mode-with-compression.tests]]
name = "Fetch a body compressed with gzip"
url = "web3://0x7cee6ee8a44ba3f429f868114cf7e41aec4f8641:11155111/gziped-file.txt"
outputAsString = "some text"
httpCode = 200
httpHeaders = {Content-type = "text/plain"}
[[groups.resource-request-mode-with-compression.tests]]
name = "Fetch a body compressed with brotli"
url = "web3://0x7cee6ee8a44ba3f429f868114cf7e41aec4f8641:11155111/brotlied-file.txt"
outputAsString = "some text"
httpCode = 200
httpHeaders = {Content-type = "text/plain"}