Skip to main content
Sign in
Snippets Groups Projects
Commit 1a93ca11 authored by Hugo Trentesaux's avatar Hugo Trentesaux Committed by poka
Browse files

fix change owner key previous account (!15)

* bump v0.1.2

* fetch account relation of identity
parent c44964da
No related branches found
No related tags found
1 merge request!15fix change owner key previous account
{
"name": "squid",
"version": "0.1.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "squid",
"version": "0.1.2",
"dependencies": {
"@belopash/typeorm-store": "^1.2.1",
"@subsquid/archive-registry": "^3.3.0",
......
......
{
"name": "squid",
"version": "0.1.1",
"version": "0.1.2",
"private": true,
"engines": {
"node": ">=20"
......
......
......@@ -130,8 +130,7 @@ export class DataHandler {
// Process identity owner key changes
for (const idtyChange of newData.idtyChangedOwnerKey) {
const idty = await this.getIdtyByIndexOrFail(ctx, idtyChange.index);
const idty = await this.getIdtyWithAccountByIndexOrFail(ctx, idtyChange.index);
const new_account = await this.getOrCreateAccount(ctx, idtyChange.accountId);
// add change owner key event
this.data.changeOwnerKey.push(
......@@ -532,4 +531,13 @@ export class DataHandler {
ctx.store.findOneByOrFail(Identity, { index })
);
}
async getIdtyWithAccountByIndexOrFail(ctx: Ctx, index: IdtyIndex): Promise<Identity> {
return (
this.data.identities.get(index) ??
await ctx.store.findOneOrFail(Identity, {
relations: { account: true },
where: { index: index },
}))
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment