Skip to content

Commit 5ee8468

Browse files
committed
fix: deprecated delegatorAddress field
1 parent aa31a43 commit 5ee8468

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎packages/core-modules/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eclesia/core-modules-pg",
3-
"version": "2.14.3",
3+
"version": "2.14.4",
44
"description": "Eclesia postgres indexer core modules",
55
"type": "module",
66
"scripts": {

‎packages/core-modules/src/cosmos.staking.v1beta1/index.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ import {
167167
fileURLToPath,
168168
} from "node:url";
169169

170+
import {
171+
bech32,
172+
} from "bech32";
173+
170174
// ESM compatibility for __dirname
171175
const __filename = fileURLToPath(import.meta.url);
172176
const __dirname = path.dirname(__filename);
@@ -397,6 +401,9 @@ export class StakingModule implements Types.IndexingModule {
397401
"/cosmos.staking.v1beta1.MsgCreateValidator", async (event): Promise<void> => {
398402
const db = this.pgIndexer.getInstance();
399403
const msg = MsgCreateValidator.decode(event.value.tx);
404+
if (!msg.delegatorAddress) {
405+
msg.delegatorAddress = bech32.encode(this.chainPrefix, bech32.decode(msg.validatorAddress).words);
406+
}
400407
const key
401408
= msg.pubkey?.typeUrl == "/cosmos.crypto.ed25519.PubKey"
402409
? EdPubKey.decode(msg.pubkey.value)

0 commit comments

Comments
 (0)