Skip to content

Commit

Permalink
Revert to /types
Browse files Browse the repository at this point in the history
  • Loading branch information
Corantin committed Aug 27, 2023
1 parent 95f0f49 commit fb712e9
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 54 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ package-lock.json
# Production
build
types
generated
subgraph.yaml
deploy-output.txt
12 changes: 6 additions & 6 deletions helpers/disputable.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { concat } from './bytes'
import { Agreement } from '../generated/templates/DisputeManager/Agreement'
import { Disputable, Dispute } from '../generated/schema'
import { concat } from "./bytes"
import { Agreement } from "../types/templates/DisputeManager/Agreement"
import { Disputable, Dispute } from "../types/schema"
import {
crypto,
Bytes,
Address,
BigInt,
log,
ByteArray,
} from '@graphprotocol/graph-ts'
} from "@graphprotocol/graph-ts"

// Rinkeby agreement-1hive.open.aragonpm.eth:
// const AGREEMENT_OPEN_APP_ID = '41dd0b999b443a19321f2f34fe8078d1af95a1487b49af4c2ca57fb9e3e5331e'

// xDai agreement.open.aragonpm.eth:
const AGREEMENT_OPEN_APP_ID =
'34c62f3aec3073826f39c2c35e9a1297d9dbf3cc77472283106f09eee9cf47bf'
"34c62f3aec3073826f39c2c35e9a1297d9dbf3cc77472283106f09eee9cf47bf"

const AGREEMENT_APP_ID_LENGTH = AGREEMENT_OPEN_APP_ID.length
const AGREEMENT_DISPUTE_METADATA_LENGTH = 64 // "[APP_ID][CHALLENGE_ID]" = 32 + 32
Expand All @@ -42,7 +42,7 @@ export function tryDecodingAgreementMetadata(dispute: Dispute): void {
if (
challengeData.reverted ||
challengeData.value.value1.toHexString() ==
'0x0000000000000000000000000000000000000000'
"0x0000000000000000000000000000000000000000"
)
return

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"scripts": {
"draw-schema": "./scripts/draw-schema.sh",
"build:graph": "graph build",
"build": "graph build",
"build:graph:rpc": "NETWORK=rpc npm run build:graph",
"build:graph:staging": "NETWORK=staging npm run build:graph",
"build:graph:rinkeby": "NETWORK=rinkeby npm run build:graph",
Expand All @@ -16,7 +16,7 @@
"build:manifest:goerli": "NETWORK=goerli npm run build:manifest",
"build:manifest:gnosis": "NETWORK=gnosis npm run build:manifest",
"build:manifest:polygon": "NETWORK=polygon npm run build:manifest",
"codegen": "graph codegen",
"codegen": "graph codegen -o types",
"codegen:rpc": "NETWORK=rpc npm run codegen",
"codegen:ropsten": "NETWORK=ropsten npm run codegen",
"codegen:staging": "NETWORK=staging npm run codegen",
Expand All @@ -42,4 +42,4 @@
"@graphprotocol/graph-cli": "^0.37.2",
"@graphprotocol/graph-ts": "^0.29.3"
}
}
}
10 changes: 0 additions & 10 deletions scripts/build-graph.sh

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/codegen.sh

This file was deleted.

12 changes: 6 additions & 6 deletions src/AragonCourt.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { BigInt, Bytes, Address, ethereum, log } from "@graphprotocol/graph-ts"
import { BLACKLISTED_MODULES } from "../helpers/blacklisted-modules"
import { updateCurrentSubscriptionPeriod } from "./Subscriptions"
import { ERC20 as ERC20Contract } from "../generated/AragonCourt/ERC20"
import { JurorsRegistry as JurorsRegistryContract } from "../generated/templates/JurorsRegistry/JurorsRegistry"
import { BrightIdRegister as BrightIdRegisterContract } from "../generated/AragonCourt/BrightIdRegister"
import { ERC20 as ERC20Contract } from "../types/AragonCourt/ERC20"
import { JurorsRegistry as JurorsRegistryContract } from "../types/templates/JurorsRegistry/JurorsRegistry"
import { BrightIdRegister as BrightIdRegisterContract } from "../types/AragonCourt/BrightIdRegister"
import {
ERC20,
CourtModule,
CourtConfig,
CourtTerm,
BrightIdRegisterModule,
JurorsRegistryModule,
} from "../generated/schema"
} from "../types/schema"
import {
BrightIdRegister,
DisputeManager,
JurorsRegistry,
Treasury,
Voting,
Subscriptions,
} from "../generated/templates"
} from "../types/templates"
import {
AragonCourt,
Heartbeat,
Expand All @@ -28,7 +28,7 @@ import {
ConfigGovernorChanged,
FeesUpdaterChanged,
ModulesGovernorChanged,
} from "../generated/AragonCourt/AragonCourt"
} from "../types/AragonCourt/AragonCourt"

let DISPUTE_MANAGER_TYPE = "DisputeManager"
let JURORS_REGISTRY_TYPE = "JurorsRegistry"
Expand Down
4 changes: 2 additions & 2 deletions src/Arbitrable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Evidence } from "../generated/schema"
import { Evidence } from "../types/schema"
import { ethereum, Bytes, BigInt, Address } from "@graphprotocol/graph-ts"
import { EvidenceSubmitted } from "../generated/templates/DisputeManager/Arbitrable"
import { EvidenceSubmitted } from "../types/templates/DisputeManager/Arbitrable"

export function handleEvidenceSubmittedWithArbitrator(
event: EvidenceSubmitted
Expand Down
6 changes: 3 additions & 3 deletions src/BrightIdRegister.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Address, BigInt, ethereum } from "@graphprotocol/graph-ts"
import { Juror } from "../generated/schema"
import { BrightIdRegister as BrightIdRegisterContract } from "../generated/AragonCourt/BrightIdRegister"
import { Register } from "../generated/templates/BrightIdRegister/BrightIdRegister"
import { Juror } from "../types/schema"
import { BrightIdRegister as BrightIdRegisterContract } from "../types/AragonCourt/BrightIdRegister"
import { Register } from "../types/templates/BrightIdRegister/BrightIdRegister"

export function handleUserRegistered(event: Register): void {
updateJuror(event.params.sender, event)
Expand Down
8 changes: 5 additions & 3 deletions src/DisputeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
Appeal,
JurorDispute,
JurorDraft,
} from "../generated/schema"
} from "../types/schema"
import {
DisputeManager,
NewDispute,
Expand All @@ -32,7 +32,7 @@ import {
RulingAppealed,
RulingAppealConfirmed,
RulingComputed,
} from "../generated/templates/DisputeManager/DisputeManager"
} from "../types/templates/DisputeManager/DisputeManager"

const JUROR_FEES = "Juror"
const APPEAL_FEES = "Appeal"
Expand Down Expand Up @@ -422,7 +422,9 @@ export function buildDraftId(roundId: BigInt, juror: Address): string {
}

export function buildJurorDisputeId(disputeId: BigInt, juror: Address): string {
return crypto.keccak256(Bytes.fromBigInt(disputeId).concat(juror)).toHexString()
return crypto
.keccak256(Bytes.fromBigInt(disputeId).concat(juror))
.toHexString()
}

function buildAppealId(disputeId: BigInt, roundId: BigInt): BigInt {
Expand Down
4 changes: 2 additions & 2 deletions src/JurorsRegistry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { buildId } from "../helpers/id"
import { Juror, ANJMovement, JurorsRegistryModule } from "../generated/schema"
import { Juror, ANJMovement, JurorsRegistryModule } from "../types/schema"
import { ethereum, Address, BigInt } from "@graphprotocol/graph-ts"
import {
Staked,
Expand All @@ -14,7 +14,7 @@ import {
JurorTokensCollected,
JurorSlashed,
JurorsRegistry,
} from "../generated/templates/JurorsRegistry/JurorsRegistry"
} from "../types/templates/JurorsRegistry/JurorsRegistry"

let STAKE = "Stake"
let UNSTAKE = "Unstake"
Expand Down
4 changes: 2 additions & 2 deletions src/Subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import {
JurorSubscriptionFee,
SubscriptionModule,
SubscriptionPeriod,
} from "../generated/schema"
} from "../types/schema"
import {
FeesClaimed,
FeeTokenChanged,
PeriodPercentageYieldChanged,
Subscriptions,
} from "../generated/templates/Subscriptions/Subscriptions"
} from "../types/templates/Subscriptions/Subscriptions"

let SUBSCRIPTIONS = "Subscriptions"

Expand Down
4 changes: 2 additions & 2 deletions src/Treasury.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { concat } from "../helpers/bytes"
import { buildId } from "../helpers/id"
import { FeeMovement, TreasuryBalance } from "../generated/schema"
import { FeeMovement, TreasuryBalance } from "../types/schema"
import {
Assign,
Withdraw,
Treasury,
} from "../generated/templates/Treasury/Treasury"
} from "../types/templates/Treasury/Treasury"
import { crypto, BigInt, Address, ethereum } from "@graphprotocol/graph-ts"

let WITHDRAW = "Withdraw"
Expand Down
8 changes: 4 additions & 4 deletions src/Voting.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JurorDraft, Vote } from "../generated/schema"
import { JurorDraft, Vote } from "../types/schema"
import {
buildDraftId,
decodeDisputeRoundId,
Expand All @@ -8,10 +8,10 @@ import {
VoteCommitted,
VoteLeaked,
VoteRevealed,
} from "../generated/templates/Voting/Voting"
} from "../types/templates/Voting/Voting"
import { Address, BigInt, ByteArray, ethereum } from "@graphprotocol/graph-ts"
import { Voting } from "../generated/templates/Voting/Voting"
import { Controller } from "../generated/templates/JurorsRegistry/Controller"
import { Voting } from "../types/templates/Voting/Voting"
import { Controller } from "../types/templates/JurorsRegistry/Controller"

export function handleVoteCommitted(event: VoteCommitted): void {
let disputeRoundId = event.params.voteId
Expand Down

0 comments on commit fb712e9

Please sign in to comment.