Skip to content

Commit

Permalink
chore: 🩹 update handler and run typegen
Browse files Browse the repository at this point in the history
  • Loading branch information
TDemeco committed Jan 31, 2025
1 parent 7e8ac08 commit 8e54d5c
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 4 deletions.
12 changes: 12 additions & 0 deletions api-augment/dist/interfaces/lookup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api-augment/dist/interfaces/lookup.js.map

Large diffs are not rendered by default.

35 changes: 34 additions & 1 deletion api-augment/dist/types/interfaces/augment-api-events.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,7 @@ declare module "@polkadot/api-base/types/events" {
providers: {
/**
* Event emitted when a provider has been slashed and they have reached a capacity deficit (i.e. the provider's capacity fell below their used capacity)
* signaling the end of the grace period since an automatic top up could not be performed due to insufficient free balance.
* signalling the end of the grace period since an automatic top up could not be performed due to insufficient free balance.
**/
AwaitingTopUp: AugmentedEvent<
ApiType,
Expand Down Expand Up @@ -2329,6 +2329,39 @@ declare module "@polkadot/api-base/types/events" {
nextBlockWhenChangeAllowed: u32;
}
>;
/**
* Event emitted when the account ID of a provider that has just been marked as insolvent can't be found in storage.
**/
FailedToGetOwnerAccountOfInsolventProvider: AugmentedEvent<
ApiType,
[providerId: H256],
{
providerId: H256;
}
>;
/**
* Event emitted when there's an error slashing the now insolvent provider.
**/
FailedToSlashInsolventProvider: AugmentedEvent<
ApiType,
[providerId: H256, amountToSlash: u128, error: SpRuntimeDispatchError],
{
providerId: H256;
amountToSlash: u128;
error: SpRuntimeDispatchError;
}
>;
/**
* Event emitted when there's an error stopping all cycles for an insolvent Backup Storage Provider.
**/
FailedToStopAllCyclesForInsolventBsp: AugmentedEvent<
ApiType,
[providerId: H256, error: SpRuntimeDispatchError],
{
providerId: H256;
error: SpRuntimeDispatchError;
}
>;
/**
* Event emitted when an MSP has been deleted.
**/
Expand Down
12 changes: 12 additions & 0 deletions api-augment/dist/types/interfaces/lookup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,18 @@ declare const _default: {
providerId: string;
amount: string;
};
FailedToGetOwnerAccountOfInsolventProvider: {
providerId: string;
};
FailedToSlashInsolventProvider: {
providerId: string;
amountToSlash: string;
error: string;
};
FailedToStopAllCyclesForInsolventBsp: {
providerId: string;
error: string;
};
ProviderInsolvent: {
providerId: string;
};
Expand Down
18 changes: 18 additions & 0 deletions api-augment/dist/types/interfaces/types-lookup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,21 @@ declare module "@polkadot/types/lookup" {
readonly providerId: H256;
readonly amount: u128;
} & Struct;
readonly isFailedToGetOwnerAccountOfInsolventProvider: boolean;
readonly asFailedToGetOwnerAccountOfInsolventProvider: {
readonly providerId: H256;
} & Struct;
readonly isFailedToSlashInsolventProvider: boolean;
readonly asFailedToSlashInsolventProvider: {
readonly providerId: H256;
readonly amountToSlash: u128;
readonly error: SpRuntimeDispatchError;
} & Struct;
readonly isFailedToStopAllCyclesForInsolventBsp: boolean;
readonly asFailedToStopAllCyclesForInsolventBsp: {
readonly providerId: H256;
readonly error: SpRuntimeDispatchError;
} & Struct;
readonly isProviderInsolvent: boolean;
readonly asProviderInsolvent: {
readonly providerId: H256;
Expand Down Expand Up @@ -1836,6 +1851,9 @@ declare module "@polkadot/types/lookup" {
| "Slashed"
| "AwaitingTopUp"
| "TopUpFulfilled"
| "FailedToGetOwnerAccountOfInsolventProvider"
| "FailedToSlashInsolventProvider"
| "FailedToStopAllCyclesForInsolventBsp"
| "ProviderInsolvent"
| "BucketRootChanged"
| "MultiAddressAdded"
Expand Down
26 changes: 25 additions & 1 deletion api-augment/src/interfaces/augment-api-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ declare module "@polkadot/api-base/types/events" {
providers: {
/**
* Event emitted when a provider has been slashed and they have reached a capacity deficit (i.e. the provider's capacity fell below their used capacity)
* signaling the end of the grace period since an automatic top up could not be performed due to insufficient free balance.
* signalling the end of the grace period since an automatic top up could not be performed due to insufficient free balance.
**/
AwaitingTopUp: AugmentedEvent<
ApiType,
Expand Down Expand Up @@ -1805,6 +1805,30 @@ declare module "@polkadot/api-base/types/events" {
nextBlockWhenChangeAllowed: u32;
}
>;
/**
* Event emitted when the account ID of a provider that has just been marked as insolvent can't be found in storage.
**/
FailedToGetOwnerAccountOfInsolventProvider: AugmentedEvent<
ApiType,
[providerId: H256],
{ providerId: H256 }
>;
/**
* Event emitted when there's an error slashing the now insolvent provider.
**/
FailedToSlashInsolventProvider: AugmentedEvent<
ApiType,
[providerId: H256, amountToSlash: u128, error: SpRuntimeDispatchError],
{ providerId: H256; amountToSlash: u128; error: SpRuntimeDispatchError }
>;
/**
* Event emitted when there's an error stopping all cycles for an insolvent Backup Storage Provider.
**/
FailedToStopAllCyclesForInsolventBsp: AugmentedEvent<
ApiType,
[providerId: H256, error: SpRuntimeDispatchError],
{ providerId: H256; error: SpRuntimeDispatchError }
>;
/**
* Event emitted when an MSP has been deleted.
**/
Expand Down
12 changes: 12 additions & 0 deletions api-augment/src/interfaces/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,18 @@ export default {
providerId: "H256",
amount: "u128"
},
FailedToGetOwnerAccountOfInsolventProvider: {
providerId: "H256"
},
FailedToSlashInsolventProvider: {
providerId: "H256",
amountToSlash: "u128",
error: "SpRuntimeDispatchError"
},
FailedToStopAllCyclesForInsolventBsp: {
providerId: "H256",
error: "SpRuntimeDispatchError"
},
ProviderInsolvent: {
providerId: "H256"
},
Expand Down
18 changes: 18 additions & 0 deletions api-augment/src/interfaces/types-lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1868,6 +1868,21 @@ declare module "@polkadot/types/lookup" {
readonly providerId: H256;
readonly amount: u128;
} & Struct;
readonly isFailedToGetOwnerAccountOfInsolventProvider: boolean;
readonly asFailedToGetOwnerAccountOfInsolventProvider: {
readonly providerId: H256;
} & Struct;
readonly isFailedToSlashInsolventProvider: boolean;
readonly asFailedToSlashInsolventProvider: {
readonly providerId: H256;
readonly amountToSlash: u128;
readonly error: SpRuntimeDispatchError;
} & Struct;
readonly isFailedToStopAllCyclesForInsolventBsp: boolean;
readonly asFailedToStopAllCyclesForInsolventBsp: {
readonly providerId: H256;
readonly error: SpRuntimeDispatchError;
} & Struct;
readonly isProviderInsolvent: boolean;
readonly asProviderInsolvent: {
readonly providerId: H256;
Expand Down Expand Up @@ -1919,6 +1934,9 @@ declare module "@polkadot/types/lookup" {
| "Slashed"
| "AwaitingTopUp"
| "TopUpFulfilled"
| "FailedToGetOwnerAccountOfInsolventProvider"
| "FailedToSlashInsolventProvider"
| "FailedToStopAllCyclesForInsolventBsp"
| "ProviderInsolvent"
| "BucketRootChanged"
| "MultiAddressAdded"
Expand Down
2 changes: 1 addition & 1 deletion api-augment/storagehub.json

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions client/indexer-service/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,17 @@ impl IndexerService {
pallet_storage_providers::Event::BspDeleted { provider_id } => {
Bsp::delete(conn, provider_id.to_string()).await?;
}
pallet_storage_providers::Event::FailedToGetOwnerAccountOfInsolventProvider {
..
} => {
// In the future we should monitor for this to detect eventual bugs in the pallets
}
pallet_storage_providers::Event::FailedToSlashInsolventProvider { .. } => {
// In the future we should monitor for this to detect eventual bugs in the pallets
}
pallet_storage_providers::Event::FailedToStopAllCyclesForInsolventBsp { .. } => {
// In the future we should monitor for this to detect eventual bugs in the pallets
}
pallet_storage_providers::Event::__Ignore(_, _) => {}
}
Ok(())
Expand Down

0 comments on commit 8e54d5c

Please sign in to comment.