-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:OffchainLabs/cargo-stylus
- Loading branch information
Showing
6 changed files
with
27 additions
and
15 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2023, Offchain Labs, Inc. | ||
// For licensing, see https://github.com/OffchainLabs/cargo-stylus/blob/main/licenses/COPYRIGHT.md | ||
|
||
use std::time::Duration; | ||
|
||
use ethers::{prelude::*, providers::Provider}; | ||
use eyre::{eyre, Context, Result}; | ||
|
||
pub fn new_provider(url: &str) -> Result<Provider<Http>> { | ||
let mut provider = | ||
Provider::<Http>::try_from(url).wrap_err_with(|| eyre!("failed to init http provider"))?; | ||
|
||
provider.set_interval(Duration::from_millis(250)); | ||
Ok(provider) | ||
} |