From 7b61d7500f4029c7e50422985c898682be0e434e Mon Sep 17 00:00:00 2001 From: Adam Goth Date: Wed, 13 Oct 2021 11:48:05 +0200 Subject: [PATCH 1/3] dai-v0.32.15 --- packages/dai/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/dai/package.json b/packages/dai/package.json index d02d72ae6..580e4cb35 100644 --- a/packages/dai/package.json +++ b/packages/dai/package.json @@ -1,6 +1,6 @@ { "name": "@makerdao/dai", - "version": "0.32.14", + "version": "0.32.15", "contributors": [ "Wouter Kampmann ", "Sean Brennan ", @@ -50,7 +50,6 @@ "test:watch": "yarn test --watch", "test:mainnet": "export NETWORK='mainnet' && jest --runInBand --config ./test/config/jestIntegrationConfig.json", "test:kovan": "export NETWORK='kovan' && jest --runInBand --config ./test/config/jestIntegrationConfig.json", - "test:goerli": "export NETWORK='goerli' && jest --runInBand --config ./test/config/jestIntegrationConfig.json", "test:integration": "export NETWORK='test' && yarn test --config ./test/config/jestIntegrationConfig.json", "test:build": "yarn test --config ./test/config/jestBuildConfig.json", "repl": "../../node_modules/.bin/babel-node --experimental-repl-await scripts/repl.js" From f28b556d9021f9387f2b3fb5f1dc67f32383a854 Mon Sep 17 00:00:00 2001 From: Phil Bain Date: Thu, 14 Oct 2021 13:03:26 -0600 Subject: [PATCH 2/3] add getExpiration to SpellService --- packages/dai-plugin-governance/src/SpellService.js | 13 +++++++++++++ .../dai-plugin-governance/test/SpellService.test.js | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/packages/dai-plugin-governance/src/SpellService.js b/packages/dai-plugin-governance/src/SpellService.js index e961da45d..91dfa023c 100644 --- a/packages/dai-plugin-governance/src/SpellService.js +++ b/packages/dai-plugin-governance/src/SpellService.js @@ -16,6 +16,7 @@ export default class SpellService extends PublicService { this.executionDate = {}; this.scheduledDate = {}; this.nextCastTime = {}; + this.expiration = {}; this.executiveHash = {}; this.officeHours = {}; } @@ -50,6 +51,18 @@ export default class SpellService extends PublicService { return this.nextCastTime[spellAddress]; } + async getExpiration(spellAddress) { + if (this.expiration[spellAddress]) return this.expiration[spellAddress]; + const spell = this.get('smartContract').getContractByAddressAndAbi( + spellAddress, + DsSpellAbi + ); + const expiration = await spell.expiration(); + if (!expiration.toNumber()) return undefined; + this.expiration[spellAddress] = new Date(expiration.toNumber() * 1000); + return this.expiration[spellAddress]; + } + async getScheduledDate(spellAddress) { if (this.scheduledDate[spellAddress]) return this.scheduledDate[spellAddress]; diff --git a/packages/dai-plugin-governance/test/SpellService.test.js b/packages/dai-plugin-governance/test/SpellService.test.js index 656921a3a..dc6837ae0 100644 --- a/packages/dai-plugin-governance/test/SpellService.test.js +++ b/packages/dai-plugin-governance/test/SpellService.test.js @@ -52,6 +52,15 @@ describe('use mainnet', () => { expect(eta).toEqual(new Date('2020-01-26T11:53:19.000Z')); }); + test('get spell expiration', async () => { + const eta = await spellService.getExpiration( + '0x9400d4D59134af2a48a4bf4237E809A80f90Fe63' + ); + expect(eta).toEqual(new Date('2021-11-07T20:22:48.000Z')); + }); + + //TODO: add test for getNextCastTime(); + test('get executive hash text', async () => { const done = await spellService.getExecutiveHash( '0x9400d4D59134af2a48a4bf4237E809A80f90Fe63' From 8220a44d8aebd1206b8d43f20139825d7e3fe86a Mon Sep 17 00:00:00 2001 From: Phil Bain Date: Thu, 14 Oct 2021 13:04:08 -0600 Subject: [PATCH 3/3] dai-plugin-governance-v0.14.6 --- packages/dai-plugin-governance/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dai-plugin-governance/package.json b/packages/dai-plugin-governance/package.json index fbc3d1607..d4cc66e90 100644 --- a/packages/dai-plugin-governance/package.json +++ b/packages/dai-plugin-governance/package.json @@ -1,7 +1,7 @@ { "name": "@makerdao/dai-plugin-governance", "description": "A dai.js plugin for adding MKR governance support to dapps.", - "version": "0.14.5", + "version": "0.14.6", "license": "MIT", "repository": { "type": "git",