pub trait GovernedMapDataSource {
// Required methods
fn get_state_at_block<'life0, 'async_trait>(
&'life0 self,
mc_block: McBlockHash,
main_chain_scripts: MainChainScriptsV1,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<String, ByteString>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_mapping_changes<'life0, 'async_trait>(
&'life0 self,
since_mc_block: Option<McBlockHash>,
up_to_mc_block: McBlockHash,
main_chain_scripts: MainChainScriptsV1,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Option<ByteString>)>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Cardano observability data source API used by GovernedMapInherentDataProvider.
Required Methods§
Sourcefn get_state_at_block<'life0, 'async_trait>(
&'life0 self,
mc_block: McBlockHash,
main_chain_scripts: MainChainScriptsV1,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<String, ByteString>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_state_at_block<'life0, 'async_trait>(
&'life0 self,
mc_block: McBlockHash,
main_chain_scripts: MainChainScriptsV1,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<String, ByteString>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns all key-value mappings stored in the Governed Map on Cardano after execution of mc_block
.
Sourcefn get_mapping_changes<'life0, 'async_trait>(
&'life0 self,
since_mc_block: Option<McBlockHash>,
up_to_mc_block: McBlockHash,
main_chain_scripts: MainChainScriptsV1,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Option<ByteString>)>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_mapping_changes<'life0, 'async_trait>(
&'life0 self,
since_mc_block: Option<McBlockHash>,
up_to_mc_block: McBlockHash,
main_chain_scripts: MainChainScriptsV1,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Option<ByteString>)>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Queries all changes that occurred in the mappings of the Governed Map on Cardano in the given range of blocks.
§Arguments:
since_mc_block
: lower bound (exclusive). If None, the data source should return all changes since the genesis block.up_to_block
: upper bound (inclusive).
§Return value:
Items in the returned vector should be key-value pairs representing changes to the Governed Map. Inserts and updates should be represented as a Some containing the new value, while deletions should be indicated by a None. The vector should be ordered from the oldest change to the newest.