-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(rpc-types): replace uint and hash with ethereum_types v0.4
#10217
Conversation
f339865
to
fe9acb9
Compare
@@ -37,7 +39,7 @@ impl str::FromStr for Id { | |||
} | |||
impl Id { | |||
pub fn as_string(&self) -> String { | |||
format!("0x{:?}", self.0) | |||
format!("{:?}", self.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be changed to serde_json::to_string_pretty(&self.0)
for performance reasons but I think it is out-of-scope of this PR because it is large enough!
rpc/src/v1/traits/eth.rs
Outdated
@@ -31,7 +31,7 @@ build_rpc_trait! { | |||
#[rpc(name = "eth_protocolVersion")] | |||
fn protocol_version(&self) -> Result<String>; | |||
|
|||
/// Returns an object with data about the sync status or false. (wtf?) | |||
/// Returns an object with data about the sync status or false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out-of-scope IMO but I couldn't resist.
we should not have such comments in the code base 🛩️
rpc/src/v1/helpers/dispatch.rs
Outdated
.map(ConfirmationResponse::Signature) | ||
// TODO: is this correct? I guess the `token` is the wallet in this context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out-of-scope from this PR but this comment was introduced by me for a long time ago and should be removed!
e41b92e
to
c1a46de
Compare
ethereum_types
ethereum_types v0.4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, would be good to avoid the signature change of parity_verifySignature
5dfc54a
to
54eb384
Compare
tons on conflicts. please rebase, would like to get this merged as soon as possible.
not sure what this means |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
I meant before we used the wrapper types and exported them from the |
This is PR is blocked because |
e757506
to
550f8f1
Compare
550f8f1
to
6da3cec
Compare
@tomusdrw can you review this again? I think it is ready now, I bumped |
940d4b2
to
f319a68
Compare
Needs a 2nd review 👍 cc @tomusdrw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, two minor issues
} | ||
|
||
#[cfg(test)] | ||
mod tests { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we leave the tests to make sure that our assumptions are not broken when the library is updated? Also does 0.4 contain the fix for non-ascii characters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved them to a new file rpc/src/v1/types/eth_types.rs) ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup 👌
* revert change of `U64` -> `u64`
Use re-export from `ethereum-types` instead
f319a68
to
3ff03c8
Compare
) * fix(rpc-types): remove uint and hash wrappers * fix(tests) * fix(cleanup) * grumbles(rpc-api): revert `verify_signature` * revert change of `U64` -> `u64` * fix(cleanup after bad merge) * chore(bump ethereum-types) * fix(bad merge) * feat(tests ethereum-types): add tests * chore(update `ethereum-types` to 0.4.2) * feat(tests for h256) * chore(rpc): remove `ethbloom` import Use re-export from `ethereum-types` instead * fix(bad merge): remove `DefaultAccount` type * doc(add TODO with issue link)
* fix(rpc-types): replace uint and hash with `ethereum_types v0.4` (#10217) * fix(rpc-types): remove uint and hash wrappers * fix(tests) * fix(cleanup) * grumbles(rpc-api): revert `verify_signature` * revert change of `U64` -> `u64` * fix(cleanup after bad merge) * chore(bump ethereum-types) * fix(bad merge) * feat(tests ethereum-types): add tests * chore(update `ethereum-types` to 0.4.2) * feat(tests for h256) * chore(rpc): remove `ethbloom` import Use re-export from `ethereum-types` instead * fix(bad merge): remove `DefaultAccount` type * doc(add TODO with issue link) * chore(bump ethereum-types) (#10396) Fixes a de-serialization bug in `ethereum-tyes` * fix(light eth_gasPrice): ask network if not in cache (#10535) * fix(light eth_gasPrice): ask N/W if not in cache * fix(bad rebase) * fix(light account response): update `tx_queue` (#10545) * fix(bump dependencies) (#10540) * cargo update -p log:0.4.5 * cargo update -p regex:1.0.5 * cargo update -p parking_lot * cargo update -p serde_derive * cargo update -p serde_json * cargo update -p serde * cargo update -p lazy_static * cargo update -p num_cpus * cargo update -p toml # Conflicts: # Cargo.lock * tx-pool: check transaction readiness before replacing (#10526) * Update to vanilla tx pool error * Prevent a non ready tx replacing a ready tx * Make tests compile * Test ready tx not replaced by future tx * Transaction indirection * Use StateReadiness to calculate Ready in `should_replace` * Test existing txs from same sender are used to compute Readiness * private-tx: Wire up ShouldReplace * Revert "Use StateReadiness to calculate Ready in `should_replace`" This reverts commit af9e69c * Make replace generic so it works with private-tx * Rename Replace and add missing docs * ShouldReplace no longer mutable * tx-pool: update to transaction-pool 2.0 from crates.io * tx-pool: generic error type alias * Exit early for first unmatching nonce * Fix private-tx test, use existing write lock * Use read lock for pool scoring * fix #10390 (#10391) * private-tx: replace error_chain (#10510) * Update to vanilla tx pool error * private-tx: remove error-chain, implement Error, derive Display * private-tx: replace ErrorKind and bail! * private-tx: add missing From impls and other compiler errors * private-tx: use original tx-pool error * Don't be silly cargo
This PR removes the RPC wrapper types
uint
andhash
becauseethereum-types v0.4
implements serde. Also nice to remove all this conversions betweenethereum-types
toRpcTypes
(I have not removed all those in this PR I will clean it up with another PR)Most changes are imports with a few exceptions also I decided not to
re-export
ethereum-types
instead each crate that is using them has to useethereum-types
instead!