From 278d424829552f559b975ae4bc047cc859905465 Mon Sep 17 00:00:00 2001 From: Rafael Ventura Date: Wed, 13 Oct 2021 11:42:57 +0200 Subject: [PATCH 1/5] dai-plugin-governance-v0.14.5 --- 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 cfa8eeacb..fbc3d1607 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.3", + "version": "0.14.5", "license": "MIT", "repository": { "type": "git", From 8ebb5bae15ec2a0e7348358edc41e632eadaee1c Mon Sep 17 00:00:00 2001 From: Rafael Ventura Date: Wed, 13 Oct 2021 17:07:00 +0200 Subject: [PATCH 2/5] typechange babel.config.js --- .../dai-plugin-governance/babel.config.js | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) mode change 120000 => 100644 packages/dai-plugin-governance/babel.config.js diff --git a/packages/dai-plugin-governance/babel.config.js b/packages/dai-plugin-governance/babel.config.js deleted file mode 120000 index 426aaf31b..000000000 --- a/packages/dai-plugin-governance/babel.config.js +++ /dev/null @@ -1 +0,0 @@ -../../babel.config.js \ No newline at end of file diff --git a/packages/dai-plugin-governance/babel.config.js b/packages/dai-plugin-governance/babel.config.js new file mode 100644 index 000000000..5ba3b1f06 --- /dev/null +++ b/packages/dai-plugin-governance/babel.config.js @@ -0,0 +1,23 @@ +module.exports = function(api) { + api.cache(true); + + const presets = ['@babel/preset-env']; + const plugins = [ + ['@babel/plugin-proposal-decorators', { legacy: true }], + '@babel/plugin-proposal-function-sent', + '@babel/plugin-proposal-export-namespace-from', + '@babel/plugin-proposal-numeric-separator', + '@babel/plugin-proposal-throw-expressions', + '@babel/plugin-proposal-class-properties', + '@babel/plugin-transform-runtime' + ]; + + const babelrcRoots = ['.', './lib/*']; + + return { + presets, + plugins, + babelrcRoots + }; + }; + \ No newline at end of file From a41e09ca912567d2478e75f79bb77d0515471078 Mon Sep 17 00:00:00 2001 From: Rafael Ventura Date: Wed, 13 Oct 2021 17:20:07 +0200 Subject: [PATCH 3/5] dai-v0.35.16 --- packages/dai/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dai/package.json b/packages/dai/package.json index d02d72ae6..9a60f35ca 100644 --- a/packages/dai/package.json +++ b/packages/dai/package.json @@ -1,6 +1,6 @@ { "name": "@makerdao/dai", - "version": "0.32.14", + "version": "0.35.16", "contributors": [ "Wouter Kampmann ", "Sean Brennan ", From f28b556d9021f9387f2b3fb5f1dc67f32383a854 Mon Sep 17 00:00:00 2001 From: Phil Bain Date: Thu, 14 Oct 2021 13:03:26 -0600 Subject: [PATCH 4/5] 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 5/5] 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",