Skip to content

Commit

Permalink
Manta parachain network support
Browse files Browse the repository at this point in the history
  • Loading branch information
rcrvano committed Feb 29, 2024
1 parent d6fb940 commit 1429e28
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion main/src/loaders/polkadotapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const PolkadotApi = (nodeUrl: string) => async (): Promise<ApiPromise> =>

let typesBundle = {}
// extra types for moonbeam/moonriver
if (environment.NETWORK === 'moonbeam' || environment.NETWORK === 'moonriver') {
if (environment.NETWORK === 'moonbeam' || environment.NETWORK === 'moonriver' || environment.NETWORK === 'manta') {
typesBundle = typesBundlePre900
}

Expand Down
1 change: 1 addition & 0 deletions main/src/modules/BlockListener/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class BlockListenerController {
this.listnerService.restartUnprocessedTasks(ENTITY.BLOCK)
res.send('restarted unprocessed')
})

this.expressApp.get('/process-block/:blockId', async (req, res) => {
if (isNaN(Number(req.params.blockId))) return res.json({ error: 'blockId must be a number' })
await this.listnerService.preloadOneBlock(Number(req.params.blockId))
Expand Down
2 changes: 1 addition & 1 deletion main/src/modules/Monitoring/helpers/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Logger } from 'pino'

@Service()
export class MonitoringDatabaseHelper {
constructor(@Inject('knex') private readonly knex: Knex, @Inject('logger') private readonly logger: Logger) {}
constructor(@Inject('knex') private readonly knex: Knex, @Inject('logger') private readonly logger: Logger) { }

/*
async roateOldRecords(): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion main/src/modules/Monitoring/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class MonitoringService {
})
return
}
if (environment.NETWORK === 'moonbeam' || environment.NETWORK === 'moonriver') {
if (environment.NETWORK === 'moonbeam' || environment.NETWORK === 'moonriver' || environment.NETWORK === 'manta') {
const missedRounds = await this.databaseHelper.getMissedRounds(lastDBBlock.metadata.round_id)
if (missedRounds && missedRounds.length) {
this.slackHelper.sendMessage(`Detected missed rounds: ${JSON.stringify(missedRounds)}`)
Expand Down
4 changes: 2 additions & 2 deletions main/src/modules/MoonbeamStakingProcessor/round-payout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class MoonbeamStakingProcessorRoundPayout {
value,
] of atStake) {
//console.log("VALUE", value)
const { bond, total, delegations, nominators } = specVersion < 2600 ? value : value.unwrap()
const { bond, total, delegations, nominators } = specVersion >= 2600 && environment.NETWORK !== 'manta' ? value.unwrap : value
console.log('BOND', bond)
console.log('total', total)
console.log('delegations', delegations.length)
Expand Down Expand Up @@ -369,7 +369,7 @@ export class MoonbeamStakingProcessorRoundPayout {
})
}

if (specVersion >= 2000) {
if (specVersion >= 2000 && environment.NETWORK !== 'manta') {
// Now orbiters have their own event. To replicate previous behavior,
// we take the collator associated and mark rewards as if they were
// to the collator
Expand Down
2 changes: 1 addition & 1 deletion main/src/modules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const ModulesLoader = async (): Promise<void> => {
if (environment.MODE === MODE.STAKING_PROCESSOR) {
if (environment.NETWORK === 'polkadot' || environment.NETWORK === 'kusama' || environment.NETWORK === 'vara') {
PolkadotStakingProcessor()
} else if (environment.NETWORK === 'moonbeam' || environment.NETWORK === 'moonriver') {
} else if (environment.NETWORK === 'moonbeam' || environment.NETWORK === 'moonriver' || environment.NETWORK === 'manta') {
MoonbeamStakingProcessor()
//MoonbeamStakingProcessorRecalc()
}
Expand Down

0 comments on commit 1429e28

Please sign in to comment.