From 618ecdf51a6b66a0b3888d02dd3c030e8460ec3c Mon Sep 17 00:00:00 2001 From: OlegMakarenko <33131259+OlegMakarenko@users.noreply.github.com> Date: Tue, 1 Feb 2022 14:46:29 +0200 Subject: [PATCH] hotfix/replace pretty addresses with plain ones (#307) * task: replace pretty addresses with plain ones * task: update changelog * task: fix changelog --- CHANGELOG.md | 3 ++- src/components/controls/InputAddress.js | 2 +- src/screens/PostLaunchOptIn/OptInAccountDetails.js | 2 +- src/screens/PostLaunchOptIn/OptInReview.js | 2 +- src/screens/PostLaunchOptIn/OptInSelectSymbolAccount.js | 2 +- .../PostLaunchOptIn/OptInSelectSymbolMultisigDestination.js | 2 +- src/services/AccountService.js | 4 ++-- src/services/FetchTransactionService.js | 4 ++-- src/services/ListenerService.js | 2 +- src/services/QRService.js | 4 ++-- src/store/account.js | 6 +++--- 11 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84594b6..ecd6f50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +3,12 @@ All notable changes to this project will be documented in this file. The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [v1.4.1][v1.4.1] - 27-Jan-2022 +## [v1.4.1][v1.4.1] - 1-Feb-2022 ### Fixed - Corrupted Paper Wallet Backup. [#284](https://github.com/symbol/mobile-wallet/issues/284) - Backup saving error. [#145](https://github.com/symbol/mobile-wallet/issues/145) ### Changed +- Removed dashes from addresses. [#296](https://github.com/symbol/mobile-wallet/issues/296) - Upgraded the dependency `symbol-sdk` version to `v1.0.3`. ## [v1.4.0][v1.4.0] - 12-Nov-2021 diff --git a/src/components/controls/InputAddress.js b/src/components/controls/InputAddress.js index 435b4b3..74e0e75 100644 --- a/src/components/controls/InputAddress.js +++ b/src/components/controls/InputAddress.js @@ -58,7 +58,7 @@ class InputAccount extends Component { const contactQR = ContactQR.fromJSON(res.data); const { network } = this.props; const networkType = NetworkService.getNetworkTypeFromModel(network); - this.props.onChangeText(PublicAccount.createFromPublicKey(contactQR.accountPublicKey, networkType).address.pretty()); + this.props.onChangeText(PublicAccount.createFromPublicKey(contactQR.accountPublicKey, networkType).address.plain()); return; } catch (e) { console.log(e); diff --git a/src/screens/PostLaunchOptIn/OptInAccountDetails.js b/src/screens/PostLaunchOptIn/OptInAccountDetails.js index df40f36..05d4d43 100644 --- a/src/screens/PostLaunchOptIn/OptInAccountDetails.js +++ b/src/screens/PostLaunchOptIn/OptInAccountDetails.js @@ -136,7 +136,7 @@ class OptInAccountDetails extends Component { {translate('optin.destination')} - {publicAccount.address.pretty()} + {publicAccount.address.plain()} )}
diff --git a/src/screens/PostLaunchOptIn/OptInReview.js b/src/screens/PostLaunchOptIn/OptInReview.js index 00c6903..0a37157 100644 --- a/src/screens/PostLaunchOptIn/OptInReview.js +++ b/src/screens/PostLaunchOptIn/OptInReview.js @@ -91,7 +91,7 @@ class OptInReview extends Component { data = { optinAddress: selectedNIS1Account.address, optinNIS1Multisig: selectedNIS1MultisigAccount, - optinMultisigDestination: publicAccount.address.pretty(), + optinMultisigDestination: publicAccount.address.plain(), // optinCosigner: AccountService.getAddressByAccountModelAndNetwork(selectedSymbolAccount, network), }; } else { diff --git a/src/screens/PostLaunchOptIn/OptInSelectSymbolAccount.js b/src/screens/PostLaunchOptIn/OptInSelectSymbolAccount.js index 01cb20d..9f2b8ec 100644 --- a/src/screens/PostLaunchOptIn/OptInSelectSymbolAccount.js +++ b/src/screens/PostLaunchOptIn/OptInSelectSymbolAccount.js @@ -78,7 +78,7 @@ class OptInSelectSymbolAccount extends Component { {translate('optin.destinationMultisigAccount')} - {publicAccount.address.pretty()} + {publicAccount.address.plain()} {translate('optin.selectCosignerSymbolDescription')} diff --git a/src/screens/PostLaunchOptIn/OptInSelectSymbolMultisigDestination.js b/src/screens/PostLaunchOptIn/OptInSelectSymbolMultisigDestination.js index 6519053..187c91b 100644 --- a/src/screens/PostLaunchOptIn/OptInSelectSymbolMultisigDestination.js +++ b/src/screens/PostLaunchOptIn/OptInSelectSymbolMultisigDestination.js @@ -58,7 +58,7 @@ class OptInSelectSymbolMultisigDestination extends Component { if (publicAccount && pubkey.length === 64) { this.setState({ multisigAccount: { - address: publicAccount.address.pretty(), + address: publicAccount.address.plain(), publicKey: publicAccount.publicKey, }, }); diff --git a/src/services/AccountService.js b/src/services/AccountService.js index 4c87585..5deae9a 100644 --- a/src/services/AccountService.js +++ b/src/services/AccountService.js @@ -45,7 +45,7 @@ export default class AccountService { * Generates random mnemonic */ static getAddressByAccountModelAndNetwork(accountModel: AccountModel, network: AppNetworkType): string { - return Account.createFromPrivateKey(accountModel.privateKey, this._appNetworkToNetworkType(network)).address.pretty(); + return Account.createFromPrivateKey(accountModel.privateKey, this._appNetworkToNetworkType(network)).address.plain(); } /** * Generates random mnemonic @@ -215,7 +215,7 @@ export default class AccountService { try { const multisigInfo = await new MultisigHttp(network.node).getMultisigAccountInfo(Address.createFromRawAddress(address)).toPromise(); return { - cosignatoryOf: multisigInfo.multisigAddresses.map(address => address.pretty()), + cosignatoryOf: multisigInfo.multisigAddresses.map(address => address.plain()), isMultisig: multisigInfo.cosignatoryAddresses.length > 0, }; } catch (e) { diff --git a/src/services/FetchTransactionService.js b/src/services/FetchTransactionService.js index 78780b3..e5cdc1e 100644 --- a/src/services/FetchTransactionService.js +++ b/src/services/FetchTransactionService.js @@ -166,7 +166,7 @@ export default class FetchTransactionService { let transactionModel: TransactionModel = { type: 'unknown', status: transaction.isConfirmed() ? 'confirmed' : 'unconfirmed', - signerAddress: transaction.signer.address.pretty(), + signerAddress: transaction.signer.address.plain(), deadline: formatTransactionLocalDateTime(transaction.deadline.toLocalDateTime(network.epochAdjustment)), hash: transaction.transactionInfo.hash, fee: transaction.maxFee.toString(), @@ -216,7 +216,7 @@ export default class FetchTransactionService { return { ...transactionModel, type: 'transfer', - recipientAddress: transaction.recipientAddress instanceof Address ? transaction.recipientAddress.pretty() : transaction.recipientAddress.id.toHex(), + recipientAddress: transaction.recipientAddress instanceof Address ? transaction.recipientAddress.plain() : transaction.recipientAddress.id.toHex(), messageText: transaction.message.payload, messageEncrypted: transaction.message.type === 0x01, mosaics: mosaicModels, diff --git a/src/services/ListenerService.js b/src/services/ListenerService.js index c5fa7b4..1feec02 100644 --- a/src/services/ListenerService.js +++ b/src/services/ListenerService.js @@ -36,7 +36,7 @@ export default class ListenerService { } }) .then(() => { - console.log('Listening ' + address.pretty()); + console.log('Listening ' + address.plain()); this.addConfirmed(rawAddress); this.addUnconfirmed(rawAddress); diff --git a/src/services/QRService.js b/src/services/QRService.js index 7fcf760..e5641c9 100644 --- a/src/services/QRService.js +++ b/src/services/QRService.js @@ -87,7 +87,7 @@ export default class { const formattedMosaic = await this.formatMosaic(transaction.mosaics[0], network); const formatedTransaction = { - recipientAddress: transaction.recipientAddress.pretty(), + recipientAddress: transaction.recipientAddress.plain(), message: transaction.message.payload, mosaicName: formattedMosaic.mosaicName, mosaicId: formattedMosaic.mosaicId, @@ -116,7 +116,7 @@ export default class { const contactQr = QRCodeGenerator.fromJSON(JSON.stringify(data)); const parsed = { ...contactQr, - address: Address.createFromPublicKey(contactQr.accountPublicKey, contactQr.networkType).pretty() + address: Address.createFromPublicKey(contactQr.accountPublicKey, contactQr.networkType).plain() }; return parsed; diff --git a/src/store/account.js b/src/store/account.js index 376bccf..9de9efa 100644 --- a/src/store/account.js +++ b/src/store/account.js @@ -94,11 +94,11 @@ export default { const accountSigners = AccountService.getSigners(Address.createFromRawAddress(address), multisigAccountGraph); let allSigners = []; accountSigners.forEach(signer => { - allSigners.push(signer.address.pretty()); + allSigners.push(signer.address.plain()); signer.parentSigners.forEach(parent => { - allSigners.push(parent.address.pretty()); + allSigners.push(parent.address.plain()); parent.parentSigners.forEach(topLevel => { - allSigners.push(topLevel.address.pretty()); + allSigners.push(topLevel.address.plain()); }); }); });