gluonscan-testing 0.0.1-beta.1

Contract-based mock transports for gluonscan: replay recorded request/response contracts (HTTP/GraphQL, on-chain RPC; gRPC-ready) matched by filters.
Documentation

gluonscan-testing

Contract-based mock transports. A contract is a recorded pair: a [Match] (a filter over the outgoing request) and the response to reply with. You save the contracts (in code or as JSON files), declare the filters, and get deterministic, offline, testable results — the same model for HTTP/GraphQL ([MockHttp]), on-chain RPC ([MockChainProvider]), and, later, gRPC.

A request that matches no contract is an error, so tests fail loudly on unexpected calls.

use gluonscan_testing::{MockHttp, Match};
let http = MockHttp::new()
    .on(Match::body_contains("userSupplies"), r#"{"data":{"userSupplies":[]}}"#);