Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • dev
  • gitlab_migration_1
  • issue_4
  • issue_780
  • master
  • patch-1
  • rml8
  • 0.0.1.ES.alpha1
  • 0.0.2
  • 0.1.13
  • 0.1.14
  • 0.1.15
  • 0.1.16
  • 0.1.17
  • 0.1.18
  • 0.1.19
  • 0.1.20
  • 0.1.21
  • 0.1.22
  • 0.1.23
  • 0.1.24
  • 0.1.25
  • 0.1.26
  • 0.1.27
  • 0.1.28
  • 0.1.4
  • 0.1.7
  • 0.1.8
  • 0.2.0
  • 0.2.1
  • v0.10.0
  • v0.10.1
  • v0.10.2
  • v0.11.0
  • v0.11.1
  • v0.11.2
  • v0.11.3
  • v0.11.4
  • v0.11.5
  • v0.11.6
  • v0.11.7
  • v0.11.8
  • v0.12.0
  • v0.12.1
  • v0.12.2
  • v0.12.3
  • v0.12.4
  • v0.12.5
  • v0.12.6
  • v0.12.7
  • v0.12.8
  • v0.12.9
  • v0.13.0
  • v0.14.0
  • v0.14.1
  • v0.15.0
  • v0.15.1
  • v0.15.2
  • v0.15.3
  • v0.15.4
  • v0.15.5
  • v0.15.6
  • v0.15.7
  • v0.16.0
  • v0.16.1
  • v0.17.0
  • v0.17.1
  • v0.17.2
  • v0.17.3
  • v0.17.4
  • v0.17.5
  • v0.17.6
  • v0.18.0
  • v0.18.1
  • v0.18.2
  • v0.18.3
  • v0.19.0
  • v0.19.1
  • v0.19.2
  • v0.19.3
  • v0.19.4
  • v0.19.5
  • v0.19.6
  • v0.2.10
  • v0.2.12
  • v0.2.13
  • v0.2.14
  • v0.2.3
  • v0.2.4
  • v0.2.5
  • v0.2.6
  • v0.2.7
  • v0.2.8
  • v0.2.9
  • v0.3.0
  • v0.3.1
  • v0.3.10
  • v0.3.11
  • v0.3.12
  • v0.3.13
  • v0.3.14
  • v0.3.15
  • v0.3.16
  • v0.3.17
  • v0.3.2
  • v0.3.3
  • v0.3.4
107 results

Target

Select target project
  • cordeliaze/cesium
  • pfouque06/cesium
  • wellno1/cesium
  • 1000i100/cesium
  • vincentux/cesium
  • calbasi/cesium
  • thomasbromehead/cesium
  • matograine/cesium
  • clients/cesium-grp/cesium
  • cedricmenec/cesium
  • Pamplemousse/cesium
  • etienneleba/cesium
  • tnntwister/cesium
  • scanlegentil/cesium
  • morvanc/cesium
  • yyy/cesium
  • Axce/cesium
  • Bertrandbenj/cesium
  • Lupus/cesium
  • elmau/cesium
  • MartinDelille/cesium
  • tykayn/cesium
  • numeropi/cesium
  • Vivakvo/cesium
  • pokapow/cesium
  • pini-gh/cesium
  • anam/cesium
  • RavanH/cesium
  • bpresles/cesium
  • am97/cesium
  • tuxmain/cesium
  • jytou/cesium
  • oliviermaurice/cesium
  • 666titi999/cesium
  • Yvv/cesium
35 results
Select Git revision
  • chrome-manifest-v3
  • develop
  • feat/force-migration-check
  • feat/improve-network-scan
  • feature/android_api_19
  • feature/encrypted_comment
  • feature/migrate-cordova-13
  • gitlab_migration_1
  • master
  • rml8
  • 0.0.1.ES.alpha1
  • 0.0.2
  • 0.1.13
  • 0.1.14
  • 0.1.15
  • 0.1.16
  • 0.1.17
  • 0.1.18
  • 0.1.19
  • 0.1.20
  • 0.1.21
  • 0.1.22
  • 0.1.23
  • 0.1.24
  • 0.1.25
  • 0.1.26
  • 0.1.27
  • 0.1.28
  • 0.1.4
  • 0.1.7
  • 0.1.8
  • 0.2.0
  • 0.2.1
  • v0.10.0
  • v0.10.1
  • v0.10.2
  • v0.11.0
  • v0.11.1
  • v0.11.2
  • v0.11.3
  • v0.11.4
  • v0.11.5
  • v0.11.6
  • v0.11.7
  • v0.11.8
  • v0.12.0
  • v0.12.1
  • v0.12.2
  • v0.12.3
  • v0.12.4
  • v0.12.5
  • v0.12.6
  • v0.12.7
  • v0.12.8
  • v0.12.9
  • v0.13.0
  • v0.14.0
  • v0.14.1
  • v0.15.0
  • v0.15.1
  • v0.15.2
  • v0.15.3
  • v0.15.4
  • v0.15.5
  • v0.15.6
  • v0.15.7
  • v0.16.0
  • v0.16.1
  • v0.17.0
  • v0.17.1
  • v0.17.2
  • v0.17.3
  • v0.17.4
  • v0.17.5
  • v0.17.6
  • v0.18.0
  • v0.18.1
  • v0.18.2
  • v0.18.3
  • v0.19.0
  • v0.19.1
  • v0.19.2
  • v0.19.3
  • v0.19.4
  • v0.19.5
  • v0.19.6
  • v0.2.10
  • v0.2.12
  • v0.2.13
  • v0.2.14
  • v0.2.3
  • v0.2.4
  • v0.2.5
  • v0.2.6
  • v0.2.7
  • v0.2.8
  • v0.2.9
  • v0.3.0
  • v0.3.1
  • v0.3.10
  • v0.3.11
  • v0.3.12
  • v0.3.13
  • v0.3.14
  • v0.3.15
  • v0.3.16
  • v0.3.17
  • v0.3.2
  • v0.3.3
  • v0.3.4
110 results
Show changes
Commits on Source (7)
...@@ -25,3 +25,4 @@ ...@@ -25,3 +25,4 @@
/hooks/playstore-config.json /hooks/playstore-config.json
.directory .directory
www/js/config.js
\ No newline at end of file
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
}, },
"plugins":{ "plugins":{
"es": { "es": {
"enable": true, "enable": false,
"askEnable": false, "askEnable": false,
"host": "localhost", "host": "localhost",
"port": 9200, "port": 9200,
......
...@@ -351,6 +351,7 @@ ...@@ -351,6 +351,7 @@
"WOT_PENDING_INVALID_BLOCK_HASH": "Membership not valid.", "WOT_PENDING_INVALID_BLOCK_HASH": "Membership not valid.",
"WALLET_INVALID_BLOCK_HASH": "Your membership application is no longer valid (because it references a block that network nodes are cancelled).<br/>You must <a ng-click=\"doQuickFix('renew')\">renew your application for membership</a> to fix this issue.", "WALLET_INVALID_BLOCK_HASH": "Your membership application is no longer valid (because it references a block that network nodes are cancelled).<br/>You must <a ng-click=\"doQuickFix('renew')\">renew your application for membership</a> to fix this issue.",
"WALLET_IDENTITY_EXPIRED": "The publication of your identity <b>has expired</b>.<br/>You must <a ng-click=\"doQuickFix('fixIdentity')\">re-issue your identity</a> to resolve this issue.", "WALLET_IDENTITY_EXPIRED": "The publication of your identity <b>has expired</b>.<br/>You must <a ng-click=\"doQuickFix('fixIdentity')\">re-issue your identity</a> to resolve this issue.",
"WALLET_HAS_NO_SELF": "Your identity must first have been published, and not expired.",
"IDENTITY_ALREADY_CERTIFY": "You have <b>already certified</b> that identity.<br/><br/>Your certificate is still valid (expires {{expiresIn|formatDuration}}).", "IDENTITY_ALREADY_CERTIFY": "You have <b>already certified</b> that identity.<br/><br/>Your certificate is still valid (expires {{expiresIn|formatDuration}}).",
"IDENTITY_ALREADY_CERTIFY_PENDING": "You have <b>already certified</b> that identity.<br/><br/>Your certification is still pending (Deadline for treatment {{expiresIn|formatDuration}}).", "IDENTITY_ALREADY_CERTIFY_PENDING": "You have <b>already certified</b> that identity.<br/><br/>Your certification is still pending (Deadline for treatment {{expiresIn|formatDuration}}).",
"UNABLE_TO_CERTIFY_TITLE": "Unable to certify", "UNABLE_TO_CERTIFY_TITLE": "Unable to certify",
...@@ -402,7 +403,7 @@ ...@@ -402,7 +403,7 @@
"UNIVERSAL_DIVIDEND_DEF": "(TODO translate)<br/>Le Dividende Universel (DU) est la quantité de monnaie co-créé par chaque membre, suivant la période et le calcul définie dans les <span class=\"text-italic\">règles de la monnaie</span>.<br/>A chaque échéance, les membres recoivent sur leur compte la meme quantité de nouvelle monnaie.<br/><br/>Le DU subit une croissance régulière, pour rester juste entre les membres (actuels et à venir), calculée en fonction de l'espérance de vie moyenne, telle que démontré dans la Thérorie Relative de la Monnaie (TRM).<br/><a href=\"http://trm.creationmonetaire.info\">En savoir plus sur la TRM</a> et les monnaies libres." "UNIVERSAL_DIVIDEND_DEF": "(TODO translate)<br/>Le Dividende Universel (DU) est la quantité de monnaie co-créé par chaque membre, suivant la période et le calcul définie dans les <span class=\"text-italic\">règles de la monnaie</span>.<br/>A chaque échéance, les membres recoivent sur leur compte la meme quantité de nouvelle monnaie.<br/><br/>Le DU subit une croissance régulière, pour rester juste entre les membres (actuels et à venir), calculée en fonction de l'espérance de vie moyenne, telle que démontré dans la Thérorie Relative de la Monnaie (TRM).<br/><a href=\"http://trm.creationmonetaire.info\">En savoir plus sur la TRM</a> et les monnaies libres."
}, },
"TIP": { "TIP": {
"MENU_BTN_CURRENCY": "(TODO translate)<br/>Le menu <b>{{'MENU.CURRENCY'|translate}}</b> permet la consultation des <b>règles de la monnaie</b> et de son état.", "MENU_BTN_CURRENCY": "Menu <b>{{'MENU.CURRENCY'|translate}}</b> allow to discover <b>currency rules</b> and state.",
"CURRENCY_WOT": "(TODO translate)<br/>Le <b>nombre de membres</b> montre l'importance de la communauté et permet de <b>suivre son évolution</b>.", "CURRENCY_WOT": "(TODO translate)<br/>Le <b>nombre de membres</b> montre l'importance de la communauté et permet de <b>suivre son évolution</b>.",
"CURRENCY_MASS": "(TODO translate)<br/>Suivez ici la <b>quantité totale de monnaie</b> existante et sa <b>répartition moyenne</b> par membre.<br/><br/>Ceci permet de juger de l'<b>importance d'un montant</b>, vis à vis de ce que <b>possède les autres</b> sur leur compte (en moyenne).", "CURRENCY_MASS": "(TODO translate)<br/>Suivez ici la <b>quantité totale de monnaie</b> existante et sa <b>répartition moyenne</b> par membre.<br/><br/>Ceci permet de juger de l'<b>importance d'un montant</b>, vis à vis de ce que <b>possède les autres</b> sur leur compte (en moyenne).",
"CURRENCY_UNIT_RELATIVE": "(TODO translate)<br/>L'unité utilisée (&ldquo;<b>{{'COMMON.UD'|translate}}<sub>{{currency|abbreviate}}</sub></b>&rdquo;) signifie que les montants en {{currency|capitalize}} ont été divisés par le <b>Dividende Universel</b> (DU).<br/><br/><small>Cette unité relative est <b>pertinente</b>, car stable malgré la quantitié de monnaie qui augmente en permanence.</small>", "CURRENCY_UNIT_RELATIVE": "(TODO translate)<br/>L'unité utilisée (&ldquo;<b>{{'COMMON.UD'|translate}}<sub>{{currency|abbreviate}}</sub></b>&rdquo;) signifie que les montants en {{currency|capitalize}} ont été divisés par le <b>Dividende Universel</b> (DU).<br/><br/><small>Cette unité relative est <b>pertinente</b>, car stable malgré la quantitié de monnaie qui augmente en permanence.</small>",
......
...@@ -351,6 +351,7 @@ ...@@ -351,6 +351,7 @@
"WOT_PENDING_INVALID_BLOCK_HASH": "Adhésion non valide.", "WOT_PENDING_INVALID_BLOCK_HASH": "Adhésion non valide.",
"WALLET_INVALID_BLOCK_HASH": "Votre demande d'adhésion n'est plus valide (car elle référence un bloc que les noeuds du réseau ont annulé).<br/>Vous devez <a ng-click=\"doQuickFix('fixMembership')\">envoyer une nouvelle demande</a> pour résoudre ce problème.", "WALLET_INVALID_BLOCK_HASH": "Votre demande d'adhésion n'est plus valide (car elle référence un bloc que les noeuds du réseau ont annulé).<br/>Vous devez <a ng-click=\"doQuickFix('fixMembership')\">envoyer une nouvelle demande</a> pour résoudre ce problème.",
"WALLET_IDENTITY_EXPIRED": "La publication de <b>votre identité a expirée</b>.<br/>Vous devez <a ng-click=\"doQuickFix('fixIdentity')\">publier à nouveau votre identité</a> pour résoudre ce problème.", "WALLET_IDENTITY_EXPIRED": "La publication de <b>votre identité a expirée</b>.<br/>Vous devez <a ng-click=\"doQuickFix('fixIdentity')\">publier à nouveau votre identité</a> pour résoudre ce problème.",
"WALLET_HAS_NO_SELF": "Votre identité doit d'abord avoir été publiée, et ne pas être expirée.",
"IDENTITY_ALREADY_CERTIFY": "Vous avez <b>déjà certifié</b> cette identité.<br/><br/>Cette certification est encore valide (expiration {{expiresIn|formatDurationTo}}).", "IDENTITY_ALREADY_CERTIFY": "Vous avez <b>déjà certifié</b> cette identité.<br/><br/>Cette certification est encore valide (expiration {{expiresIn|formatDurationTo}}).",
"IDENTITY_ALREADY_CERTIFY_PENDING": "Vous avez <b>déjà certifié</b> cette identité.<br/><br/>Cette certification est en attente de traitement (date limite de traitement {{expiresIn|formatDurationTo}}).", "IDENTITY_ALREADY_CERTIFY_PENDING": "Vous avez <b>déjà certifié</b> cette identité.<br/><br/>Cette certification est en attente de traitement (date limite de traitement {{expiresIn|formatDurationTo}}).",
"UNABLE_TO_CERTIFY_TITLE": "Certification impossible", "UNABLE_TO_CERTIFY_TITLE": "Certification impossible",
......
...@@ -5,7 +5,7 @@ angular.module('cesium.wot.controllers', ['cesium.services']) ...@@ -5,7 +5,7 @@ angular.module('cesium.wot.controllers', ['cesium.services'])
$stateProvider $stateProvider
.state('app.wot_lookup', { .state('app.wot_lookup', {
url: "/wot?q&newcomers", url: "/wot?q&newcomers&pendings",
views: { views: {
'menuContent': { 'menuContent': {
templateUrl: "templates/wot/lookup.html", templateUrl: "templates/wot/lookup.html",
...@@ -95,7 +95,7 @@ function WotLookupController($scope, BMA, $state, UIUtils, $timeout, csConfig, c ...@@ -95,7 +95,7 @@ function WotLookupController($scope, BMA, $state, UIUtils, $timeout, csConfig, c
}; };
$scope.entered = false; $scope.entered = false;
$scope.wotSearchTextId = 'wotSearchText'; $scope.wotSearchTextId = 'wotSearchText';
$scope.enableFilter = !csConfig.initPhase; // disable filter on init phase $scope.enableFilter = true;
$scope.$on('$ionicView.enter', function(e, state) { $scope.$on('$ionicView.enter', function(e, state) {
if (!$scope.entered) { if (!$scope.entered) {
...@@ -105,9 +105,15 @@ function WotLookupController($scope, BMA, $state, UIUtils, $timeout, csConfig, c ...@@ -105,9 +105,15 @@ function WotLookupController($scope, BMA, $state, UIUtils, $timeout, csConfig, c
$scope.doSearch(); $scope.doSearch();
}, 100); }, 100);
} }
else { // get new comers else {
$timeout(function() { $timeout(function() {
// get new comers
if (!csConfig.initPhase || state.stateParams.newcomers) {
$scope.doGetNewcomers(0, state.stateParams.newcomers); $scope.doGetNewcomers(0, state.stateParams.newcomers);
}
else {
$scope.doGetPending(0, state.stateParams.pendings);
}
}, 100); }, 100);
} }
// removeIf(device) // removeIf(device)
...@@ -165,10 +171,7 @@ function WotLookupController($scope, BMA, $state, UIUtils, $timeout, csConfig, c ...@@ -165,10 +171,7 @@ function WotLookupController($scope, BMA, $state, UIUtils, $timeout, csConfig, c
$scope.search.loading = (offset === 0); $scope.search.loading = (offset === 0);
$scope.search.type = 'newcomers'; $scope.search.type = 'newcomers';
var searchFunction = csConfig.initPhase ? return csWot.newcomers(offset, size)
csWot.all :
csWot.newcomers;
return searchFunction(offset, size)
.then(function(idties){ .then(function(idties){
if ($scope.search.type != 'newcomers') return false; // could have change if ($scope.search.type != 'newcomers') return false; // could have change
$scope.doDisplayResult(idties, offset, size); $scope.doDisplayResult(idties, offset, size);
...@@ -191,7 +194,11 @@ function WotLookupController($scope, BMA, $state, UIUtils, $timeout, csConfig, c ...@@ -191,7 +194,11 @@ function WotLookupController($scope, BMA, $state, UIUtils, $timeout, csConfig, c
$scope.search.loading = (offset === 0); $scope.search.loading = (offset === 0);
$scope.search.type = 'pending'; $scope.search.type = 'pending';
return csWot.pending(offset, size) var searchFunction = csConfig.initPhase ?
csWot.all :
csWot.pending;
return searchFunction(offset, size)
.then(function(idties){ .then(function(idties){
if ($scope.search.type != 'pending') return false; // could have change if ($scope.search.type != 'pending') return false; // could have change
$scope.doDisplayResult(idties, offset, size); $scope.doDisplayResult(idties, offset, size);
......
...@@ -34,8 +34,9 @@ angular.module('cesium.bma.services', ['ngResource', 'cesium.http.services', 'ce ...@@ -34,8 +34,9 @@ angular.module('cesium.bma.services', ['ngResource', 'cesium.http.services', 'ce
TX_ALREADY_PROCESSED: 2030 TX_ALREADY_PROCESSED: 2030
}, },
constants = { constants = {
PROTOCOL_VERSION: 10,
ROOT_BLOCK_HASH: 'E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855', ROOT_BLOCK_HASH: 'E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855',
LIMIT_REQUEST_COUNT: 5, // simultaneous async call of on rest request LIMIT_REQUEST_COUNT: 5, // simultaneous async request to a Duniter node
LIMIT_REQUEST_DELAY: 1000 // time (in second) to wait between to call of a rest request LIMIT_REQUEST_DELAY: 1000 // time (in second) to wait between to call of a rest request
}; };
......
...@@ -10,7 +10,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser ...@@ -10,7 +10,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser
var var
constants = { constants = {
STORAGE_KEY: "CESIUM_DATA" STORAGE_KEY: 'CESIUM_DATA'
}, },
data = {}, data = {},
...@@ -1085,7 +1085,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser ...@@ -1085,7 +1085,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser
}); });
} }
var tx = 'Version: 3\n' + var tx = 'Version: '+ BMA.constants.PROTOCOL_VERSION +'\n' +
'Type: Transaction\n' + 'Type: Transaction\n' +
'Currency: ' + data.currency + '\n' + 'Currency: ' + data.currency + '\n' +
'Blockstamp: ' + block.number + '-' + block.hash + '\n' + 'Blockstamp: ' + block.number + '-' + block.hash + '\n' +
...@@ -1228,18 +1228,39 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser ...@@ -1228,18 +1228,39 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser
}); });
}, },
getIdentityDocument = function(uid, blockUid) {
uid = uid || data.uid;
blockUid = blockUid || data.blockUid;
if (!uid || !blockUid) {
throw {message: 'ERROR.WALLET_HAS_NO_SELF'};
}
if (data.requirements && data.requirements.expired) {
throw {message: 'ERROR.WALLET_IDENTITY_EXPIRED'};
}
var identity = 'Version: '+ BMA.constants.PROTOCOL_VERSION +'\n' +
'Type: Identity\n' +
'Currency: ' + data.currency + '\n' +
'Issuer: ' + data.pubkey + '\n' +
'UniqueID: ' + uid + '\n' +
'Timestamp: ' + blockUid + '\n';
return CryptoUtils.sign(identity, data.keypair)
.then(function(signature) {
identity += signature + '\n';
console.debug('Has generate an identity document:\n----\n' + identity + '----');
return identity;
});
},
/** /**
* Send self identity * Send self identity
*/ */
self = function(uid, needToLoadRequirements) { self = function(uid, needToLoadRequirements) {
return $q(function(resolve, reject) {
if (!BMA.regex.USER_ID.test(uid)){ if (!BMA.regex.USER_ID.test(uid)){
reject({message:'ERROR.INVALID_USER_ID'}); return; throw new Error('ERROR.INVALID_USER_ID');
} }
var block; var block;
var identity; return $q.all([
$q.all([
// check uid used by another pubkey // check uid used by another pubkey
checkUidNotExists(uid, data.pubkey), checkUidNotExists(uid, data.pubkey),
...@@ -1261,53 +1282,37 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser ...@@ -1261,53 +1282,37 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser
} }
}) })
]) ])
// Create identity document to sign
.then(function() {
identity = 'Version: 2\n' +
'Type: Identity\n' +
'Currency: ' + data.currency + '\n' +
'Issuer: ' + data.pubkey + '\n' +
'UniqueID: ' + uid + '\n' +
'Timestamp: ' + block.number + '-' + block.hash + '\n';
return CryptoUtils.sign(identity, data.keypair); // Create identity document
.then(function() {
return getIdentityDocument(uid, block.number + '-' + block.hash);
}) })
// Add signature
.then(function (signature) {
var signedIdentity = identity + signature + '\n';
// Send to node // Send to node
return BMA.wot.add({identity: signedIdentity}) .then(function (identity) {
.then(function (result) { return BMA.wot.add({identity: identity});
})
.then(function () {
if (!!needToLoadRequirements) { if (!!needToLoadRequirements) {
// Refresh membership data (if need) // Refresh membership data (if need)
loadRequirements() return loadRequirements();
.then(function () {
resolve();
}).catch(function (err) {
reject(err);
});
} }
else { else {
data.uid = uid; data.uid = uid;
data.blockUid = block.number + '-' + block.hash; data.blockUid = block.number + '-' + block.hash;
resolve();
} }
}) })
.catch(function (err) { .catch(function (err) {
if (err && err.ucode === BMA.errorCodes.IDENTITY_SANDBOX_FULL) { if (err && err.ucode === BMA.errorCodes.IDENTITY_SANDBOX_FULL) {
reject({ucode: BMA.errorCodes.IDENTITY_SANDBOX_FULL, message: 'ERROR.IDENTITY_SANDBOX_FULL'}); throw {ucode: BMA.errorCodes.IDENTITY_SANDBOX_FULL, message: 'ERROR.IDENTITY_SANDBOX_FULL'};
return;
} }
reject(err); throw err;
});
}).catch(function (err) {
reject(err);
});
}); });
}, },
/** /**
* Send membership (in) * Send membership (in or out)
*/ */
membership = function(sideIn) { membership = function(sideIn) {
return function() { return function() {
...@@ -1322,7 +1327,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser ...@@ -1322,7 +1327,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser
}) })
.then(function(block) { .then(function(block) {
// Create membership to sign // Create membership to sign
membership = 'Version: 2\n' + membership = 'Version: '+ BMA.constants.PROTOCOL_VERSION +'\n' +
'Type: Membership\n' + 'Type: Membership\n' +
'Currency: ' + data.currency + '\n' + 'Currency: ' + data.currency + '\n' +
'Issuer: ' + data.pubkey + '\n' + 'Issuer: ' + data.pubkey + '\n' +
...@@ -1367,7 +1372,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser ...@@ -1367,7 +1372,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser
.then(function(block) { .then(function(block) {
current = block; current = block;
// Create the self part to sign // Create the self part to sign
cert = 'Version: 2\n' + cert = 'Version: '+ BMA.constants.PROTOCOL_VERSION +'\n' +
'Type: Certification\n' + 'Type: Certification\n' +
'Currency: ' + data.currency + '\n' + 'Currency: ' + data.currency + '\n' +
'Issuer: ' + data.pubkey + '\n' + 'Issuer: ' + data.pubkey + '\n' +
...@@ -1412,6 +1417,82 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser ...@@ -1412,6 +1417,82 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser
} }
}, },
getRevocationDocument = function() {
// Get current identity document
return getIdentityDocument()
// Create membership document (unsigned)
.then(function(identity){
var identityLines = identity.trim().split('\n');
var idtySignature = identityLines[identityLines.length-1];
var revocation = 'Version: '+ BMA.constants.PROTOCOL_VERSION +'\n' +
'Type: Revocation\n' +
'Currency: ' + data.currency + '\n' +
'Issuer: ' + data.pubkey + '\n' +
'IdtyUniqueID: ' + data.uid + '\n' +
'IdtyTimestamp: ' + data.blockUid + '\n' +
'IdtySignature: ' + idtySignature + '\n';
// Sign revocation document
return CryptoUtils.sign(revocation, data.keypair)
// Add revocation to document
.then(function(signature) {
revocation += signature + '\n';
console.debug('Has generate an revocation document:\n----\n' + revocation + '----');
return revocation;
});
});
}
/**
* Send a revocation
*/
revocation = function() {
if (!data.uid || !data.blockUid) {
throw {message: 'ERROR.WALLET_TO_REVOKE_HAS_NO_SELF'};
}
var revocation;
// Get identity signature
return getIdentityDocument(data.uid, data.blockUid)
// Create membership document (unsigned)
.then(function(identity){
var identityLines = identity.trim().split('\n');
var idtySignature = identityLines[identityLines.length-1];
revocation = 'Version: '+ BMA.constants.PROTOCOL_VERSION +'\n' +
'Type: Revocation\n' +
'Currency: ' + data.currency + '\n' +
'Issuer: ' + data.pubkey + '\n' +
'IdtyUniqueID: ' + data.uid + '\n' +
'IdtyTimestamp: ' + data.blockUid + '\n' +
'IdtySignature: ' + idtySignature + '\n';
// Sign revocation document
return CryptoUtils.sign(revocation, data.keypair);
})
// Send signed revocation
.then(function(signature) {
var signedRevocation = revocation + signature + '\n';
return BMA.blockchain.membership({membership: signedRevocation});
})
.then(function() {
return $timeout(function() {
return loadRequirements();
}, 1000); // waiting for node to process membership doc
})
.then(function() {
finishLoadRequirements();
});
},
cleanEventsByContext = function(context){ cleanEventsByContext = function(context){
data.events = data.events.reduce(function(res, event) { data.events = data.events.reduce(function(res, event) {
if (event.context && event.context == context) return res; if (event.context && event.context == context) return res;
......
...@@ -490,7 +490,7 @@ function ESMessageViewController($scope, $state, $timeout, $translate, $ionicHis ...@@ -490,7 +490,7 @@ function ESMessageViewController($scope, $state, $timeout, $translate, $ionicHis
}; };
} }
function PopoverMessageController($scope, $timeout, UIUtils, $state, esNotification, esMessage, esModals) { function PopoverMessageController($scope, $timeout, UIUtils, $state, csWallet, esNotification, esMessage, esModals) {
'ngInject'; 'ngInject';
var defaultSearchLimit = 40; var defaultSearchLimit = 40;
...@@ -571,9 +571,16 @@ function PopoverMessageController($scope, $timeout, UIUtils, $state, esNotificat ...@@ -571,9 +571,16 @@ function PopoverMessageController($scope, $timeout, UIUtils, $state, esNotificat
$scope.closePopover(notification); $scope.closePopover(notification);
}; };
if ($scope.search.loading) { $scope.resetData = function() {
$scope.load(); if ($scope.search.loading) return;
} console.debug("[ES] [messages] Resetting data (settings or account may have changed)");
$scope.search.hasMore = false;
$scope.search.results = [];
$scope.search.loading = true;
delete $scope.search.limit;
};
csWallet.api.data.on.logout($scope, $scope.resetData);
/* -- Modals -- */ /* -- Modals -- */
...@@ -586,4 +593,10 @@ function PopoverMessageController($scope, $timeout, UIUtils, $state, esNotificat ...@@ -586,4 +593,10 @@ function PopoverMessageController($scope, $timeout, UIUtils, $state, esNotificat
}; };
esNotification.api.data.on.new($scope, $scope.onNewNotification); esNotification.api.data.on.new($scope, $scope.onNewNotification);
/* -- default popover action -- */
if ($scope.search.loading) {
$scope.load();
}
} }
...@@ -135,17 +135,16 @@ function NotificationsController($scope, $rootScope, $timeout, UIUtils, $state, ...@@ -135,17 +135,16 @@ function NotificationsController($scope, $rootScope, $timeout, UIUtils, $state,
}; };
esNotification.api.data.on.new($scope, $scope.onNewNotification); esNotification.api.data.on.new($scope, $scope.onNewNotification);
// Listen settings changes $scope.resetData = function() {
$scope.onSettingsChanged = function() {
if ($scope.search.loading) return; if ($scope.search.loading) return;
console.debug("[ES] [notifications] Force to reload (on next enter) as settings changed..."); console.debug("[ES] [notifications] Resetting data (settings or account may have changed)");
$scope.search.hasMore = false; $scope.search.hasMore = false;
$scope.search.results = []; $scope.search.results = [];
$scope.search.loading = true; $scope.search.loading = true;
delete $scope.search.limit; delete $scope.search.limit;
}; };
csSettings.api.data.on.changed($scope, $scope.onSettingsChanged); // When logout: force reload
csWallet.api.data.on.logout($scope, $scope.resetData);
} }
function PopoverNotificationsController($scope, $rootScope, $timeout, UIUtils, $state, csWallet, esNotification, csSettings) { function PopoverNotificationsController($scope, $rootScope, $timeout, UIUtils, $state, csWallet, esNotification, csSettings) {
......
...@@ -47,11 +47,6 @@ ...@@ -47,11 +47,6 @@
<i ng-if="!formData.avatar" class="item-image" ng-class="{'ion-person': formData.uid, 'ion-email': !formData.uid}"></i> <i ng-if="!formData.avatar" class="item-image" ng-class="{'ion-person': formData.uid, 'ion-email': !formData.uid}"></i>
<i ng-if="formData.avatar" class="item-image avatar" style="background-image: url({{::formData.avatar.src}})"></i> <i ng-if="formData.avatar" class="item-image avatar" style="background-image: url({{::formData.avatar.src}})"></i>
<i
ng-style="formData.avatarStyle"></i>
<i ng-class="{'item-image ion-person': formData.uid && !formData.avatarStyle, 'item-image ion-email': !formData.uid && !formData.avatarStyle, 'avatar': formData.avatarStyle}"
ng-style="formData.avatarStyle"></i>
<h1 class="title" ng-bind-html="formData.title"></h1> <h1 class="title" ng-bind-html="formData.title"></h1>
<h4> <h4>
<i class="ion-clock"></i> <i class="ion-clock"></i>
......
...@@ -18,12 +18,6 @@ ...@@ -18,12 +18,6 @@
<span class="badge badge-stable">{{difficulty | formatInteger}}</span> <span class="badge badge-stable">{{difficulty | formatInteger}}</span>
</ion-item> </ion-item>
<ion-item class="item-icon-left">
<i class="icon ion-steam"></i>
<span translate>CURRENCY.VIEW.XPERCENT</span>
<span class="badge badge-stable">{{xpercent}}</span>
</ion-item>
<div id="helptip-currency-peers" <div id="helptip-currency-peers"
class="item item-divider item-icon-right"> class="item item-divider item-icon-right">
{{'PEER.PEERS'|translate}} {{'PEER.PEERS'|translate}}
......
...@@ -115,4 +115,10 @@ ...@@ -115,4 +115,10 @@
<span class="badge badge-stable">{{stepMax}}</span> <span class="badge badge-stable">{{stepMax}}</span>
</ion-item> </ion-item>
<ion-item class="item-icon-left">
<i class="icon ion-pull-request"></i>
<span translate>CURRENCY.VIEW.XPERCENT</span>
<span class="badge badge-stable">{{xpercent}}</span>
</ion-item>
</ion-list> </ion-list>