Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pulse): add provider #2279

Merged
merged 9 commits into from
Jan 24, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add comments
cctdaniel committed Jan 24, 2025
commit 6e9c08d9a0d0d77109bb6c7bd1e3924b4d05a726
5 changes: 5 additions & 0 deletions target_chains/ethereum/contracts/contracts/pulse/Pulse.sol
Original file line number Diff line number Diff line change
@@ -29,6 +29,11 @@ abstract contract Pulse is IPulse, PulseState {
_state.pythFeeInWei = pythFeeInWei;
_state.pyth = pythAddress;
_state.currentSequenceNumber = 1;

// Two-step initialization process:
// 1. Set the default provider address here
// 2. Provider must call registerProvider() in a separate transaction to set their fee
// This ensures the provider maintains control over their own fee settings
_state.defaultProvider = defaultProvider;
_state.exclusivityPeriodSeconds = exclusivityPeriodSeconds;


Unchanged files with check annotations Beta

eventSource.onmessage = (event: MessageEvent<string>) => {
console.log("Received price update:", event.data);
const _priceUpdate = JSON.parse(event.data) as PriceUpdate;

Check warning on line 92 in apps/hermes/client/js/src/examples/HermesClient.ts

GitHub Actions / test

'_priceUpdate' is assigned a value but never used
};
eventSource.onerror = (error: Event) => {
describe("Test parse accumulator update", () => {
test("Happy path", async () => {
const { vaa, updates } = parseAccumulatorUpdateData(

Check warning on line 14 in price_service/sdk/js/src/__tests__/AccumulatorUpdateData.test.ts

GitHub Actions / test

'vaa' is assigned a value but never used
Buffer.from(TEST_ACCUMULATOR_UPDATE_DATA, "base64")
);
).updates.length
).toBe(3);
const { vaa, updates } = parseAccumulatorUpdateData(

Check warning on line 76 in price_service/sdk/js/src/__tests__/AccumulatorUpdateData.test.ts

GitHub Actions / test

'vaa' is assigned a value but never used
sliceAccumulatorUpdateData(
Buffer.from(TEST_ACCUMULATOR_UPDATE_DATA, "base64"),
1,
let seenOutOfOrder = false;
for (let i = 1; i < observedSlots.length; i++) {
if (observedSlots[i] < observedSlots[i - 1]) {
seenOutOfOrder = true;

Check warning on line 224 in price_service/client/js/src/__tests__/connection.e2e.test.ts

GitHub Actions / test

'seenOutOfOrder' is assigned a value but never used
}
}
getOrDeployWormholeContract,
BaseDeployConfig,
} from "./common";
import Web3 from "web3";

Check warning on line 21 in contract_manager/scripts/deploy_evm_entropy_contracts.ts

GitHub Actions / test

'Web3' is defined but never used
interface DeploymentConfig extends BaseDeployConfig {
type: DeploymentType;
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import { DefaultStore } from "../src";
import { Chain } from "../src/chains";

Check warning on line 4 in contract_manager/scripts/generate_governance_set_fee_payload.ts

GitHub Actions / test

'Chain' is defined but never used
const parser = yargs(hideBin(process.argv))
.usage("Usage: $0 --chain <chain_id> --fee <fee> --exponent <exponent>")
findEntropyContract,
findEvmChain,
} from "./common";
import Web3 from "web3";

Check warning on line 14 in contract_manager/scripts/latency_entropy_with_callback.ts

GitHub Actions / test

'Web3' is defined but never used
const parser = yargs(hideBin(process.argv))
.usage(
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import {
DefaultStore,

Check warning on line 4 in contract_manager/scripts/load_test_entropy.ts

GitHub Actions / test

'DefaultStore' is defined but never used
EvmEntropyContract,

Check warning on line 5 in contract_manager/scripts/load_test_entropy.ts

GitHub Actions / test

'EvmEntropyContract' is defined but never used
PrivateKey,

Check warning on line 6 in contract_manager/scripts/load_test_entropy.ts

GitHub Actions / test

'PrivateKey' is defined but never used
toPrivateKey,
} from "../src";
import {