Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,15 @@ stellar contract invoke --id $CONTRACT_ID --source-account <KEY> --network local
-- get_version
```

#### `ping`

Health check endpoint. Returns the current ledger timestamp (u64).

```bash
stellar contract invoke --id $CONTRACT_ID --source-account <KEY> --network local \
-- ping
```

#### `upgrade`

Upgrades the contract WASM in-place. Admin only. Existing storage and contract address are preserved.
Expand Down
9 changes: 9 additions & 0 deletions contracts/payment-processing-contract/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ fn test_get_version_after_set_admin() {
assert_eq!(client.get_version(), 1);
}

#[test]
fn test_ping() {
let (env, client) = setup();
env.ledger().with_mut(|li| {
li.timestamp = 12345;
});
assert_eq!(client.ping(), 12345);
}

// ── Merchant tests ────────────────────────────────────────────────────────────

#[test]
Expand Down
Loading