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

Adds From<H160> trait to ValueOrArray<H160> #1200

Merged
merged 3 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Unreleased

- Fix RLP decoding of `from` field for `Eip1559TransactionRequest` and
- Fix RLP decoding of `from` field for `Eip1559TransactionRequest` and
`Eip2930TransactionRequest`, remove `Eip1559TransactionRequest` `sighash`
method [1180](https://github.com/gakonst/ethers-rs/pull/1180)
- Fix RLP encoding of absent access list in `Transaction` [1137](https://github.com/gakonst/ethers-rs/pull/1137)
Expand Down Expand Up @@ -62,6 +62,7 @@
[#996](https://github.com/gakonst/ethers-rs/pull/996)
- Add `TransactionReceipt::to` and `TransactionReceipt::from`
[#1184](https://github.com/gakonst/ethers-rs/pull/1184)
- Add `From<H160>` trait to `ValueOrArray<H160>` [#1199](https://github.com/gakonst/ethers-rs/pull/1200)

## ethers-contract-abigen

Expand Down
8 changes: 7 additions & 1 deletion ethers-core/src/types/log.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Adapted from https://github.com/tomusdrw/rust-web3/blob/master/src/types/log.rs
use crate::{
types::{Address, BlockNumber, Bytes, H256, U256, U64},
types::{Address, BlockNumber, Bytes, H160, H256, U256, U64},
utils::keccak256,
};
use serde::{
Expand Down Expand Up @@ -360,6 +360,12 @@ pub enum ValueOrArray<T> {

// TODO: Implement more common types - or adjust this to work with all Tokenizable items

impl From<H160> for ValueOrArray<H160> {
fn from(src: H160) -> Self {
ValueOrArray::Value(src)
}
}

impl From<H256> for ValueOrArray<H256> {
fn from(src: H256) -> Self {
ValueOrArray::Value(src)
Expand Down