diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b3cb790e..7e5e2084 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest services: a3p: - image: ghcr.io/agoric/agoric-3-proposals:latest + image: ghcr.io/agoric/agoric-3-proposals@sha256:644e09bf041e5588570ff9a49e6129cc468e9c8458417541027e8532cb91083b ports: - 26657:26657 postgres: diff --git a/docker-compose.yml b/docker-compose.yml index abe34630..ddd67f4f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: retries: 5 subquery-node: - image: subquerynetwork/subql-node-cosmos:v3.12.0 + image: subquerynetwork/subql-node-cosmos:v4.2.1 depends_on: 'postgres': condition: service_healthy diff --git a/package.json b/package.json index fb463d05..2811b755 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "devDependencies": { "@cosmjs/stargate": "^0.28.9", "@subql/cli": "^5.4.0", - "@subql/node-cosmos": "^4.2.1", + "@subql/node-cosmos": "4.2.1", "@subql/testing": "latest", "prettier": "^3.4.2", "starknet": "6.11.0", diff --git a/src/mappings/constants.ts b/src/mappings/constants.ts index 97b9d91b..1bb115ed 100644 --- a/src/mappings/constants.ts +++ b/src/mappings/constants.ts @@ -1,4 +1,4 @@ -import { b64encode } from './utils'; +import {} from './utils'; export const EVENT_TYPES = { ACTIVE_PROPOSAL: 'active_proposal', @@ -43,11 +43,11 @@ export const PACKET_SRC_CHANNEL_KEY = 'packet_src_channel'; export const PACKET_DST_CHANNEL_KEY = 'packet_dst_channel'; export const PACKET_SRC_PORT_KEY = 'packet_src_port'; export const PACKET_DST_PORT_KEY = 'packet_dst_port'; -export const ACTION_KEY = b64encode('action'); -export const IBC_MESSAGE_TRANSFER_VALUE = b64encode('/ibc.applications.transfer.v1.MsgTransfer'); -export const IBC_MESSAGE_RECEIVE_PACKET_VALUE = b64encode('/ibc.core.channel.v1.MsgRecvPacket'); -export const RECEPIENT_KEY = b64encode('recipient'); -export const SENDER_KEY = b64encode('sender'); -export const RECEIVER_KEY = b64encode('receiver'); -export const AMOUNT_KEY = b64encode('amount'); +export const ACTION_KEY = 'action'; +export const IBC_MESSAGE_TRANSFER_VALUE = '/ibc.applications.transfer.v1.MsgTransfer'; +export const IBC_MESSAGE_RECEIVE_PACKET_VALUE = '/ibc.core.channel.v1.MsgRecvPacket'; +export const RECEPIENT_KEY = 'recipient'; +export const SENDER_KEY = 'sender'; +export const RECEIVER_KEY = 'receiver'; +export const AMOUNT_KEY = 'amount'; export const TRANSFER_PORT_VALUE = 'transfer'; diff --git a/src/mappings/events/vaults.ts b/src/mappings/events/vaults.ts index 70c241d8..0528aa8d 100644 --- a/src/mappings/events/vaults.ts +++ b/src/mappings/events/vaults.ts @@ -34,7 +34,6 @@ export const vaultsEventKit = (block: any, data: any, module: string, path: stri } async function saveWallets(payload: any): Promise[]> { - logger.info(`PAYLOAD: ${JSON.stringify(payload)}`); const promises: Promise[] = []; const address = path.split('.')[2]; const wallet = new Wallet(path, BigInt(data.blockHeight), block.block.header.time as any, address); diff --git a/src/mappings/mappingHandlers.ts b/src/mappings/mappingHandlers.ts index 460e5e96..17ff2ee7 100644 --- a/src/mappings/mappingHandlers.ts +++ b/src/mappings/mappingHandlers.ts @@ -156,9 +156,6 @@ export async function handleBundleInstallMessage(message: CosmosMessage): Promis export async function handleStateChangeEvent(cosmosEvent: CosmosEvent): Promise { const { event, block } = cosmosEvent as CosmosEvent & { event: tendermint37.Event }; - logger.info(`EVENT ${JSON.stringify(event)}`); - logger.info(`EVENT TYPE:${event.type}`); - if (event.type != EVENT_TYPES.STATE_CHANGE) { logger.warn('Not valid state_change event.'); return; @@ -183,8 +180,7 @@ export async function handleStateChangeEvent(cosmosEvent: CosmosEvent): Promise< let data = Object(); try { - const decodedValue = - valueAttr.key === UNPROVED_VALUE_KEY ? b64decode(b64decode(valueAttr.value)) : b64decode(valueAttr.value); + const decodedValue = valueAttr.key === UNPROVED_VALUE_KEY ? b64decode(valueAttr.value) : valueAttr.value; data = JSON.parse(decodedValue); } catch (e) { return; @@ -195,10 +191,7 @@ export async function handleStateChangeEvent(cosmosEvent: CosmosEvent): Promise< return; } - const decodedKey = - keyAttr.key === SUBKEY_KEY - ? b64decode(b64decode(keyAttr.value)).replaceAll('\u0000', '\x00') - : b64decode(keyAttr.value); + const decodedKey = keyAttr.key === SUBKEY_KEY ? b64decode(keyAttr.value).replaceAll('\u0000', '\x00') : keyAttr.value; const path = extractStoragePath(decodedKey); const module = getStateChangeModule(path); diff --git a/yarn.lock b/yarn.lock index af4f2afb..4c0e2d2d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3305,7 +3305,7 @@ __metadata: languageName: node linkType: hard -"@subql/node-cosmos@npm:^4.2.1": +"@subql/node-cosmos@npm:4.2.1": version: 4.2.1 resolution: "@subql/node-cosmos@npm:4.2.1" dependencies: @@ -4107,7 +4107,7 @@ __metadata: dependencies: "@cosmjs/stargate": "npm:^0.28.9" "@subql/cli": "npm:^5.4.0" - "@subql/node-cosmos": "npm:^4.2.1" + "@subql/node-cosmos": "npm:4.2.1" "@subql/testing": "npm:latest" "@subql/types-cosmos": "npm:^4.0.0" "@subql/utils": "npm:^2.17.0"