Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update version and deployment to untangle the graph bug #188

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion subgraphs/cross-chain-governance/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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;
};
Expand Down
Loading