Closed ken-futureverse closed 1 year ago
@jordy25519 following your suggestion #146, we are able to decode the Consensus log item but looks like the data inside the request object is hashed (sp_io::hashing::keccak_256(&event.abi_encode().as_slice()).to_vec()
, and that's why we cannot decode it using ethers.js
. I assume you hashed it to save the storage? Should we allow a non-hashed version?
File: /Users/ken/Workspace/futureverse/seed/pallet/ethy/src/types.rs
159: pub fn data(&self) -> Vec<u8> {
160: match self {
161: // Ethereum event signing requires keccak hashing the event
162: Self::Ethereum(event) =>
163: sp_io::hashing::keccak_256(&event.abi_encode().as_slice()).to_vec(),
164: // XRPL tx hashing must happen before signing to inject the public key
165: Self::XrplTx(data) => data.clone(),
166: }
167: }
@jordy25519 following your suggestion #146, we are able to decode the Consensus log item but looks like the data inside the request object is hashed (
sp_io::hashing::keccak_256(&event.abi_encode().as_slice()).to_vec()
, and that's why we cannot decode it usingethers.js
. I assume you hashed it to save the storage? Should we allow a non-hashed version?File: /Users/ken/Workspace/futureverse/seed/pallet/ethy/src/types.rs 159: pub fn data(&self) -> Vec<u8> { 160: match self { 161: // Ethereum event signing requires keccak hashing the event 162: Self::Ethereum(event) => 163: sp_io::hashing::keccak_256(&event.abi_encode().as_slice()).to_vec(), 164: // XRPL tx hashing must happen before signing to inject the public key 165: Self::XrplTx(data) => data.clone(), 166: } 167: }
makes sense, sorry about the wild goose chase! merged the PR
Currently only send
eventId
andchainId
which is an enum saying it'sEthereum
orXRPL
{ chainId: { __kind: 'Ethereum' }, eventProofId: '42' }
Expecting the event to send the whole event proof info