Libuptest types

Libuptest comes prepackaged with several different types that will make debugging a bit easier.

Name:
H256

Description:
A H256 hash from fixed-hash, used as default blockhash.
Manually set a block hash:

#![allow(unused)]
fn main() {
let blockhash: H256 = H256::from_str("0x89a5dde6705d345117f442dfacf02f4a59bf5cea3ab713a5c07fc4cd78be3a31").unwrap();//get_latest_finalized_head(client.clone()).await.unwrap();
}

Used in code examples:
detect_runtime_upgrade
get_block_event


Name: Header struct
Description: Block Header containing the block nr

Used in code examples: Define a block header standard that subscribe to finalized heads returns:
get_block_events


Name:
event_summary struct

Description:
event_summary is an easy high level way for developers to define a custom event.
Create a generic event in the form of:

#![allow(unused)]
fn main() {
let myevent: event_summary = event_summary {
	pub pallet_name: "Sudo".to_string(),
	pub pallet_method: "secret_function".to_string(),
 }
}

Used in code examples:
decode_extrinsics
get_block_events
schedule_check
upgrade_change_diff


Name:
storage_types

Description:
enum for defining what type of storage entry it is, is it a StorageValue, StorageMap or Unknown type?

Used in code examples:
pallet_storage_parse module


Name: Block struct

Description:
Generic substrate sp-runtime block containing header and extrinsics.

Used in code examples:


Name: PreBlock struct

Description: A pre-block containing a block and justifications.

Used in code examples:
block_events
detect_runtime_upgrade


Name:
generic_block Description:
A generic block format containing a Header and a Vector of strings.

Used in code examples:


Name:
RuntimeVersionEvent

Description:
Runtime Version Event struct containing a spec version number(u32).

Used in code examples:


Name: RuntimeEvent

Description:
Runtime event, returning a RuntimeVersionEvent if it has a value, if not it returns an error

Used in code examples:


Name:
storage_map_info struct

Description:

#![allow(unused)]
fn main() {
    pub pallet_name: String,
    pub storage_item_name: String, // name of storagemap
    pub type_id: u32,              // take the type id and query the type_id to type function
    pub raw_type: desub_current::scale_info::TypeDef<PortableForm>,
    pub storage_type: storage_types,
}

Used in code examples:
upgrade_change_diff
get_pallet_storagemaps_storagevalues

Libuptest docs.rs type documentation