Skip to content

Commit 63b0c9c

Browse files
committed
Add README.md in external_program_for_testing
1 parent 1fab5ac commit 63b0c9c

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

solana/Anchor.toml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ members = ["programs/staking"]
88

99
[programs.localnet]
1010
staking = "DgCSKsLDXXufYeEkvf21YSX5DMnFK89xans5WdSsUbeY"
11-
external_program = "eLUV8cwhgUC2Bcu4UA16uhuMwK8zPkx3XSzt4hd3JJ3"
1211

1312
[programs.devnet]
1413
staking = "DgCSKsLDXXufYeEkvf21YSX5DMnFK89xans5WdSsUbeY"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# External Program for EVM-Solana E2E Testing
2+
3+
This folder contains a simple Anchor-based Solana program used exclusively for end-to-end (E2E) testing in the development environment.
4+
5+
The purpose of this program is to verify the proper execution of the `ReceiveMessage` instruction in the Solana devnet. By doing so, this program helps validate the delivery of cross-chain messages from EVM to Solana.
6+
7+
## Program Details
8+
The program consists of the following key elements:
9+
- **Initialize Instruction**: Sets up a configuration account with an admin address and initializes a counter to `0`.
10+
- **AdminAction Instruction**: Increments the counter only if the provided admin address matches the stored admin address.
11+
12+
### Purpose of the Counter
13+
The counter is used to ensure that the `AdminAction` instruction executes successfully in the Solana devnet. Each successful call increments the counter, which is logged for verification.
14+
15+
## How to Use
16+
1. Deploy the program to Solana devnet.
17+
2. Use the accompanying E2E test scripts to interact with this program.
18+
3. Verify that the instruction executes properly by observing the counter value in the logs.
19+
20+
## Testing Flow
21+
1. **Generate Payload**: The script generates a Solana instruction payload using this external program.
22+
2. **Dispatch Payload**: The payload is dispatched to Solana via the EVM contract (`HubSolanaMessageDispatcher`).
23+
3. **Verify Execution**: Check the success of the instruction by checking the increment of the counter.
24+
25+
## Note
26+
This program is intended **only for testing purposes** in the devnet and should not be used in production.

0 commit comments

Comments
 (0)