on master help sign in
fix: invite acceptance flow
7d4236btomholford
src/lib/wallet.ts+1−2
@@ -11,8 +11,7 @@ import { bufferedPublicKeyToAddress } from './utils/crypto';
11export function EthereumWallet(privateKey) {
11export function EthereumWallet(privateKey) {
12 this.privateKey = privateKey;
12 this.privateKey = privateKey;
13 this.publicKey = secp256k1.publicKeyCreate(this.privateKey);
13 this.publicKey = secp256k1.publicKeyCreate(this.privateKey);
14− const pub = this.publicKey.toString('hex');
14+ this.address = bufferedPublicKeyToAddress(this.publicKey);
15− this.address = publicToAddress(pub).toString('hex');
16}
15}
17
16
18export const urbitWalletFromTicket = async (ticket, point, passphrase) => {
17export const urbitWalletFromTicket = async (ticket, point, passphrase) => {
src/store/wallet.js+2−2
@@ -15,11 +15,11 @@ import {
15 NONCUSTODIAL_WALLETS,
15 NONCUSTODIAL_WALLETS,
16 WALLET_TYPES,
16 WALLET_TYPES,
17} from 'lib/constants';
17} from 'lib/constants';
18−import { publicToAddress } from 'ethereumjs-util';
19import { getAuthToken } from 'lib/authToken';
18import { getAuthToken } from 'lib/authToken';
20import { BRIDGE_ERROR } from 'lib/error';
19import { BRIDGE_ERROR } from 'lib/error';
21
20
22import { useNetwork } from 'store/network';
21import { useNetwork } from 'store/network';
22+import { bufferedPublicKeyToAddress } from 'lib/utils/crypto';
23
23
24export const WalletContext = createContext(null);
24export const WalletContext = createContext(null);
25
25
@@ -94,7 +94,7 @@ function _useWallet(initialWallet = Nothing(), initialMnemonic = Nothing()) {
94 // force that public addresses are derived for each wallet
94 // force that public addresses are derived for each wallet
95 // NOTE wallet is Maybe<> and .map is Maybe#map
95 // NOTE wallet is Maybe<> and .map is Maybe#map
96 wallet.map(wal => {
96 wallet.map(wal => {
97− wal.address = wal.address || publicToAddress(wal.publicKey).toString('hex');
97+ wal.address = wal.address || bufferedPublicKeyToAddress(wal.publicKey);
98 return wal;
98 return wal;
99 });
99 });
100
100
src/views/Activate/ActivatePassport.js+2−2
@@ -16,7 +16,7 @@ import PassportVerify from './PassportVerify';
16import PassportTransfer from './PassportTransfer';
16import PassportTransfer from './PassportTransfer';
17import { walletFromMnemonic } from 'lib/wallet';
17import { walletFromMnemonic } from 'lib/wallet';
18import { DEFAULT_HD_PATH } from 'lib/constants';
18import { DEFAULT_HD_PATH } from 'lib/constants';
19−import { publicToAddress } from 'ethereumjs-util';
19+import { bufferedPublicKeyToAddress } from 'lib/utils/crypto';
20
20
21const NAMES = {
21const NAMES = {
22 DOWNLOAD: 'DOWNLOAD',
22 DOWNLOAD: 'DOWNLOAD',
@@ -54,7 +54,7 @@ export default function ActivatePassport() {
54 wallet.meta.passphrase
54 wallet.meta.passphrase
55 )
55 )
56 )
56 )
57− .map(wallet => publicToAddress(wallet.publicKey).toString('hex')),
57+ .map(wallet => bufferedPublicKeyToAddress(wallet.publicKey)),
58 [derivedWallet]
58 [derivedWallet]
59 );
59 );
60 //~hobbyn-mismur-fonrux-datber
60 //~hobbyn-mismur-fonrux-datber