Permalink
Browse files

feat(address): remove 1W address prefix

Address with prefix 1W is still valid, but all addresses are displayed without a prefix
  • Loading branch information...
1 parent 3b6e8c5 commit 8ab2ddd81b8bc25d0eb86fd11b6e77b0b311bfa6 @beregovoy68 beregovoy68 committed Oct 31, 2016
View
@@ -67,7 +67,7 @@ module.exports = function (grunt) {
'src/js/vendor/jquery.modal.js',
- 'bower_components/wavesplatform-core-js/distr/wavesplatform-core-js-0.1.0.js'
+ 'bower_components/wavesplatform-core-js/distr/wavesplatform-core-js-0.2.0.js'
]
},
// Task configuration.
View
@@ -12,7 +12,6 @@ var __mockValidateAddress = function(address) {};
var app = angular.module('app', [
'restangular',
'waves.core',
- 'waves.core.services',
'ngclipboard',
'ngMessages',
@@ -88,7 +87,7 @@ function AngularApplicationRun(rest, coreConstants, notificationService, address
notificationService.error(message);
};
__mockValidateAddress = function (address) {
- return addressService.validateDisplayAddress(address);
+ return addressService.validateAddress(address);
};
}
@@ -19,7 +19,7 @@
function refreshAddress() {
var raw = cryptoService.buildRawAddressFromSeed(vm.seed);
- vm.displayAddress = loginContext.convertAddress(raw);
+ vm.displayAddress = raw;
}
function checkSeedAndRegister() {
@@ -54,14 +54,14 @@
accounts.caption = 'REGISTER ACCOUNT';
var raw = cryptoService.buildRawAddressFromSeed(seed);
- accounts.displayAddress = loginContext.convertAddress(raw);
+ accounts.displayAddress = raw;
// setting a seed to register a new account
loginContext.seed = seed;
}
function switchToLoginMode(account) {
accounts.caption = 'SIGN IN';
- accounts.displayAddress = loginContext.convertAddress(account.address);
+ accounts.displayAddress = account.address;
// setting an account which we would like to sign in
loginContext.currentAccount = account;
}
@@ -3,10 +3,6 @@
function LoginContextFactory(moduleEvents, applicationEvents, modes, addressService) {
return {
- convertAddress: function (rawAddress) {
- return addressService.fromRawAddress(rawAddress).getDisplayAddress();
- },
-
showAccountsListScreen: function($scope) {
$scope.$emit(moduleEvents.CHANGE_MODE, modes.LIST);
},
@@ -29,7 +25,7 @@
notifySignedIn: function ($scope, rawAddress, seed, keys) {
var applicationState = {
- address: addressService.fromRawAddress(rawAddress),
+ address: rawAddress,
seed: seed,
keyPair: keys
};
@@ -7,7 +7,7 @@
var menu = this;
menu.blockHeight = 0;
- menu.address = applicationContext.account.address.getDisplayAddress();
+ menu.address = applicationContext.account.address;
function initializeBackupFields() {
menu.seed = applicationContext.account.seed;
@@ -1,7 +1,7 @@
(function () {
'use strict';
- function TransactionFilter(applicationContext, formattingService, addressService) {
+ function TransactionFilter(applicationContext, formattingService) {
var TRANSACTION_TYPES = {
2: 'Payment'
};
@@ -11,20 +11,18 @@
}
function transformAddress(rawAddress) {
- var result = !angular.isUndefined(rawAddress) ?
- addressService.fromRawAddress(rawAddress).getDisplayAddress() :
- 'none';
+ var result = angular.isDefined(rawAddress) ? rawAddress : 'none';
- if (result === applicationContext.account.address.getDisplayAddress())
+ if (result === applicationContext.account.address)
result = 'You';
return result;
}
function formatTransaction(transaction) {
- // in future currency should be a part of transaction itself
+ // in the future currency should be a part of transaction itself
var currency = Currency.WAV;
- var currentAddress = applicationContext.account.address.getRawAddress();
+ var currentAddress = applicationContext.account.address;
var type = transaction.sender === currentAddress ? 'Outgoing' : 'Incoming';
var amount = Money.fromCoins(transaction.amount, currency);
var fee = Money.fromCoins(transaction.fee, currency);
@@ -47,7 +45,7 @@
};
}
- TransactionFilter.$inject = ['applicationContext', 'formattingService', 'addressService'];
+ TransactionFilter.$inject = ['applicationContext', 'formattingService'];
angular
.module('app.shared')
@@ -23,7 +23,7 @@
};
this.mergeTransactions = function (address, unconfirmed, confirmed) {
- var rawAddress = address.getRawAddress();
+ var rawAddress = address;
unconfirmed = _.filter(unconfirmed, function (transaction) {
return (transaction.sender === rawAddress || transaction.recipient === rawAddress);
});
@@ -1,5 +1,6 @@
describe('Transaction.Loading.Service', function() {
- var transactionService, sender;
+ var transactionService,
+ sender = '3Mv61qe6egMSjRDZiiuvJDnf3Q1qW9tTZDB';
// Initialization of the module before each test case
beforeEach(module('waves.core'));
@@ -8,8 +9,6 @@ describe('Transaction.Loading.Service', function() {
// Injection of dependencies
beforeEach(inject(function($injector) {
transactionService = $injector.get('transactionLoadingService');
- var addressService = $injector.get('addressService');
- sender = addressService.fromRawAddress('3Mv61qe6egMSjRDZiiuvJDnf3Q1qW9tTZDB');
}));
it('should merge transactions if confirmed and unconfirmed do not intersect', function () {
@@ -177,7 +177,7 @@
var payment = {
amount: new Money(wallet.transfer.amount, currentCurrency),
fee: new Money(wallet.transfer.fee.amount, currentCurrency),
- recipient: addressService.fromDisplayAddress(wallet.transfer.recipient),
+ recipient: addressService.cleanupOptionalPrefix(wallet.transfer.recipient),
time: utilityService.getTime()
};
@@ -195,7 +195,7 @@
wallet.confirm.amount.currency = payment.amount.currency.displayName;
wallet.confirm.fee.value = payment.fee.formatAmount(true);
wallet.confirm.fee.currency = payment.fee.currency.displayName;
- wallet.confirm.recipient = payment.recipient.getDisplayAddress();
+ wallet.confirm.recipient = payment.recipient;
// open confirmation dialog
// doing it async because this method is called while another dialog is open
@@ -219,7 +219,7 @@
apiService.broadcastPayment(transaction).then(function () {
var amount = Money.fromCoins(transaction.amount, wallet.current.balance.currency);
- var address = addressService.fromRawAddress(transaction.recipient).getDisplayAddress();
+ var address = transaction.recipient;
var displayMessage = 'Sent ' + amount.formatAmount(true) + amount.currency.symbol +
'<br>Recipient ' + address.substr(0,15) + '...<br>Date: ' +
formattingService.formatTimestamp(transaction.timestamp);
View
@@ -62,9 +62,9 @@ <h2 id="AccHeader">{{accounts.caption}}</h2>
<div class="wavesAccounts" ng-controller="accountListController as list" ng-show="accounts.mode === 'list'">
<p class="loginAccountDiv" ng-repeat="account in list.accounts">
<span class="loginAccount fade" tooltipster tooltip-theme="tooltipster-theme1" title="Log into this account." ng-click="list.signIn(account)"> <br/>
- <b>{{::account.name}}</b> <span class="divider-1"></span> <small>{{::account.address | address}}</small>
+ <b>{{::account.name}}</b> <span class="divider-1"></span> <small>{{::account.address}}</small>
</span>
- <span class="clipSpan" tooltipster tooltip-theme="tooltipster-theme1" ngclipboard title="Copy this address to the clipboard." data-clipboard-text="{{::account.address | address}}" ngclipboard-success="clipboardOk()"></span>
+ <span class="clipSpan" tooltipster tooltip-theme="tooltipster-theme1" ngclipboard title="Copy this address to the clipboard." data-clipboard-text="{{::account.address}}" ngclipboard-success="clipboardOk()"></span>
<span class="divider-1"></span>
<button class="removeAccount wButtonAlt fade" tooltipster tooltip-theme="tooltipster-theme1" title="Remove this account from the list." ng-click="list.showRemoveWarning(account)">
<span class="wButton-icon"><img src="img/wIcon_x.svg"></span>REMOVE
@@ -639,7 +639,7 @@ <h2 id="AccHeader">{{accounts.caption}}</h2>
<td>{{block.timestamp | formatting}}</td>
<td>{{block.transactions.length}}</td>
<td>
- <span class="clipSpan" tooltipster tooltip-theme="tooltipster-theme1" ngclipboard title="Copy this address to the clipboard." data-clipboard-text="{{block.generator | address}}" ngclipboard-success="clipboardOk()">{{block.generator | address}}</span>
+ <span class="clipSpan" tooltipster tooltip-theme="tooltipster-theme1" ngclipboard title="Copy this address to the clipboard." data-clipboard-text="{{block.generator}}" ngclipboard-success="clipboardOk()">{{block.generator}}</span>
</td>
</tr>
</tbody>
@@ -689,7 +689,7 @@ <h2 id="AccHeader">{{accounts.caption}}</h2>
<script src="js/vendor/jquery.modal.js"></script>
<!-- application modules -->
- <script src="../bower_components/wavesplatform-core-js/distr/wavesplatform-core-js-0.1.0.js"></script>
+ <script src="../bower_components/wavesplatform-core-js/distr/wavesplatform-core-js-0.2.0.js"></script>
<script src="js/app.js"></script>
<script src="js/ui.module.js"></script>

0 comments on commit 8ab2ddd

Please sign in to comment.