-
Notifications
You must be signed in to change notification settings - Fork 16
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
Detect relevant IbcRelay actions #1805
Conversation
🦋 Changeset detectedLatest commit: e9a8d16 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
a273493
to
b11f4fa
Compare
/// Checks if address is controlled by view server full viewing key | ||
#[wasm_bindgen] | ||
pub fn is_controlled_address(&self, address: &[u8]) -> WasmResult<bool> { | ||
utils::set_panic_hook(); | ||
|
||
let address: Address = Address::decode(address)?; | ||
Ok(is_controlled_inner(&self.fvk, &address)) | ||
} |
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.
Added to the ViewServer as it makes it easier to access from within the block processor
Some type registry updates are needed for this PR. Will re-request review when ready. |
35000bf
to
8e9bc8c
Compare
@@ -48,7 +48,7 @@ export const TxViewer = ({ txInfo }: { txInfo?: TransactionInfo }) => { | |||
|
|||
// use React-Query to invoke custom hooks that call async translators. | |||
const { data: receiverView } = useQuery( | |||
['receiverView', txInfo, option], | |||
['receiverView', txInfo?.toJson({ typeRegistry }), option], |
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.
Now that we are saving relay transactions, there is a chance of an Any
field needing to be serialized. For that reason, it needs access to the registry to know how to serialize/deserialize. Hence, why you see typeRegistry
being added to a number of from/toJson() methods.
// gen/ibc/core/channel/v1/tx_pb | ||
MsgRecvPacket, | ||
|
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.
Not necessary to list specifically in the registry as it exists in the newly added IbcChannelMsgService
already
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.
const dataString = new TextDecoder().decode(packet.data); | ||
return FungibleTokenPacketData.fromJsonString(dataString); | ||
} catch (e) { | ||
return undefined; |
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.
Suggestion: should we error-log here, or display something to the user even?
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.
Hmm, perhaps we do. I'll handle the case where the packet cannot be parsed and display Unknown packet data
in the row.
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
At the moment, after a user makes a Ics20Transfer, Prax is not indexing the transaction for the IbcRelay action. This can cause confusion for users wondering the status of transaction.
This PR detects the relay action and, if the user is the recipient, adds it to the tx db.