From ff3ae33d9959c80205ec6707a95cf4531eaa8178 Mon Sep 17 00:00:00 2001 From: Jannis Redmann Date: Thu, 19 Jan 2017 08:45:32 +0100 Subject: [PATCH] verification: add mainnet BadgeReg ids (#4190) * verification: mainnet BadgeReg ids * verification: fetch contracts by name * verification: better wording * typo * reregistered badges --- js/src/contracts/badgereg.js | 20 +++++++++++++++++++ .../Verification/GatherData/gatherData.js | 15 +++++++++++++- js/src/modals/Verification/email-store.js | 3 ++- js/src/modals/Verification/sms-store.js | 3 ++- js/src/modals/Verification/store.js | 4 ++-- 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/js/src/contracts/badgereg.js b/js/src/contracts/badgereg.js index 0813caa47..b9b10c19f 100644 --- a/js/src/contracts/badgereg.js +++ b/js/src/contracts/badgereg.js @@ -73,6 +73,26 @@ export default class BadgeReg { }); } + fetchCertifierByName (name) { + return this + .getContract() + .then((badgeReg) => { + return badgeReg.instance.fromName.call({}, [ name ]); + }) + .then(([ id, address, owner ]) => { + if (address === ZERO20) { + throw new Error(`Certifier ${name} does not exist.`); + } + + return this.fetchMeta(id) + .then(({ title, icon }) => { + const data = { address, id, name, title, icon }; + this.certifiers[id] = data; + return data; + }); + }); + } + fetchMeta (id) { return this .getContract() diff --git a/js/src/modals/Verification/GatherData/gatherData.js b/js/src/modals/Verification/GatherData/gatherData.js index 888585fcc..2afab1344 100644 --- a/js/src/modals/Verification/GatherData/gatherData.js +++ b/js/src/modals/Verification/GatherData/gatherData.js @@ -115,13 +115,26 @@ export default class GatherData extends Component { if (!fee) { return (

Fetching the feeā€¦

); } + if (fee.eq(0)) { + return ( +
+ +

+ +

+
+ ); + } return (

{ this.contract = new Contract(api, abi).at(address); this.load();