How to Test Your DApp
This guide provides instructions on testing your deployed DApp using command-line tools. It covers retrieving message status, inspecting arguments of emitted events by the Endpoint, and more. If you have not deployed your custom protocol yet, refer to the Getting Started guide before proceeding.
Hardhat Troubleshooting
Retrieving Account Balance
To get the balance of any account on an EVM-compatible network, execute the command below. It will print the specified account balance.
Fetching Block Data
To retrieve block details from an EVM-compatible network, execute the command below. It will output the block number, block hash, and creation timestamp.
Extracting Transaction Details
To obtain details of a specific transaction, execute the command below. It will output the sender address, the receiver address, msg.value, payload, and block number.
Printing Proposal Data
If a proposal was sent to the Endpoint, parse the emitted event by executing the below command. It will output the destination chain ID, msg.value, selector slot, agent parameters, sender address, destination address, encoded payload.
Retrieving Proposal and Message Hash
To find the message hash associated with a transaction hash from the source network, execute the command below. If a proposal is found in the transaction receipt, it will be reconstructed, and the corresponding message hashes will be displayed.
Status Codes
Advanced Interaction Using cast
For advanced debugging, you can interact directly with the MessageData
contract.
Check Message Status by Hash
To determine the current status of a sent message, execute the below command. If the transaction is found, the output will display its current status along with information from the initial proposal.
Retrieve Entire Message
Retrieve the full message, including status, nonce, and initial proposal:
Retrieve Initial Proposal & Source Chain Data
Retrieve Message Status
Retrieve Source Chain ID
Retrieve Destination Chain ID
Retrieve Initial msg.value
msg.value
UIP Specific Commands
Checking Message Execution on Endpoint
Status Codes
Last updated
Was this helpful?