diff --git a/subgraphs/cross-chain-governance/package.json b/subgraphs/cross-chain-governance/package.json index 39bcbf55..02b09e4a 100644 --- a/subgraphs/cross-chain-governance/package.json +++ b/subgraphs/cross-chain-governance/package.json @@ -1,6 +1,6 @@ { "name": "venus-cross-chain-governance-subgraph", - "version": "0.1.0", + "version": "0.1.7", "license": "MIT", "repository": { "url": "https://github.com/VenusProtocol/subgraphs", diff --git a/subgraphs/cross-chain-governance/src/mappings/omnichainGovernanceExecutor.ts b/subgraphs/cross-chain-governance/src/mappings/omnichainGovernanceExecutor.ts index ae15f6d5..54a0ee3a 100644 --- a/subgraphs/cross-chain-governance/src/mappings/omnichainGovernanceExecutor.ts +++ b/subgraphs/cross-chain-governance/src/mappings/omnichainGovernanceExecutor.ts @@ -82,7 +82,7 @@ export function handleUnpaused(): void { } export function handleSetMinDstGas(event: SetMinDstGas): void { - const destinationChain = getOrCreateDestinationChain(event.params._dstChainId); + const destinationChain = getOrCreateDestinationChain(event); destinationChain.minGas = event.params._minDstGas; destinationChain.packetType = event.params._type; destinationChain.save(); diff --git a/subgraphs/cross-chain-governance/src/operations/getOrCreate.ts b/subgraphs/cross-chain-governance/src/operations/getOrCreate.ts index bc455650..1cd4fc2c 100644 --- a/subgraphs/cross-chain-governance/src/operations/getOrCreate.ts +++ b/subgraphs/cross-chain-governance/src/operations/getOrCreate.ts @@ -1,6 +1,7 @@ import { Address, Bytes, ethereum } from '@graphprotocol/graph-ts'; import { OmnichainGovernanceExecutor } from '../../generated/OmnichainGovernanceExecutor/OmnichainGovernanceExecutor'; +import { SetMinDstGas } from '../../generated/OmnichainGovernanceExecutor/OmnichainGovernanceExecutor'; import { DestinationChain, FunctionRegistry, @@ -57,11 +58,15 @@ export const getOrCreateGovernanceRoute = ( return governanceRoute; }; -export const getOrCreateDestinationChain = (destinationChainId: i32): DestinationChain => { +export const getOrCreateDestinationChain = (event: SetMinDstGas): DestinationChain => { + const destinationChainId = event.params._dstChainId; let destinationChain = DestinationChain.load(getDestinationChainId(destinationChainId)); if (!destinationChain) { destinationChain = new DestinationChain(getDestinationChainId(destinationChainId)); destinationChain.chainId = destinationChainId; + destinationChain.packetType = event.params._type; + destinationChain.minGas = event.params._minDstGas; + destinationChain.save(); } return destinationChain; };