Skip to content

Commit 50106b9

Browse files
authored
fix CCQ tests after foundry v1.0 release broke them (#82)
* fix CCQ tests after foundry v1.0 release broke them * fix constants
1 parent 71d4e6d commit 50106b9

File tree

5 files changed

+27
-21
lines changed

5 files changed

+27
-21
lines changed

gen/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GENERATORS = chains cctpDomains
22
chains_TARGET = constants/Chains.sol
3-
cctpDomains_TARGET = constants/CCTPDomains.sol
3+
cctpDomains_TARGET = constants/CctpDomains.sol
44

55
fnGeneratorTarget = ../src/$($(1)_TARGET)
66
GENERATOR_TARGETS = $(foreach generator,$(GENERATORS),$(call fnGeneratorTarget,$(generator)))

gen/chains.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ pragma solidity ^0.8.0;
1212
// In the wormhole wire format, 0 indicates that a message is for any destination chain
1313
uint16 constant CHAIN_ID_UNSET = 0;`);
1414

15-
for (const chain of chains)
15+
//the insane decision was made to add Hyperliquid with a fake chainId of -1 to the TS SDK...
16+
for (const chain of chains.filter(chain => chain !== "Hyperliquid"))
1617
console.log(`uint16 constant CHAIN_ID_${toCapsSnakeCase(chain)} = ${chainToChainId(chain)};`);

src/constants/CCTPDomains.sol renamed to src/constants/CctpDomains.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ uint32 constant CCTP_DOMAIN_SOLANA = 5;
1111
uint32 constant CCTP_DOMAIN_BASE = 6;
1212
uint32 constant CCTP_DOMAIN_POLYGON = 7;
1313
uint32 constant CCTP_DOMAIN_SUI = 8;
14+
uint32 constant CCTP_DOMAIN_APTOS = 9;
15+
uint32 constant CCTP_DOMAIN_UNICHAIN = 10;
1416

1517
// Additional Testnet mappings:
1618
uint32 constant CCTP_DOMAIN_SEPOLIA = 0;

src/constants/Chains.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ uint16 constant CHAIN_ID_SEIEVM = 40;
4646
uint16 constant CHAIN_ID_SNAXCHAIN = 43;
4747
uint16 constant CHAIN_ID_UNICHAIN = 44;
4848
uint16 constant CHAIN_ID_WORLDCHAIN = 45;
49+
uint16 constant CHAIN_ID_INK = 46;
50+
uint16 constant CHAIN_ID_HYPER_E_V_M = 47;
51+
uint16 constant CHAIN_ID_MONAD = 48;
4952
uint16 constant CHAIN_ID_WORMCHAIN = 3104;
5053
uint16 constant CHAIN_ID_COSMOSHUB = 4000;
5154
uint16 constant CHAIN_ID_EVMOS = 4001;
@@ -56,10 +59,10 @@ uint16 constant CHAIN_ID_STARGAZE = 4005;
5659
uint16 constant CHAIN_ID_SEDA = 4006;
5760
uint16 constant CHAIN_ID_DYMENSION = 4007;
5861
uint16 constant CHAIN_ID_PROVENANCE = 4008;
62+
uint16 constant CHAIN_ID_NOBLE = 4009;
5963
uint16 constant CHAIN_ID_SEPOLIA = 10002;
6064
uint16 constant CHAIN_ID_ARBITRUM_SEPOLIA = 10003;
6165
uint16 constant CHAIN_ID_BASE_SEPOLIA = 10004;
6266
uint16 constant CHAIN_ID_OPTIMISM_SEPOLIA = 10005;
6367
uint16 constant CHAIN_ID_HOLESKY = 10006;
6468
uint16 constant CHAIN_ID_POLYGON_SEPOLIA = 10007;
65-
uint16 constant CHAIN_ID_MONAD_DEVNET = 10008;

src/testing/QueryRequestBuilder.sol

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ library QueryRequestBuilder {
2323
uint32 nonce,
2424
uint8 numPerChainQueries,
2525
bytes memory perChainQueries
26-
) internal pure returns (bytes memory) {
26+
) external pure returns (bytes memory) {
2727
return abi.encodePacked(
2828
version,
2929
nonce,
@@ -36,15 +36,15 @@ library QueryRequestBuilder {
3636
uint16 chainId,
3737
uint8 queryType,
3838
bytes memory queryBytes
39-
) internal pure returns (bytes memory) {
39+
) external pure returns (bytes memory) {
4040
return abi.encodePacked(chainId, queryType, uint32(queryBytes.length), queryBytes);
4141
}
4242

4343
function buildEthCallRequestBytes(
4444
bytes memory blockId,
4545
uint8 numCallData,
4646
bytes memory callData //Created with buildEthCallRecordBytes()
47-
) internal pure returns (bytes memory) {
47+
) external pure returns (bytes memory) {
4848
return abi.encodePacked(uint32(blockId.length), blockId, numCallData, callData);
4949
}
5050

@@ -54,7 +54,7 @@ library QueryRequestBuilder {
5454
bytes memory followingBlockHint,
5555
uint8 numCallData,
5656
bytes memory callData //Created with buildEthCallRecordBytes()
57-
) internal pure returns (bytes memory) {
57+
) external pure returns (bytes memory) {
5858
return abi.encodePacked(
5959
targetTimeUs,
6060
uint32(targetBlockHint.length),
@@ -71,7 +71,7 @@ library QueryRequestBuilder {
7171
bytes memory finality,
7272
uint8 numCallData,
7373
bytes memory callData //Created with buildEthCallRecordBytes()
74-
) internal pure returns (bytes memory) {
74+
) external pure returns (bytes memory) {
7575
return abi.encodePacked(
7676
uint32(blockId.length),
7777
blockId,
@@ -85,7 +85,7 @@ library QueryRequestBuilder {
8585
function buildEthCallRecordBytes(
8686
address contractAddress,
8787
bytes memory callData
88-
) internal pure returns (bytes memory) {
88+
) external pure returns (bytes memory) {
8989
return abi.encodePacked(contractAddress, uint32(callData.length), callData);
9090
}
9191

@@ -96,7 +96,7 @@ library QueryRequestBuilder {
9696
uint64 dataSliceLength,
9797
uint8 numAccounts,
9898
bytes memory accounts //Each account is 32 bytes.
99-
) internal pure returns (bytes memory) {
99+
) external pure returns (bytes memory) {
100100
return abi.encodePacked(
101101
uint32(commitment.length),
102102
commitment,
@@ -114,7 +114,7 @@ library QueryRequestBuilder {
114114
uint64 dataSliceOffset,
115115
uint64 dataSliceLength,
116116
bytes[] memory pdas //Created with multiple calls to buildSolanaPdaEntry()
117-
) internal pure returns (bytes memory) {
117+
) external pure returns (bytes memory) {
118118
uint numPdas = pdas.length;
119119
if (numPdas > type(uint8).max)
120120
revert SolanaTooManyPDAs();
@@ -138,7 +138,7 @@ library QueryRequestBuilder {
138138
bytes32 programId,
139139
uint8 numSeeds,
140140
bytes memory seeds //Created with buildSolanaPdaSeedBytes()
141-
) internal pure returns (bytes memory) {
141+
) external pure returns (bytes memory) {
142142
if (numSeeds > SOLANA_MAX_SEEDS)
143143
revert SolanaTooManySeeds();
144144

@@ -148,7 +148,7 @@ library QueryRequestBuilder {
148148
//packs the seeds for a PDA entry into an array of bytes.
149149
function buildSolanaPdaSeedBytes(
150150
bytes[] memory seeds
151-
) internal pure returns (bytes memory, uint8) {
151+
) external pure returns (bytes memory, uint8) {
152152
uint numSeeds = seeds.length;
153153
if (numSeeds > SOLANA_MAX_SEEDS)
154154
revert SolanaTooManySeeds();
@@ -174,7 +174,7 @@ library QueryRequestBuilder {
174174
bytes memory queryRequest,
175175
uint8 numPerChainResponses,
176176
bytes memory perChainResponses
177-
) internal pure returns (bytes memory) {
177+
) external pure returns (bytes memory) {
178178
return abi.encodePacked(
179179
version,
180180
senderChainId,
@@ -190,7 +190,7 @@ library QueryRequestBuilder {
190190
uint16 chainId,
191191
uint8 queryType,
192192
bytes memory responseBytes
193-
) internal pure returns (bytes memory) {
193+
) external pure returns (bytes memory) {
194194
return abi.encodePacked(chainId, queryType, uint32(responseBytes.length), responseBytes);
195195
}
196196

@@ -200,7 +200,7 @@ library QueryRequestBuilder {
200200
uint64 blockTimeUs,
201201
uint8 numResults,
202202
bytes memory results //Created with buildEthCallResultBytes()
203-
) internal pure returns (bytes memory) {
203+
) external pure returns (bytes memory) {
204204
return abi.encodePacked(blockNumber, blockHash, blockTimeUs, numResults, results);
205205
}
206206

@@ -213,7 +213,7 @@ library QueryRequestBuilder {
213213
uint64 followingBlockTimeUs,
214214
uint8 numResults,
215215
bytes memory results //Created with buildEthCallResultBytes()
216-
) internal pure returns (bytes memory) {
216+
) external pure returns (bytes memory) {
217217
return abi.encodePacked(
218218
targetBlockNumber,
219219
targetBlockHash,
@@ -233,13 +233,13 @@ library QueryRequestBuilder {
233233
uint64 blockTimeUs,
234234
uint8 numResults,
235235
bytes memory results //Created with buildEthCallResultBytes()
236-
) internal pure returns (bytes memory) {
236+
) external pure returns (bytes memory) {
237237
return abi.encodePacked(blockNumber, blockHash, blockTimeUs, numResults, results);
238238
}
239239

240240
function buildEthCallResultBytes(
241241
bytes memory result
242-
) internal pure returns (bytes memory){
242+
) external pure returns (bytes memory){
243243
return abi.encodePacked(uint32(result.length), result);
244244
}
245245

@@ -249,7 +249,7 @@ library QueryRequestBuilder {
249249
bytes32 blockHash,
250250
uint8 numResults,
251251
bytes memory results //Created with buildEthCallResultBytes()
252-
) internal pure returns (bytes memory) {
252+
) external pure returns (bytes memory) {
253253
return abi.encodePacked(slotNumber, blockTimeUs, blockHash, numResults, results);
254254
}
255255

@@ -259,7 +259,7 @@ library QueryRequestBuilder {
259259
bytes32 blockHash,
260260
uint8 numResults,
261261
bytes memory results //Created with buildEthCallResultBytes()
262-
) internal pure returns (bytes memory) {
262+
) external pure returns (bytes memory) {
263263
return abi.encodePacked(slotNumber, blockTimeUs, blockHash, numResults, results);
264264
}
265265
}

0 commit comments

Comments
 (0)