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

fix: conditional http support #632

Merged
merged 2 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
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