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: move liquidation logic to datasource from template [SF-925] #66

Merged
merged 1 commit into from
Nov 30, 2023
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 src/liquidation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Address, BigInt, log } from '@graphprotocol/graph-ts';
import { LiquidationExecuted } from '../generated/templates/LiquidationLogic/LiquidationLogic';
import { LiquidationExecuted } from '../generated/LiquidationLogic/LiquidationLogic';
import { initLiquidation } from './helper/initializer';

export function handleLiquidationExecuted(event: LiquidationExecuted): void {
Expand Down
36 changes: 18 additions & 18 deletions subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ dataSources:
- event: OrderPartiallyFilled(uint48,indexed address,indexed bytes32,uint8,uint256,uint256,uint256)
handler: handleOrderPartiallyFilled
file: ./src/fund-management.ts
- kind: ethereum
name: LiquidationLogic
network: ~
source:
abi: LiquidationLogic
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Liquidation
abis:
- name: LiquidationLogic
file: ./abis/protocol/libraries/logics/LiquidationLogic.sol/LiquidationLogic.json
eventHandlers:
- event: LiquidationExecuted(indexed address,bytes32,indexed bytes32,indexed uint256,uint256)
handler: handleLiquidationExecuted
file: ./src/liquidation.ts
templates:
- kind: ethereum
name: OrderActionLogic
Expand Down Expand Up @@ -110,21 +128,3 @@ templates:
- event: ItayoseExecuted(bytes32,uint256,uint256,uint256,uint256,uint256)
handler: handleItayoseExecuted
file: ./src/lending-market.ts
- kind: ethereum
name: LiquidationLogic
network: ~
source:
abi: LiquidationLogic
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Liquidation
abis:
- name: LiquidationLogic
file: ./abis/protocol/libraries/logics/LiquidationLogic.sol/LiquidationLogic.json
eventHandlers:
- event: LiquidationExecuted(indexed address,bytes32,indexed bytes32,indexed uint256,uint256)
handler: handleLiquidationExecuted
file: ./src/liquidation.ts
2 changes: 1 addition & 1 deletion test/mocks/liquidation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/ban-types */
import { Address, BigInt, Bytes, ethereum } from '@graphprotocol/graph-ts';
import { newMockEvent } from 'matchstick-as/assembly/index';
import { LiquidationExecuted } from '../../generated/templates/LiquidationLogic/LiquidationLogic';
import { LiquidationExecuted } from '../../generated/LiquidationLogic/LiquidationLogic';

export function createLiquidationExecutedEvent(
user: Address,
Expand Down