diff --git a/.github/workflows/voting-subgraph-ci-cd.yml b/.github/workflows/voting-subgraph-ci-cd.yml new file mode 100644 index 00000000..9793242f --- /dev/null +++ b/.github/workflows/voting-subgraph-ci-cd.yml @@ -0,0 +1,47 @@ +name: Connect Voting Subgraph CI/CD +on: + push: + paths: + - 'packages/connect-voting/subgraph/**' + branches: + - master + - develop + +env: + GRAPHKEY: ${{secrets.GRAPHKEY}} + working-directory: packages/connect-voting/subgraph + +jobs: + deploy: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ${{env.working-directory}} + steps: + - uses: actions/checkout@v2 + + - name: Install node + uses: actions/setup-node@v1 + with: + node-version: 14.15.5 + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Cache yarn modules + uses: actions/cache@v2 + with: + path: '**/node_modules' + key: yarn-${{ hashFiles('yarn.lock') }} + + - name: Deploy rinkeby + if: github.ref == 'refs/heads/develop' + run: yarn deploy-rinkeby + + - name: Deploy rinkeby staging + if: github.ref == 'refs/heads/develop' + run: yarn deploy-rinkeby-staging + + - name: Deploy mainnet + if: github.ref == 'refs/heads/master' + run: yarn deploy-mainnet diff --git a/examples/nodejs/src/subscriptions-low-level.ts b/examples/nodejs/src/subscriptions-low-level.ts index 07458f69..8996cfab 100644 --- a/examples/nodejs/src/subscriptions-low-level.ts +++ b/examples/nodejs/src/subscriptions-low-level.ts @@ -20,6 +20,7 @@ async function main() { id metadata creator + originalCreator } } `, diff --git a/examples/nodejs/src/voting-low-level.ts b/examples/nodejs/src/voting-low-level.ts index bd0a7d39..da403d12 100644 --- a/examples/nodejs/src/voting-low-level.ts +++ b/examples/nodejs/src/voting-low-level.ts @@ -13,6 +13,7 @@ query { id metadata creator + originalCreator } } ` diff --git a/packages/connect-disputable-voting/src/__test__/thegraph/votes.test.ts b/packages/connect-disputable-voting/src/__test__/thegraph/votes.test.ts index 2d46deb7..7af46653 100644 --- a/packages/connect-disputable-voting/src/__test__/thegraph/votes.test.ts +++ b/packages/connect-disputable-voting/src/__test__/thegraph/votes.test.ts @@ -24,6 +24,7 @@ describe('DisputableVoting votes', () => { expect(vote.context).toBe('Context for action 4') expect(vote.voteStatus).toBe('Disputed') expect(vote.creator).toBe('0x0090aed150056316e37fe6dfa10dc63e79d173b6') + expect(vote.originalCreator).toBeDefined() expect(vote.startDate).toBe('1598480213') expect(vote.totalPower).toBe('3000000000000000000') expect(vote.snapshotBlock).toBe('7088291') @@ -74,6 +75,7 @@ describe('DisputableVoting votes', () => { expect(vote.voteStatus).toBe('Settled') expect(vote.context).toBe('Context for action 3') expect(vote.creator).toBe('0x0090aed150056316e37fe6dfa10dc63e79d173b6') + expect(vote.originalCreator).toBeDefined() expect(vote.startDate).toBe('1598480123') expect(vote.totalPower).toBe('3000000000000000000') expect(vote.snapshotBlock).toBe('7088285') diff --git a/packages/connect-disputable-voting/src/models/Vote.ts b/packages/connect-disputable-voting/src/models/Vote.ts index 4e3a2243..c61be215 100644 --- a/packages/connect-disputable-voting/src/models/Vote.ts +++ b/packages/connect-disputable-voting/src/models/Vote.ts @@ -24,6 +24,7 @@ export default class Vote { readonly votingId: string readonly voteId: string readonly creator: string + readonly originalCreator: string readonly duration: string readonly context: string readonly voteStatus: string @@ -69,6 +70,7 @@ export default class Vote { this.duration = data.duration this.quietEndingExtension = data.quietEndingExtension this.creator = data.creator + this.originalCreator = data.originalCreator this.context = data.context this.voteStatus = data.status this.actionId = data.actionId diff --git a/packages/connect-disputable-voting/src/thegraph/parsers/votes.ts b/packages/connect-disputable-voting/src/thegraph/parsers/votes.ts index 7554b5ce..ccb9ca0a 100644 --- a/packages/connect-disputable-voting/src/thegraph/parsers/votes.ts +++ b/packages/connect-disputable-voting/src/thegraph/parsers/votes.ts @@ -9,6 +9,7 @@ function buildVote(vote: any, connector: any, provider: any): Vote { voting, voteId, creator, + originalCreator, context, status, actionId, @@ -42,6 +43,7 @@ function buildVote(vote: any, connector: any, provider: any): Vote { votingId: voting.id, voteId, creator, + originalCreator, duration: setting.voteTime, quietEndingExtension: setting.quietEndingExtension, context, diff --git a/packages/connect-disputable-voting/src/thegraph/queries/index.ts b/packages/connect-disputable-voting/src/thegraph/queries/index.ts index 255fdc2e..9ff0e465 100644 --- a/packages/connect-disputable-voting/src/thegraph/queries/index.ts +++ b/packages/connect-disputable-voting/src/thegraph/queries/index.ts @@ -119,6 +119,7 @@ export const GET_VOTE = (type: string) => gql` } voteId creator + originalCreator context status actionId @@ -180,6 +181,7 @@ export const ALL_VOTES = (type: string) => gql` } voteId creator + originalCreator context status actionId diff --git a/packages/connect-disputable-voting/src/types.ts b/packages/connect-disputable-voting/src/types.ts index dd340562..e31fe51c 100644 --- a/packages/connect-disputable-voting/src/types.ts +++ b/packages/connect-disputable-voting/src/types.ts @@ -25,6 +25,7 @@ export interface VoteData { votingId: string voteId: string creator: string + originalCreator: string duration: string quietEndingExtension: string context: string diff --git a/packages/connect-disputable-voting/subgraph/schema.graphql b/packages/connect-disputable-voting/subgraph/schema.graphql index 449906e3..d5c3f6c2 100644 --- a/packages/connect-disputable-voting/subgraph/schema.graphql +++ b/packages/connect-disputable-voting/subgraph/schema.graphql @@ -29,6 +29,7 @@ type Vote @entity { voting: DisputableVoting! voteId: BigInt! creator: Bytes! + originalCreator: Bytes! context: String! status: VoteStatus! actionId: BigInt! diff --git a/packages/connect-disputable-voting/subgraph/src/DisputableVoting.ts b/packages/connect-disputable-voting/subgraph/src/DisputableVoting.ts index 7aa317ca..7b03745f 100644 --- a/packages/connect-disputable-voting/subgraph/src/DisputableVoting.ts +++ b/packages/connect-disputable-voting/subgraph/src/DisputableVoting.ts @@ -57,6 +57,7 @@ export function handleStartVote(event: StartVoteEvent): void { vote.voting = event.address.toHexString() vote.voteId = event.params.voteId vote.creator = event.params.creator + vote.originalCreator = event.transaction.from vote.context = event.params.context.toString() vote.yeas = voteData.value0 vote.nays = voteData.value1 diff --git a/packages/connect-disputable-voting/subgraph/yarn.lock b/packages/connect-disputable-voting/subgraph/yarn.lock index da725d49..2b374ded 100644 --- a/packages/connect-disputable-voting/subgraph/yarn.lock +++ b/packages/connect-disputable-voting/subgraph/yarn.lock @@ -23,10 +23,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@graphprotocol/graph-cli@^0.18.0": - version "0.18.0" - resolved "https://registry.yarnpkg.com/@graphprotocol/graph-cli/-/graph-cli-0.18.0.tgz#c09c6a54cb2da114c499b19de7adb74f0157fbd2" - integrity sha512-UsLB2LAwnVfUgkd4D0Rbfqq6ImLlDq9TEL/tBMYmZkB7pgnJZ/gJT5ouC33Gh0yhdXOYqWRk/KUcxSpgsKviPw== +"@graphprotocol/graph-cli@^0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@graphprotocol/graph-cli/-/graph-cli-0.19.0.tgz#c5c330f3ef9bb56ee5bec1e9da998638049dc0d3" + integrity sha512-rG6udMjMyXtCgX1oYyteM3ohecLV8JZqlQLzc8BSfw/g6+6dAVey6KQkJ04MRYJCv2VxrUVTYXu1AxzhXPJMkQ== dependencies: assemblyscript "https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3" chalk "^3.0.0" @@ -34,9 +34,9 @@ debug "^4.1.1" docker-compose "^0.23.2" dockerode "^2.5.8" - fs-extra "^8.1.0" + fs-extra "^9.0.0" glob "^7.1.2" - gluegun "^4.1.2" + gluegun "^4.3.1" graphql "^14.0.2" immutable "^3.8.2" ipfs-http-client "^34.0.0" @@ -51,10 +51,10 @@ optionalDependencies: keytar "^5.0.0" -"@graphprotocol/graph-ts@^0.18.1": - version "0.18.1" - resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.18.1.tgz#6aadeb3e6c01f4373978bd7dd4409305ba64ffce" - integrity sha512-vwDZjsnHlRKg8vdR+bfPdHwDixf0ozY6FU9CyVjrGLQpsEEISoNwsSCriUXE4Wv57LhmZEl8Ce3dhiPoqsv9tg== +"@graphprotocol/graph-ts@^0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.19.0.tgz#e1ea3abcf94b91b36624a0821c6561d68720397f" + integrity sha512-9dRwZF/jMHjIC/4jZDl8uUV3vHbXgHZV2m6728JbYcbjt4Kaw73cIxVqrsXHyDNVkVaIkZ/yorQ37pY2suLddg== dependencies: assemblyscript "https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3" @@ -195,12 +195,12 @@ anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" -apisauce@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/apisauce/-/apisauce-1.1.1.tgz#8e1da3005d6b86c5e4b8309901e2aa1a3a124b1d" - integrity sha512-xAXMRFyv+6yjhgDIEMozAhioE2qLdxMJxIDbjwT2obttZso27WUOpVGKYK0SD2T+IjlcpNQAklYj0IG0U7YKXQ== +apisauce@^2.0.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/apisauce/-/apisauce-2.1.2.tgz#4cd988d5612a34f051523ef7b2b75338afd37a55" + integrity sha512-2/9tz9uR/56UfZpzeMkGyX33tNjYpBNjhwvT/yyYIItulboxzTqZTD3F3Q7WJVXl8fvX6PZDMaxoFH4r/sXkEA== dependencies: - axios "^0.19.0" + axios "^0.21.4" ramda "^0.25.0" app-module-path@^2.2.0: @@ -250,9 +250,9 @@ asn1@~0.2.3: dependencies: safer-buffer "~2.1.0" -"assemblyscript@https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3": +"assemblyscript@git+https://github.com/AssemblyScript/assemblyscript.git#36040d5b5312f19a025782b5e36663823494c2f3": version "0.6.0" - resolved "https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3" + resolved "git+https://github.com/AssemblyScript/assemblyscript.git#36040d5b5312f19a025782b5e36663823494c2f3" dependencies: "@protobufjs/utf8" "^1.1.0" binaryen "77.0.0-nightly.20190407" @@ -278,6 +278,11 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= +at-least-node@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" + integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== + aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -288,12 +293,12 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.10.0.tgz#a17b3a8ea811060e74d47d306122400ad4497ae2" integrity sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA== -axios@^0.19.0: - version "0.19.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27" - integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA== +axios@^0.21.4: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== dependencies: - follow-redirects "1.5.10" + follow-redirects "^1.14.0" babel-code-frame@^6.26.0: version "6.26.0" @@ -874,13 +879,6 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -debug@=3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -1161,12 +1159,10 @@ flatmap@0.0.3: resolved "https://registry.yarnpkg.com/flatmap/-/flatmap-0.0.3.tgz#1f18a4d938152d495965f9c958d923ab2dd669b4" integrity sha1-Hxik2TgVLUlZZfnJWNkjqy3WabQ= -follow-redirects@1.5.10: - version "1.5.10" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" - integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ== - dependencies: - debug "=3.1.0" +follow-redirects@^1.14.0: + version "1.14.4" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.4.tgz#838fdf48a8bbdd79e52ee51fb1c94e3ed98b9379" + integrity sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g== forever-agent@~0.6.1: version "0.6.1" @@ -1187,14 +1183,15 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== +fs-extra@^9.0.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== dependencies: + at-least-node "^1.0.0" graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" + jsonfile "^6.0.1" + universalify "^2.0.0" fs-jetpack@^2.2.2: version "2.4.0" @@ -1271,12 +1268,12 @@ globals@^9.18.0: resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== -gluegun@^4.1.2: - version "4.3.1" - resolved "https://registry.yarnpkg.com/gluegun/-/gluegun-4.3.1.tgz#b93a8619e2e9546ab3451ad94f7be9097c75083a" - integrity sha512-TyOf60807SUYvd0v7fiRbhWrBSl9974clwZwCVc3qxYB83TQQQUSggwcz3yUeOl1MBALpwrz0Q0GUmi25quVOg== +gluegun@^4.3.1: + version "4.7.0" + resolved "https://registry.yarnpkg.com/gluegun/-/gluegun-4.7.0.tgz#d1e88828ec6737d966619fff07c04f7e689dc59e" + integrity sha512-St+J/rly0FoWLeISgBGDuymwF3/b8OdmxBCbSvK1hXEoRbaaATiRpPepJSJWuRYR7cGR7Hy9drgQwGFBAolhbQ== dependencies: - apisauce "^1.0.1" + apisauce "^2.0.1" app-module-path "^2.2.0" cli-table3 "~0.5.0" colors "^1.3.3" @@ -1825,10 +1822,12 @@ json5@^0.5.1: resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" optionalDependencies: graceful-fs "^4.1.6" @@ -3149,10 +3148,10 @@ unique-by@^1.0.0: resolved "https://registry.yarnpkg.com/unique-by/-/unique-by-1.0.0.tgz#5220c86ba7bc572fb713ad74651470cb644212bd" integrity sha1-UiDIa6e8Vy+3E610ZRRwy2RCEr0= -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== uri-js@^4.2.2: version "4.2.2" diff --git a/packages/connect-voting/package.json b/packages/connect-voting/package.json index cc18fee1..2915a3ad 100644 --- a/packages/connect-voting/package.json +++ b/packages/connect-voting/package.json @@ -1,6 +1,6 @@ { "name": "@aragon/connect-voting", - "version": "0.8.0-alpha.6", + "version": "0.8.0-alpha.10", "license": "LGPL-3.0-or-later", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/packages/connect-voting/src/__test__/votes.test.ts b/packages/connect-voting/src/__test__/votes.test.ts index b1f63484..2907ad63 100644 --- a/packages/connect-voting/src/__test__/votes.test.ts +++ b/packages/connect-voting/src/__test__/votes.test.ts @@ -59,6 +59,10 @@ describe('when connecting to a voting app', () => { ) }) + test('should have a valid original creator', () => { + expect(vote.originalCreator).toBe('0x8cff6832174091dae86f0244e3fd92d4ced2fe07') + }) + test('should have valid metadata', () => { expect(vote.metadata).toEqual(``) }) diff --git a/packages/connect-voting/src/models/Vote.ts b/packages/connect-voting/src/models/Vote.ts index 4ff66d15..8b20b96c 100644 --- a/packages/connect-voting/src/models/Vote.ts +++ b/packages/connect-voting/src/models/Vote.ts @@ -8,6 +8,7 @@ export default class Vote { readonly id: string readonly creator: string + readonly originalCreator: string readonly metadata: string readonly executed: boolean readonly executedAt: string @@ -25,6 +26,7 @@ export default class Vote { this.id = data.id this.creator = data.creator + this.originalCreator = data.originalCreator this.metadata = data.metadata this.executed = data.executed this.executedAt = data.executedAt diff --git a/packages/connect-voting/src/thegraph/queries/index.ts b/packages/connect-voting/src/thegraph/queries/index.ts index 1f989eb5..a38aea9b 100644 --- a/packages/connect-voting/src/thegraph/queries/index.ts +++ b/packages/connect-voting/src/thegraph/queries/index.ts @@ -9,6 +9,7 @@ export const ALL_VOTES = (type: string) => gql` appAddress orgAddress creator + originalCreator metadata executed executedAt @@ -33,6 +34,7 @@ export const CASTS_FOR_VOTE = (type: string) => gql` appAddress orgAddress creator + originalCreator metadata executed executedAt diff --git a/packages/connect-voting/src/types.ts b/packages/connect-voting/src/types.ts index fe0806ab..e818c9a6 100644 --- a/packages/connect-voting/src/types.ts +++ b/packages/connect-voting/src/types.ts @@ -8,6 +8,7 @@ import Cast from './models/Cast' export interface VoteData { id: string creator: string + originalCreator: string metadata: string executed: boolean executedAt: string diff --git a/packages/connect-voting/subgraph/schema.graphql b/packages/connect-voting/subgraph/schema.graphql index b02d7ee6..a58832f1 100644 --- a/packages/connect-voting/subgraph/schema.graphql +++ b/packages/connect-voting/subgraph/schema.graphql @@ -3,6 +3,7 @@ type Vote @entity { orgAddress: Bytes! appAddress: Bytes! creator: Bytes! + originalCreator: Bytes! metadata: String! executed: Boolean! executedAt: BigInt! diff --git a/packages/connect-voting/subgraph/src/Voting.ts b/packages/connect-voting/subgraph/src/Voting.ts index 371bbbc7..72b4b7ac 100644 --- a/packages/connect-voting/subgraph/src/Voting.ts +++ b/packages/connect-voting/subgraph/src/Voting.ts @@ -21,6 +21,7 @@ export function handleStartVote(event: StartVoteEvent): void { vote.appAddress = event.address vote.creator = event.params.creator + vote.originalCreator = event.transaction.from vote.metadata = event.params.metadata vote.voteNum = event.params.voteId vote.startDate = voteData.value2