Skip to content

refactor: extracts price updater#12

Merged
stalniy merged 3 commits intomainfrom
refactor/extract-price-updater
Mar 30, 2026
Merged

refactor: extracts price updater#12
stalniy merged 3 commits intomainfrom
refactor/extract-price-updater

Conversation

@stalniy
Copy link
Copy Markdown
Contributor

@stalniy stalniy commented Mar 27, 2026

Why

To have a possibility to provide a different implementation of price updater (e.g., fire and forget)

What

extracts price feeding from hermes client

@stalniy stalniy force-pushed the refactor/extract-price-updater branch from 25d20a0 to 00752e9 Compare March 27, 2026 15:44
@stalniy stalniy requested a review from Copilot March 27, 2026 18:00
@stalniy stalniy force-pushed the refactor/extract-price-updater branch from 00752e9 to 9f746d9 Compare March 27, 2026 18:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the price-feeding logic out of HermesClient into a dedicated “price updater” abstraction, with the intent to allow alternative update strategies.

Changes:

  • Introduces PriceUpdater / PriceUpdateOptions / UpdatePriceFeedMsg types in src/types.ts.
  • Adds PriceUpdateConfirmed implementation that executes the on-chain contract update.
  • Updates HermesClient.updatePrice() to delegate execution to PriceUpdateConfirmed (via a cached #priceUpdater), and adds unit tests for the new updater.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/types.ts Adds updater-related interfaces and moves UpdatePriceFeedMsg type here.
src/price-update/price-update-confirmed/price-update-confirmed.ts New extracted updater that submits VAAs via SigningCosmWasmClient.execute.
src/price-update/price-update-confirmed/price-update-confirmed.test.ts Unit tests validating message/funds, return shape, and error propagation.
src/hermes-client.ts Refactors price update execution to use PriceUpdater and removes the locally-defined UpdatePriceFeedMsg + adjusts exports.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/price-update/price-update-confirmed/price-update-confirmed.ts Outdated
Comment thread src/hermes-client.ts Outdated
Comment thread src/hermes-client.ts
Comment thread src/types.ts
Comment thread src/hermes-client.ts
stalniy and others added 2 commits March 27, 2026 19:18
…firmed.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Serhii Stotskyi <sergiy.stotskiy@gmail.com>
@stalniy stalniy merged commit 880063a into main Mar 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants