on master help sign in
fix: invite acceptance flow
commit7d4236bc8360915b98aba48a4a7ae31112c70059 authortomholford <tomholford@users.noreply.github.com> dateMon 28 Jun 2021, 13:12 (5 years ago) parentb78a856
3 files changed+5−6
src/lib/wallet.ts+1−2 src/store/wallet.js+2−2 src/views/Activate/ActivatePassport.js+2−2
src/lib/wallet.ts+1−2
@@ -11,8 +11,7 @@ import { bufferedPublicKeyToAddress } from './utils/crypto';
1111export function EthereumWallet(privateKey) {
1212 this.privateKey = privateKey;
1313 this.publicKey = secp256k1.publicKeyCreate(this.privateKey);
14− const pub = this.publicKey.toString('hex');
15− this.address = publicToAddress(pub).toString('hex');
14+ this.address = bufferedPublicKeyToAddress(this.publicKey);
1615}
1716
1817export const urbitWalletFromTicket = async (ticket, point, passphrase) => {
src/store/wallet.js+2−2
@@ -15,11 +15,11 @@ import {
1515 NONCUSTODIAL_WALLETS,
1616 WALLET_TYPES,
1717} from 'lib/constants';
18−import { publicToAddress } from 'ethereumjs-util';
1918import { getAuthToken } from 'lib/authToken';
2019import { BRIDGE_ERROR } from 'lib/error';
2120
2221import { useNetwork } from 'store/network';
22+import { bufferedPublicKeyToAddress } from 'lib/utils/crypto';
2323
2424export const WalletContext = createContext(null);
2525
@@ -94,7 +94,7 @@ function _useWallet(initialWallet = Nothing(), initialMnemonic = Nothing()) {
9494 // force that public addresses are derived for each wallet
9595 // NOTE wallet is Maybe<> and .map is Maybe#map
9696 wallet.map(wal => {
97− wal.address = wal.address || publicToAddress(wal.publicKey).toString('hex');
97+ wal.address = wal.address || bufferedPublicKeyToAddress(wal.publicKey);
9898 return wal;
9999 });
100100
src/views/Activate/ActivatePassport.js+2−2
@@ -16,7 +16,7 @@ import PassportVerify from './PassportVerify';
1616import PassportTransfer from './PassportTransfer';
1717import { walletFromMnemonic } from 'lib/wallet';
1818import { DEFAULT_HD_PATH } from 'lib/constants';
19−import { publicToAddress } from 'ethereumjs-util';
19+import { bufferedPublicKeyToAddress } from 'lib/utils/crypto';
2020
2121const NAMES = {
2222 DOWNLOAD: 'DOWNLOAD',
@@ -54,7 +54,7 @@ export default function ActivatePassport() {
5454 wallet.meta.passphrase
5555 )
5656 )
57− .map(wallet => publicToAddress(wallet.publicKey).toString('hex')),
57+ .map(wallet => bufferedPublicKeyToAddress(wallet.publicKey)),
5858 [derivedWallet]
5959 );
6060 //~hobbyn-mismur-fonrux-datber