Skip to content

Instantly share code, notes, and snippets.

// creating a state dump file (one time job), later on it's uploaded to S3 or something.
// We could build an API service with an archive node that can compute state dumps at any block you request and then cache them.
remote_externalities::Builder::new()
.module("PhragmenElection")
.uri(URI.to_owned())
.at(now)
.dump_to_file(format!("PhragmenElection-at-{}-polkadot.statedump", now, URI))
.await;
/// actual test (can be re-run as many times you want, without the need to access an actual node)
/// A helper type to allow using arbitrary SCALE-encoded leaf data in the RuntimeApi.
///
/// The point is to be able to verify MMR proofs from external MMRs, where we don't
/// know the exact leaf type, but it's enough for us to have it SCALE-encoded.
///
/// Note the leaf type should be encoded in it's compact form when passed through this type.
/// See [FullLeaf] documentation for details.
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
#[derive(RuntimeDebug, Clone, PartialEq)]
pub struct OpaqueLeaf(
type PayloadType = {
};
type EstimateFeeType = {};
class ApiCalls {
async estimateFee(chain: Chain, laneId: LaneId, payload: PayloadType): EstimateFeeType {
const payloadType = createType(chain, "OutboundPayload", payload);