Select Git revision
cross-build-arm.sh
-
Éloïs authored
* feat(weights): use our benchmarks for pallet proxy * feat(weights): use our benchmarks for pallet multisig * fix(benchmarks): some pallets benchmarking need access to system.remark * feat(weights): use our benchmarks for pallet timestamp * feat(weights): use our benchmarks for pallet scheduler * fix(weights): impl proper weights & benchmarks for pallet upgrade origin * doc(dev):weights-bench: reference machine should use an SSD with USB3 * style(clippy): allow unnecessary_cast for WeighInfo implementations * doc(dev): add "how to benchmarks weights of a Call/Hook/Pallet" * feat(runtimes): use our benchmarks for pallet universal dividend * feat(pallet_ud): add weights info * feat(pallet_ud): add benchmarking * fix(weights): use our own extrinsic base weights constant * feat(weights): use our benchmarks for frame_system * feat(weights): use our benchmarks for pallet balance * fix(accounts): providers should be inc as soon as the account recv money providers should be incremented as soon as the account receive funds * fix(gdev): fix runtime benchmarks compilation
Éloïs authored* feat(weights): use our benchmarks for pallet proxy * feat(weights): use our benchmarks for pallet multisig * fix(benchmarks): some pallets benchmarking need access to system.remark * feat(weights): use our benchmarks for pallet timestamp * feat(weights): use our benchmarks for pallet scheduler * fix(weights): impl proper weights & benchmarks for pallet upgrade origin * doc(dev):weights-bench: reference machine should use an SSD with USB3 * style(clippy): allow unnecessary_cast for WeighInfo implementations * doc(dev): add "how to benchmarks weights of a Call/Hook/Pallet" * feat(runtimes): use our benchmarks for pallet universal dividend * feat(pallet_ud): add weights info * feat(pallet_ud): add benchmarking * fix(weights): use our own extrinsic base weights constant * feat(weights): use our benchmarks for frame_system * feat(weights): use our benchmarks for pallet balance * fix(accounts): providers should be inc as soon as the account recv money providers should be incremented as soon as the account receive funds * fix(gdev): fix runtime benchmarks compilation
data_handler.ts 26.49 KiB
import { strict as assert } from 'assert';
import { In } from "typeorm";
import {
Account,
Cert,
CertEvent,
ChangeOwnerKey,
Event,
EventType,
Identity,
IdentityStatus,
MembershipEvent,
SmithEvent,
SmithEventType,
Smith,
SmithCert,
SmithStatus,
PopulationHistory,
Transfer,
TxComment,
UdReeval,
UniversalDividend,
Validator,
} from "./model";
import { Address, BlockNumber, Ctx, Data, IdtyIndex, NewData } from "./types_custom";
import { hexToString } from "./utils";
import { events } from "./types";
import { getCommentType } from "./comment";
export class DataHandler {
private data: Data;
constructor() {
this.data = {
accounts: new Map(),
identities: new Map(),
smiths: new Map(),
populationHistories: [],
validators: new Map(),
membershipEvents: [],
smithEvents: [],
changeOwnerKey: [],
transfers: new Map(),
certification: new Map(),
certEvent: [],
smithCert: new Map(),
universalDividend: [],
udReeval: [],
comments: []
};
}
async processNewData(newData: NewData, ctx: Ctx) {
// Process population history by adding the value
// of the last point in database.
if (newData.populationHistories) {
const lastHistory = await ctx.store.findOneOrFail(PopulationHistory, {
where: {},
order: { blockNumber: 'DESC' }
});
this.data.populationHistories = newData.populationHistories.map(history => (new PopulationHistory({
activeAccountCount: history.activeAccountCount + lastHistory.activeAccountCount,
memberCount: history.memberCount + lastHistory.memberCount,
smithCount: history.smithCount + lastHistory.smithCount,
blockNumber: history.blockNumber,
id: `population-${history.blockNumber}`,
})));
}