Skip to content

Commit

Permalink
hotfix/replace pretty addresses with plain ones (#307)
Browse files Browse the repository at this point in the history
* task: replace pretty addresses with plain ones

* task: update changelog

* task: fix changelog
  • Loading branch information
OlegMakarenko authored Feb 1, 2022
1 parent 41040c6 commit 618ecdf
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/components/controls/InputAddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class InputAccount extends Component<Props, State> {
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);
Expand Down
2 changes: 1 addition & 1 deletion src/screens/PostLaunchOptIn/OptInAccountDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class OptInAccountDetails extends Component<Props, State> {
<Text type={'bold'} theme={'light'}>
{translate('optin.destination')}
</Text>
<CopyView>{publicAccount.address.pretty()}</CopyView>
<CopyView>{publicAccount.address.plain()}</CopyView>
</Section>
)}
<Section type="form-item">
Expand Down
2 changes: 1 addition & 1 deletion src/screens/PostLaunchOptIn/OptInReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class OptInReview extends Component<Props, State> {
data = {
optinAddress: selectedNIS1Account.address,
optinNIS1Multisig: selectedNIS1MultisigAccount,
optinMultisigDestination: publicAccount.address.pretty(),
optinMultisigDestination: publicAccount.address.plain(),
// optinCosigner: AccountService.getAddressByAccountModelAndNetwork(selectedSymbolAccount, network),
};
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/PostLaunchOptIn/OptInSelectSymbolAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class OptInSelectSymbolAccount extends Component<Props, State> {
{translate('optin.destinationMultisigAccount')}
</Text>
<Text style={styles.titleText} theme="light" type={'regular'} align={'left'}>
{publicAccount.address.pretty()}
{publicAccount.address.plain()}
</Text>
<Text style={styles.titleText} theme="light" type={'bold'} align={'left'}>
{translate('optin.selectCosignerSymbolDescription')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class OptInSelectSymbolMultisigDestination extends Component<Props, State> {
if (publicAccount && pubkey.length === 64) {
this.setState({
multisigAccount: {
address: publicAccount.address.pretty(),
address: publicAccount.address.plain(),
publicKey: publicAccount.publicKey,
},
});
Expand Down
4 changes: 2 additions & 2 deletions src/services/AccountService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/services/FetchTransactionService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/services/ListenerService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/services/QRService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/store/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
});
});
Expand Down

0 comments on commit 618ecdf

Please sign in to comment.