-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Ethereum components from Frontier #9
Conversation
This reverts commit 37d2d58.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
I'm testing this manually trying to get it merged soon. I want to be able to deploy and execute some contract in the evm, and I can't yet do that. I'm trying with remix and also with polkadot js apps. Trying the node in instant seal and pow. It seems like I'm having fee related issues. Is there some particular gas price you have in mind, or other tips? |
I've messed with the address mapping a little bit. One bug I noticed is that both Alice and Bob can map the same ethereum H160 address, let's call it Gerald. This is trouble because if Gerald sends an eth transaction to pallet ethereum, only one of Alice or Bob will be charged fees. It might be nice to make a similar check to the one you make for Native addresses first. On a related note, I've got a start installing unified accounts which I think would be really nice in #20. What do you think about using that and eliminating the manual mapping? One thing we have to check is whether tolls that were built for pallet contracts are smart enough to support that. |
I've disabled fees, and I'm now able to deploy and call a contract using polkadot js. That's a good start! Now to Metamask. I can see my balance (with a funny number of decimals). But when I try to send tokens the transactions fail. |
#[derive(Clone)] | ||
pub struct TransactionConverter; | ||
|
||
impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter { | ||
fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { | ||
UncheckedExtrinsic::new_unsigned( | ||
pallet_ethereum::Call::<Runtime>::transact { transaction }.into(), | ||
) | ||
} | ||
} | ||
|
||
impl fp_rpc::ConvertTransaction<opaque::UncheckedExtrinsic> for TransactionConverter { | ||
fn convert_transaction( | ||
&self, | ||
transaction: pallet_ethereum::Transaction, | ||
) -> opaque::UncheckedExtrinsic { | ||
let extrinsic = UncheckedExtrinsic::new_unsigned( | ||
pallet_ethereum::Call::<Runtime>::transact { transaction }.into(), | ||
); | ||
let encoded = extrinsic.encode(); | ||
opaque::UncheckedExtrinsic::decode(&mut &encoded[..]) | ||
.expect("Encoded extrinsic is always valid") | ||
} | ||
} | ||
|
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.
I believe this is no longer necessary. See issue polkadot-evm/frontier#508 and PR polkadot-evm/frontier#559 for context.
This PR adds Ethereum compatibility components from Frontier. Solves #4.
TODO:
AccountMapping
schemepallet_evm::FindAuthor
runtime/src
with other pallets