Module hb_examples.erl¶
This module contains end-to-end tests for Hyperbeam, accessing through the HTTP interface.
Description¶
As well as testing the system, you can use these tests as examples of how to interact with HyperBEAM nodes.
Function Index¶
create_schedule_aos2_test_disabled/0* | |
paid_wasm/0* | |
paid_wasm_test_/0* | Gain signed WASM responses from a node and verify them. |
relay_with_payments_test/0* | |
relay_with_payments_test_/0* | Start a node running the simple pay meta device, and use it to relay a message for a client. |
schedule/2* | |
schedule/3* | |
schedule/4* |
Function Details¶
create_schedule_aos2_test_disabled/0 *¶
create_schedule_aos2_test_disabled() -> any()
paid_wasm/0 *¶
paid_wasm() -> any()
paid_wasm_test_/0 *¶
paid_wasm_test_() -> any()
Gain signed WASM responses from a node and verify them. 1. Start the client with a small balance. 2. Execute a simple WASM function on the host node. 3. Verify the response is correct and signed by the host node. 4. Get the balance of the client and verify it has been deducted.
relay_with_payments_test/0 *¶
relay_with_payments_test() -> any()
relay_with_payments_test_/0 *¶
relay_with_payments_test_() -> any()
Start a node running the simple pay meta device, and use it to relay a message for a client. We must ensure: 1. When the client has no balance, the relay fails. 2. The operator is able to topup for the client. 3. The client has the correct balance after the topup. 4. The relay succeeds when the client has enough balance. 5. The received message is signed by the host using http-sig and validates correctly.
schedule/2 *¶
schedule(ProcMsg, Target) -> any()
schedule/3 *¶
schedule(ProcMsg, Target, Wallet) -> any()
schedule/4 *¶
schedule(ProcMsg, Target, Wallet, Node) -> any()