@@ -23,7 +23,7 @@ library QueryRequestBuilder {
23
23
uint32 nonce ,
24
24
uint8 numPerChainQueries ,
25
25
bytes memory perChainQueries
26
- ) internal pure returns (bytes memory ) {
26
+ ) external pure returns (bytes memory ) {
27
27
return abi.encodePacked (
28
28
version,
29
29
nonce,
@@ -36,15 +36,15 @@ library QueryRequestBuilder {
36
36
uint16 chainId ,
37
37
uint8 queryType ,
38
38
bytes memory queryBytes
39
- ) internal pure returns (bytes memory ) {
39
+ ) external pure returns (bytes memory ) {
40
40
return abi.encodePacked (chainId, queryType, uint32 (queryBytes.length ), queryBytes);
41
41
}
42
42
43
43
function buildEthCallRequestBytes (
44
44
bytes memory blockId ,
45
45
uint8 numCallData ,
46
46
bytes memory callData //Created with buildEthCallRecordBytes()
47
- ) internal pure returns (bytes memory ) {
47
+ ) external pure returns (bytes memory ) {
48
48
return abi.encodePacked (uint32 (blockId.length ), blockId, numCallData, callData);
49
49
}
50
50
@@ -54,7 +54,7 @@ library QueryRequestBuilder {
54
54
bytes memory followingBlockHint ,
55
55
uint8 numCallData ,
56
56
bytes memory callData //Created with buildEthCallRecordBytes()
57
- ) internal pure returns (bytes memory ) {
57
+ ) external pure returns (bytes memory ) {
58
58
return abi.encodePacked (
59
59
targetTimeUs,
60
60
uint32 (targetBlockHint.length ),
@@ -71,7 +71,7 @@ library QueryRequestBuilder {
71
71
bytes memory finality ,
72
72
uint8 numCallData ,
73
73
bytes memory callData //Created with buildEthCallRecordBytes()
74
- ) internal pure returns (bytes memory ) {
74
+ ) external pure returns (bytes memory ) {
75
75
return abi.encodePacked (
76
76
uint32 (blockId.length ),
77
77
blockId,
@@ -85,7 +85,7 @@ library QueryRequestBuilder {
85
85
function buildEthCallRecordBytes (
86
86
address contractAddress ,
87
87
bytes memory callData
88
- ) internal pure returns (bytes memory ) {
88
+ ) external pure returns (bytes memory ) {
89
89
return abi.encodePacked (contractAddress, uint32 (callData.length ), callData);
90
90
}
91
91
@@ -96,7 +96,7 @@ library QueryRequestBuilder {
96
96
uint64 dataSliceLength ,
97
97
uint8 numAccounts ,
98
98
bytes memory accounts //Each account is 32 bytes.
99
- ) internal pure returns (bytes memory ) {
99
+ ) external pure returns (bytes memory ) {
100
100
return abi.encodePacked (
101
101
uint32 (commitment.length ),
102
102
commitment,
@@ -114,7 +114,7 @@ library QueryRequestBuilder {
114
114
uint64 dataSliceOffset ,
115
115
uint64 dataSliceLength ,
116
116
bytes [] memory pdas //Created with multiple calls to buildSolanaPdaEntry()
117
- ) internal pure returns (bytes memory ) {
117
+ ) external pure returns (bytes memory ) {
118
118
uint numPdas = pdas.length ;
119
119
if (numPdas > type (uint8 ).max)
120
120
revert SolanaTooManyPDAs ();
@@ -138,7 +138,7 @@ library QueryRequestBuilder {
138
138
bytes32 programId ,
139
139
uint8 numSeeds ,
140
140
bytes memory seeds //Created with buildSolanaPdaSeedBytes()
141
- ) internal pure returns (bytes memory ) {
141
+ ) external pure returns (bytes memory ) {
142
142
if (numSeeds > SOLANA_MAX_SEEDS)
143
143
revert SolanaTooManySeeds ();
144
144
@@ -148,7 +148,7 @@ library QueryRequestBuilder {
148
148
//packs the seeds for a PDA entry into an array of bytes.
149
149
function buildSolanaPdaSeedBytes (
150
150
bytes [] memory seeds
151
- ) internal pure returns (bytes memory , uint8 ) {
151
+ ) external pure returns (bytes memory , uint8 ) {
152
152
uint numSeeds = seeds.length ;
153
153
if (numSeeds > SOLANA_MAX_SEEDS)
154
154
revert SolanaTooManySeeds ();
@@ -174,7 +174,7 @@ library QueryRequestBuilder {
174
174
bytes memory queryRequest ,
175
175
uint8 numPerChainResponses ,
176
176
bytes memory perChainResponses
177
- ) internal pure returns (bytes memory ) {
177
+ ) external pure returns (bytes memory ) {
178
178
return abi.encodePacked (
179
179
version,
180
180
senderChainId,
@@ -190,7 +190,7 @@ library QueryRequestBuilder {
190
190
uint16 chainId ,
191
191
uint8 queryType ,
192
192
bytes memory responseBytes
193
- ) internal pure returns (bytes memory ) {
193
+ ) external pure returns (bytes memory ) {
194
194
return abi.encodePacked (chainId, queryType, uint32 (responseBytes.length ), responseBytes);
195
195
}
196
196
@@ -200,7 +200,7 @@ library QueryRequestBuilder {
200
200
uint64 blockTimeUs ,
201
201
uint8 numResults ,
202
202
bytes memory results //Created with buildEthCallResultBytes()
203
- ) internal pure returns (bytes memory ) {
203
+ ) external pure returns (bytes memory ) {
204
204
return abi.encodePacked (blockNumber, blockHash, blockTimeUs, numResults, results);
205
205
}
206
206
@@ -213,7 +213,7 @@ library QueryRequestBuilder {
213
213
uint64 followingBlockTimeUs ,
214
214
uint8 numResults ,
215
215
bytes memory results //Created with buildEthCallResultBytes()
216
- ) internal pure returns (bytes memory ) {
216
+ ) external pure returns (bytes memory ) {
217
217
return abi.encodePacked (
218
218
targetBlockNumber,
219
219
targetBlockHash,
@@ -233,13 +233,13 @@ library QueryRequestBuilder {
233
233
uint64 blockTimeUs ,
234
234
uint8 numResults ,
235
235
bytes memory results //Created with buildEthCallResultBytes()
236
- ) internal pure returns (bytes memory ) {
236
+ ) external pure returns (bytes memory ) {
237
237
return abi.encodePacked (blockNumber, blockHash, blockTimeUs, numResults, results);
238
238
}
239
239
240
240
function buildEthCallResultBytes (
241
241
bytes memory result
242
- ) internal pure returns (bytes memory ){
242
+ ) external pure returns (bytes memory ){
243
243
return abi.encodePacked (uint32 (result.length ), result);
244
244
}
245
245
@@ -249,7 +249,7 @@ library QueryRequestBuilder {
249
249
bytes32 blockHash ,
250
250
uint8 numResults ,
251
251
bytes memory results //Created with buildEthCallResultBytes()
252
- ) internal pure returns (bytes memory ) {
252
+ ) external pure returns (bytes memory ) {
253
253
return abi.encodePacked (slotNumber, blockTimeUs, blockHash, numResults, results);
254
254
}
255
255
@@ -259,7 +259,7 @@ library QueryRequestBuilder {
259
259
bytes32 blockHash ,
260
260
uint8 numResults ,
261
261
bytes memory results //Created with buildEthCallResultBytes()
262
- ) internal pure returns (bytes memory ) {
262
+ ) external pure returns (bytes memory ) {
263
263
return abi.encodePacked (slotNumber, blockTimeUs, blockHash, numResults, results);
264
264
}
265
265
}
0 commit comments