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

Allow overwriting chain options in Daemon Builder #370

Merged

Conversation

Kayanski
Copy link
Contributor

This PR aims at allowing developers to overwrite chain options directly in the daemon Builder.

Copy link

cloudflare-workers-and-pages bot commented Apr 15, 2024

Deploying cw-orchestrator with  Cloudflare Pages  Cloudflare Pages

Latest commit: 29700a8
Status:⚡️  Build in progress...

View logs

Copy link

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.1%. Comparing base (859ba48) to head (bafa9fe).
Report is 3 commits behind head on main.

❗ Current head bafa9fe differs from pull request most recent head 29700a8. Consider uploading reports for the commit 29700a8 to get more accurate results

Additional details and impacted files
Files Coverage Δ
cw-orch-daemon/src/sync/builder.rs 91.1% <100.0%> (+31.1%) ⬆️

... and 2 files with indirect coverage changes

pub(crate) deployment_id: Option<String>,
pub(crate) additional_grpc_url: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub(crate) additional_grpc_url: Option<String>,
pub(crate) overwrite_grpc_url: Option<String>,

Copy link
Contributor

Choose a reason for hiding this comment

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

Should either rename this or update the URL logic to add the url to the grpc url list instead of replacing it alltogether.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to be able to replace it in case the current one gives errors (even if we have fallback logic right now)
Choosing for replacing it (works in most cases)

@@ -97,16 +100,183 @@ impl DaemonBuilder {
self
}

pub fn add_grpc_url(&mut self, url: &str) -> &mut Self {
self.additional_grpc_url = Some(url.to_string());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.additional_grpc_url = Some(url.to_string());
self.overwrite_grpc_url = Some(url.to_string());

// Override gas fee
override_fee(&mut chain, self.gas_denom.clone(), self.gas_fee);
// Override grpc_url
override_grpc_url(&mut chain, self.additional_grpc_url.clone());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
override_grpc_url(&mut chain, self.additional_grpc_url.clone());
override_grpc_url(&mut chain, self.overwrite_grpc_url.clone());

@CyberHoward
Copy link
Contributor

stable clippy is failing

@Kayanski Kayanski merged commit 6665ad8 into main Apr 19, 2024
10 of 11 checks passed
@Kayanski Kayanski deleted the nicolas/orc-118-add-overwrite-options-to-daemon-builder branch April 19, 2024 12:30
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.

2 participants