Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
fix: conditional http support (#632)
Browse files Browse the repository at this point in the history
* fix: conditional http support

* chore: update changelog

Co-authored-by: Georgios Konstantopoulos <[email protected]>
  • Loading branch information
mattsse and gakonst authored Nov 29, 2021
1 parent f6e803b commit e15252d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
19 changes: 16 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@

## ethers-core

- Change types mapping for solidity `bytes` to rust `ethers::core::Bytes` and solidity `uint8[]` to rust `Vec<u8>`.
### Unreleased

- Change types mapping for solidity `bytes` to rust `ethers::core::Bytes` and
solidity `uint8[]` to rust `Vec<u8>`.
[613](https://github.com/gakonst/ethers-rs/pull/613)
- Fix `format_units` to return a `String` of representing a decimal point float
such that the decimal places don't get truncated.
[597](https://github.com/gakonst/ethers-rs/pull/597)
- Implement hex display format for `ethers::core::Bytes` [#624](https://github.com/gakonst/ethers-rs/pull/624).
- Implement hex display format for `ethers::core::Bytes`
[#624](https://github.com/gakonst/ethers-rs/pull/624).

## ethers-solc
- Return cached artifacts from project `compile` when the cache only contains some files

### Unreleased

- Return cached artifacts from project `compile` when the cache only contains
some files

### 0.6.0

- move `AbiEncode` `AbiDecode` trait to ethers-core and implement for core types
Expand Down Expand Up @@ -82,6 +88,13 @@

## ethers-contract

### Unreleased

- fix Etherscan conditional HTTP support
[#632](https://github.com/gakonst/ethers-rs/pull/632)
- use `CARGO_MANIFEST_DIR` as root for relative paths in abigen
[#631](https://github.com/gakonst/ethers-rs/pull/631)

### 0.6.0

- Provide a way to opt out of networking support in abigen proc macro with
Expand Down
7 changes: 7 additions & 0 deletions ethers-contract/ethers-contract-abigen/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,11 @@ mod tests {
let hardhat_parsed = Source::parse(&hardhat_src).unwrap();
assert_eq!(hardhat_parsed, Source::String(hardhat_src));
}

#[test]
#[ignore]
fn get_etherscan_contract() {
let source = Source::etherscan("0x6b175474e89094c44da98b954eedeac495271d0f").unwrap();
let _dai = source.get().unwrap();
}
}
2 changes: 1 addition & 1 deletion ethers-contract/ethers-contract-abigen/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ where
/// Perform an HTTP GET request and return the contents of the response.
pub fn http_get(_url: &str) -> Result<String> {
cfg_if! {
if #[cfg(any(not(target_arch = "wasm32"), not(features = "reqwest")))]{
if #[cfg(any(target_arch = "wasm32", not(feature = "reqwest")))]{
Err(anyhow!("HTTP is unsupported"))
} else {
Ok(reqwest::blocking::get(_url)?.text()?)
Expand Down

0 comments on commit e15252d

Please sign in to comment.