Merge pull request #3864 from ethcore/jr-fix-verification

fix verification stores
This commit is contained in:
Gav Wood 2016-12-15 21:13:05 +01:00 committed by GitHub
commit 5fb34573c6
3 changed files with 8 additions and 4 deletions

View File

@ -23,6 +23,8 @@ import VerificationStore, {
} from './store'; } from './store';
import { postToServer } from '../../3rdparty/email-verification'; import { postToServer } from '../../3rdparty/email-verification';
const EMAIL_VERIFICATION = 4; // id in the `BadgeReg.sol` contract
export default class EmailVerificationStore extends VerificationStore { export default class EmailVerificationStore extends VerificationStore {
@observable email = ''; @observable email = '';
@ -54,7 +56,7 @@ export default class EmailVerificationStore extends VerificationStore {
} }
constructor (api, account, isTestnet) { constructor (api, account, isTestnet) {
super(api, EmailVerificationABI, 'emailverification3', account, isTestnet); super(api, EmailVerificationABI, EMAIL_VERIFICATION, account, isTestnet);
} }
requestValues = () => [ sha3(this.email) ] requestValues = () => [ sha3(this.email) ]

View File

@ -23,6 +23,8 @@ import VerificationStore, {
} from './store'; } from './store';
import { postToServer } from '../../3rdparty/sms-verification'; import { postToServer } from '../../3rdparty/sms-verification';
const SMS_VERIFICATION = 0; // id in the `BadgeReg.sol` contract
export default class SMSVerificationStore extends VerificationStore { export default class SMSVerificationStore extends VerificationStore {
@observable number = ''; @observable number = '';
@ -53,7 +55,7 @@ export default class SMSVerificationStore extends VerificationStore {
} }
constructor (api, account, isTestnet) { constructor (api, account, isTestnet) {
super(api, SMSVerificationABI, 'smsverification', account, isTestnet); super(api, SMSVerificationABI, SMS_VERIFICATION, account, isTestnet);
} }
@action setNumber = (number) => { @action setNumber = (number) => {

View File

@ -46,13 +46,13 @@ export default class VerificationStore {
@observable isCodeValid = null; @observable isCodeValid = null;
@observable confirmationTx = null; @observable confirmationTx = null;
constructor (api, abi, name, account, isTestnet) { constructor (api, abi, certifierId, account, isTestnet) {
this.api = api; this.api = api;
this.account = account; this.account = account;
this.isTestnet = isTestnet; this.isTestnet = isTestnet;
this.step = LOADING; this.step = LOADING;
Contracts.get().badgeReg.fetchCertifier(name) Contracts.get().badgeReg.fetchCertifier(certifierId)
.then(({ address }) => { .then(({ address }) => {
this.contract = new Contract(api, abi).at(address); this.contract = new Contract(api, abi).at(address);
this.load(); this.load();