Skip to content

Commit b3cf5d3

Browse files
committed
stash while checking build errors
1 parent 552a34f commit b3cf5d3

File tree

3 files changed

+138
-3
lines changed

3 files changed

+138
-3
lines changed

target_chains/ethereum/abi_generator/src/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,29 @@ function generateAbi(contracts) {
4242
fs.mkdirSync("abis");
4343
}
4444

45+
if (output.errors) {
46+
// We can still generate ABIs with warnings, only throw for errors
47+
const errors = output.errors.filter((e) => e.severity === "error");
48+
if (errors.length > 0) {
49+
console.error("Compilation errors:");
50+
for (const error of errors) {
51+
console.error(error.formattedMessage || error.message);
52+
}
53+
throw new Error("Compilation failed due to errors");
54+
}
55+
}
56+
57+
4558
for (let contract of contracts) {
4659
const contractFile = `${contract}.sol`;
4760

61+
if (!output.contracts[contractFile]) {
62+
throw new Error(`Unable to produce ABI for ${contractFile}.`);
63+
}
64+
if (!output.contracts[contractFile][contract]) {
65+
throw new Error(`Unable to produce ABI for ${contractFile}:${contract}.`);
66+
}
67+
4868
const abi = output.contracts[contractFile][contract].abi;
4969
fs.writeFileSync(
5070
`abis/${contract}.json`,

target_chains/ethereum/sdk/solidity/IPyth.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ interface IPyth is IPythEvents {
143143
/// no update for any of the given `priceIds` within the given time range.
144144
/// @param updateData Array of price update data.
145145
/// @param priceIds Array of price ids.
146-
/// @param minPublishTime minimum acceptable publishTime for the given `priceIds`.
147-
/// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`.
146+
/// @param minAllowedPublishTime minimum acceptable publishTime for the given `priceIds`.
147+
/// @param maxAllowedPublishTime maximum acceptable publishTime for the given `priceIds`.
148148
/// @param storeUpdatesIfFresh flag for the parse function to
149149
/// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).
150150
function parsePriceFeedUpdatesWithConfig(
@@ -155,7 +155,7 @@ interface IPyth is IPythEvents {
155155
bool checkUniqueness,
156156
bool checkUpdateDataIsMinimal,
157157
bool storeUpdatesIfFresh
158-
) public returns ( PythStructs.PriceFeed[] memory priceFeeds, uint64[] memory slots);
158+
) external returns ( PythStructs.PriceFeed[] memory priceFeeds, uint64[] memory slots);
159159

160160
/// @notice Parse time-weighted average price (TWAP) from two consecutive price updates for the given `priceIds`.
161161
///

target_chains/ethereum/sdk/solidity/abis/IPyth.json

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,121 @@
475475
"stateMutability": "payable",
476476
"type": "function"
477477
},
478+
{
479+
"inputs": [
480+
{
481+
"internalType": "bytes[]",
482+
"name": "updateData",
483+
"type": "bytes[]"
484+
},
485+
{
486+
"internalType": "bytes32[]",
487+
"name": "priceIds",
488+
"type": "bytes32[]"
489+
},
490+
{
491+
"internalType": "uint64",
492+
"name": "minAllowedPublishTime",
493+
"type": "uint64"
494+
},
495+
{
496+
"internalType": "uint64",
497+
"name": "maxAllowedPublishTime",
498+
"type": "uint64"
499+
},
500+
{
501+
"internalType": "bool",
502+
"name": "checkUniqueness",
503+
"type": "bool"
504+
},
505+
{
506+
"internalType": "bool",
507+
"name": "checkUpdateDataIsMinimal",
508+
"type": "bool"
509+
},
510+
{
511+
"internalType": "bool",
512+
"name": "storeUpdatesIfFresh",
513+
"type": "bool"
514+
}
515+
],
516+
"name": "parsePriceFeedUpdatesWithConfig",
517+
"outputs": [
518+
{
519+
"components": [
520+
{
521+
"internalType": "bytes32",
522+
"name": "id",
523+
"type": "bytes32"
524+
},
525+
{
526+
"components": [
527+
{
528+
"internalType": "int64",
529+
"name": "price",
530+
"type": "int64"
531+
},
532+
{
533+
"internalType": "uint64",
534+
"name": "conf",
535+
"type": "uint64"
536+
},
537+
{
538+
"internalType": "int32",
539+
"name": "expo",
540+
"type": "int32"
541+
},
542+
{
543+
"internalType": "uint256",
544+
"name": "publishTime",
545+
"type": "uint256"
546+
}
547+
],
548+
"internalType": "struct PythStructs.Price",
549+
"name": "price",
550+
"type": "tuple"
551+
},
552+
{
553+
"components": [
554+
{
555+
"internalType": "int64",
556+
"name": "price",
557+
"type": "int64"
558+
},
559+
{
560+
"internalType": "uint64",
561+
"name": "conf",
562+
"type": "uint64"
563+
},
564+
{
565+
"internalType": "int32",
566+
"name": "expo",
567+
"type": "int32"
568+
},
569+
{
570+
"internalType": "uint256",
571+
"name": "publishTime",
572+
"type": "uint256"
573+
}
574+
],
575+
"internalType": "struct PythStructs.Price",
576+
"name": "emaPrice",
577+
"type": "tuple"
578+
}
579+
],
580+
"internalType": "struct PythStructs.PriceFeed[]",
581+
"name": "priceFeeds",
582+
"type": "tuple[]"
583+
},
584+
{
585+
"internalType": "uint64[]",
586+
"name": "slots",
587+
"type": "uint64[]"
588+
}
589+
],
590+
"stateMutability": "nonpayable",
591+
"type": "function"
592+
},
478593
{
479594
"inputs": [
480595
{

0 commit comments

Comments
 (0)