From 0e963da27b3389d1d3b27d5daf47cefb4cb1a584 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 15 Dec 2016 18:09:52 +0100 Subject: [PATCH 1/2] fix verification stores :bug: --- js/src/modals/Verification/email-store.js | 2 +- js/src/modals/Verification/sms-store.js | 2 +- js/src/modals/Verification/store.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/src/modals/Verification/email-store.js b/js/src/modals/Verification/email-store.js index 3d7faa9e1..7855732c7 100644 --- a/js/src/modals/Verification/email-store.js +++ b/js/src/modals/Verification/email-store.js @@ -54,7 +54,7 @@ export default class EmailVerificationStore extends VerificationStore { } constructor (api, account, isTestnet) { - super(api, EmailVerificationABI, 'emailverification3', account, isTestnet); + super(api, EmailVerificationABI, 4, account, isTestnet); } requestValues = () => [ sha3(this.email) ] diff --git a/js/src/modals/Verification/sms-store.js b/js/src/modals/Verification/sms-store.js index 44c5aa39c..84a445452 100644 --- a/js/src/modals/Verification/sms-store.js +++ b/js/src/modals/Verification/sms-store.js @@ -53,7 +53,7 @@ export default class SMSVerificationStore extends VerificationStore { } constructor (api, account, isTestnet) { - super(api, SMSVerificationABI, 'smsverification', account, isTestnet); + super(api, SMSVerificationABI, 0, account, isTestnet); } @action setNumber = (number) => { diff --git a/js/src/modals/Verification/store.js b/js/src/modals/Verification/store.js index dcbfbf698..692fc58a3 100644 --- a/js/src/modals/Verification/store.js +++ b/js/src/modals/Verification/store.js @@ -46,13 +46,13 @@ export default class VerificationStore { @observable isCodeValid = null; @observable confirmationTx = null; - constructor (api, abi, name, account, isTestnet) { + constructor (api, abi, certifierId, account, isTestnet) { this.api = api; this.account = account; this.isTestnet = isTestnet; this.step = LOADING; - Contracts.get().badgeReg.fetchCertifier(name) + Contracts.get().badgeReg.fetchCertifier(certifierId) .then(({ address }) => { this.contract = new Contract(api, abi).at(address); this.load(); From d2962fe47b52777a42f4d48967b3cfaa9e451b20 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 15 Dec 2016 20:45:49 +0100 Subject: [PATCH 2/2] store certifier index in constant --- js/src/modals/Verification/email-store.js | 4 +++- js/src/modals/Verification/sms-store.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/js/src/modals/Verification/email-store.js b/js/src/modals/Verification/email-store.js index 7855732c7..a86f9e4b1 100644 --- a/js/src/modals/Verification/email-store.js +++ b/js/src/modals/Verification/email-store.js @@ -23,6 +23,8 @@ import VerificationStore, { } from './store'; import { postToServer } from '../../3rdparty/email-verification'; +const EMAIL_VERIFICATION = 4; // id in the `BadgeReg.sol` contract + export default class EmailVerificationStore extends VerificationStore { @observable email = ''; @@ -54,7 +56,7 @@ export default class EmailVerificationStore extends VerificationStore { } constructor (api, account, isTestnet) { - super(api, EmailVerificationABI, 4, account, isTestnet); + super(api, EmailVerificationABI, EMAIL_VERIFICATION, account, isTestnet); } requestValues = () => [ sha3(this.email) ] diff --git a/js/src/modals/Verification/sms-store.js b/js/src/modals/Verification/sms-store.js index 84a445452..3c58b6ef9 100644 --- a/js/src/modals/Verification/sms-store.js +++ b/js/src/modals/Verification/sms-store.js @@ -23,6 +23,8 @@ import VerificationStore, { } from './store'; import { postToServer } from '../../3rdparty/sms-verification'; +const SMS_VERIFICATION = 0; // id in the `BadgeReg.sol` contract + export default class SMSVerificationStore extends VerificationStore { @observable number = ''; @@ -53,7 +55,7 @@ export default class SMSVerificationStore extends VerificationStore { } constructor (api, account, isTestnet) { - super(api, SMSVerificationABI, 0, account, isTestnet); + super(api, SMSVerificationABI, SMS_VERIFICATION, account, isTestnet); } @action setNumber = (number) => {