Skip to content
Snippets Groups Projects
Select Git revision
  • 0fcf68b9621d0cd90e77cda83d33755776b12f97
  • master default protected
  • fix_picked_up_file_in_runtime_release
  • network/gtest-1000 protected
  • upgradable-multisig
  • runtime/gtest-1000
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • gtest-1000-0.11.1 protected
  • gtest-1000-0.11.0 protected
  • gtest-1000 protected
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
41 results

pallet_conventions.md

Blame
    • Hugo Trentesaux's avatar
      6b598084
      refac membership (!215) · 6b598084
      Hugo Trentesaux authored
      * delete notes.txt file
      
      * update notes with links to issues
      
      * update comment according to #159
      
      * doc idtystatus in readme
      
      * update weightinfo and benchmarks accordingly
      
      * add benchmark
      
      * remove remove_identity_consumers
      
      * remove force_remove_identity call
      
      * fix todo in test
      
      * update doc
      
      - remove request_membership
      - remove validate_identity
      
      * fix tests according to new MembershipRemovalReason
      
      * add membership removal reasons
      
      and clean up membership internal functions
      
      * remove check_remove_identity
      
      * build live tests
      
      (but no current network to check them against)
      
      * clippy :man_facepalming:
      
      * add wot tests related to issue #136
      
      * refac certification creation checks
      
      * refac identity creation checks
      
      * test benchmark ok
      
      * more precise error messages
      
      * check benchmarks ok
      
      * cargo cucumber ok
      
      * cargo test workspace ok
      
      * cargo test workspace quasi ok
      
      * cargo check all tests
      
      * cargo check all
      
      * remove IdtyEvent change owner key
      
      * remove removal other reason
      
      * refac revocation and removal reason
      
      * wip
      
      * refac
      
      * refac scheduling (tests ok)
      
      * add *Period
      
      * cargo test identity ok
      
      * remove IdtyEvent::Validated
      
      * cargo test wot ok
      
      * cargo test wot ok
      
      (one fails but fot the good reason)
      
      * cargo test membership ok
      
      * cargo check wot tests
      
      * cargo check identity tests
      
      * cargo check membership tests
      
      * also remove validate trait
      
      * remove validate_identity
      
      * refac identity status to allow more fine-grain control
      
      * remove unused trait
      
      * cargo check ok
      
      * remove indentity confirmation constraints
      
      * remove request from membership primitives
      
      * remove request_membership from lib.rs
      6b598084
      History
      refac membership (!215)
      Hugo Trentesaux authored
      * delete notes.txt file
      
      * update notes with links to issues
      
      * update comment according to #159
      
      * doc idtystatus in readme
      
      * update weightinfo and benchmarks accordingly
      
      * add benchmark
      
      * remove remove_identity_consumers
      
      * remove force_remove_identity call
      
      * fix todo in test
      
      * update doc
      
      - remove request_membership
      - remove validate_identity
      
      * fix tests according to new MembershipRemovalReason
      
      * add membership removal reasons
      
      and clean up membership internal functions
      
      * remove check_remove_identity
      
      * build live tests
      
      (but no current network to check them against)
      
      * clippy :man_facepalming:
      
      * add wot tests related to issue #136
      
      * refac certification creation checks
      
      * refac identity creation checks
      
      * test benchmark ok
      
      * more precise error messages
      
      * check benchmarks ok
      
      * cargo cucumber ok
      
      * cargo test workspace ok
      
      * cargo test workspace quasi ok
      
      * cargo check all tests
      
      * cargo check all
      
      * remove IdtyEvent change owner key
      
      * remove removal other reason
      
      * refac revocation and removal reason
      
      * wip
      
      * refac
      
      * refac scheduling (tests ok)
      
      * add *Period
      
      * cargo test identity ok
      
      * remove IdtyEvent::Validated
      
      * cargo test wot ok
      
      * cargo test wot ok
      
      (one fails but fot the good reason)
      
      * cargo test membership ok
      
      * cargo check wot tests
      
      * cargo check identity tests
      
      * cargo check membership tests
      
      * also remove validate trait
      
      * remove validate_identity
      
      * refac identity status to allow more fine-grain control
      
      * remove unused trait
      
      * cargo check ok
      
      * remove indentity confirmation constraints
      
      * remove request from membership primitives
      
      * remove request_membership from lib.rs
    app-controllers.js 6.56 KiB
    
    angular.module('cesium.app.controllers', ['cesium.services'])
    
      .config(function($httpProvider) {
        'ngInject';
    
        //Enable cross domain calls
        $httpProvider.defaults.useXDomain = true;
    
        //Remove the header used to identify ajax call  that would prevent CORS from working
        delete $httpProvider.defaults.headers.common['X-Requested-With'];
      })
    
      .config(function($stateProvider) {
        'ngInject';
    
        $stateProvider
    
          .state('app', {
            url: "/app",
            abstract: true,
            templateUrl: "templates/menu.html",
            controller: 'AppCtrl'
          })
        ;
    
      })
    
      .controller('AppCtrl', AppController)
    
      .controller('PluginExtensionPointCtrl', PluginExtensionPointController)
    
    ;
    
    
    /**
     * Useful controller that could be reuse in plugin, using $scope.extensionPoint for condition rendered in templates
     */
    function PluginExtensionPointController($scope, PluginService) {
      'ngInject';
      $scope.extensionPoint = PluginService.extensions.points.current.get();
    }
    
    /**
     * Abstract controller (inherited by other controllers)
     */
    function AppController($scope, $rootScope, $ionicModal, $state, $ionicSideMenuDelegate, UIUtils, $q, $timeout,
      CryptoUtils, BMA, Wallet, APP_CONFIG, $ionicHistory, Device, $ionicPopover, $translate, $filter,
      Modals
      ) {
      'ngInject';
    
      $scope.search = { text: '', results: {} };
      $scope.config = APP_CONFIG;
      if (!$rootScope.walletData) {
        $rootScope.walletData = Wallet.data;
      }
    
      ////////////////////////////////////////
      // Load currencies
      ////////////////////////////////////////
    
      $scope.loadCurrencies = function() {
        return $q(function (resolve, reject){
          if (!!$rootScope.knownCurrencies) { // get list only once
            resolve($rootScope.knownCurrencies);
            return;
          }
          $rootScope.knownCurrencies = [];
          BMA.blockchain.parameters()
          .then(function(res) {
            $rootScope.knownCurrencies.push({
              name: res.currency,
              peer: BMA.node.url}
            );
            $scope.search.looking = false;
            resolve($rootScope.knownCurrencies);
          })
          .catch(UIUtils.onError('ERROR.GET_CURRENCY_PARAMETER'));
        });
      };
    
      ////////////////////////////////////////
      // Device Methods
      ////////////////////////////////////////
    
      $scope.isDeviceEnable = function() {
        return Device.isEnable();
      };
    
      $scope.scanQrCodeAndGo = function() {
        if (!Device.isEnable()) {
          return;
        }
        Device.camera.scan()
        .then(function(uri) {
          if (!uri) {
            return;
          }
          BMA.uri.parse(uri)
          .then(function(result){
            // If pubkey
            if (result && result.pubkey) {
              $state.go('app.wot_view_identity', {
                pubkey: result.pubkey,
                node: result.host ? result.host: null}
              );
            }
            else {
              UIUtils.alert.error(result, 'ERROR.SCAN_UNKNOWN_FORMAT');
            }
          })
          .catch(UIUtils.onError('ERROR.SCAN_UNKNOWN_FORMAT'));
        })
        .catch(UIUtils.onError('ERROR.SCAN_FAILED'));
      };
    
      ////////////////////////////////////////
      // Login & wallet
      ////////////////////////////////////////
    
      // Login and load wallet
      $scope.loadWallet = function() {
        return $q(function(resolve, reject){
    
          if (!Wallet.isLogin()) {
            $scope.showLoginModal()
            .then(function(walletData) {
              if (walletData) {
                $rootScope.viewFirstEnter = false;
                Wallet.loadData()
                .then(function(walletData){
                  $rootScope.walletData = walletData;
                  resolve(walletData);
                })
                .catch(UIUtils.onError('ERROR.LOAD_WALLET_DATA_ERROR', reject));
              }
              else { // failed to login
                reject('CANCELLED');
              }
            });
          }
          else if (!Wallet.data.loaded) {
            Wallet.loadData()
              .then(function(walletData){
                $rootScope.walletData = walletData;
                resolve(walletData);
              })
              .catch(UIUtils.onError('ERROR.LOAD_WALLET_DATA_ERROR', reject));
          }
          else {
            resolve(Wallet.data);
          }
        });
      };
    
      // Login
      $scope.login = function(state) {
        if (!Wallet.isLogin()) {
          $scope.showLoginModal()
          .then(function(walletData){
            UIUtils.loading.hide();
            if (walletData) {
              $state.go(state ? state : 'app.view_wallet');
            }
          });
        }
      };
    
      // Show login modal
      $scope.showLoginModal = function() {
        return Modals.showLogin()
        .then(function(formData){
          if (!formData) return;
          Wallet.data.settings.rememberMe = formData.rememberMe;
          if (Wallet.data.settings.rememberMe) {
            Wallet.data.settings.useLocalStorage = true;
            Wallet.store();
          }
          return Wallet.login(formData.username, formData.password);
        })
        .then(function(walletData){
          if (walletData) {
            $rootScope.walletData = walletData;
          }
          return walletData;
        })
        .catch(UIUtils.onError('ERROR.CRYPTO_UNKNOWN_ERROR'));
      };
    
      // Logout
      $scope.logout = function() {
        UIUtils.loading.show();
        Wallet.logout()
        .then(function() {
          $ionicSideMenuDelegate.toggleLeft();
          $ionicHistory.clearHistory();
          $ionicHistory.clearCache()
          .then(function() {
            UIUtils.loading.hide();
            $state.go('app.home');
          });
        })
        .catch(UIUtils.onError());
      };
    
      // Is connected
      $scope.isLogin = function() {
          return Wallet.isLogin();
      };
    
      // If connected and same pubkey
      $scope.isUserPubkey = function(pubkey) {
        return Wallet.isUserPubkey(pubkey);
      };
    
      ////////////////////////////////////////
      // Useful modals
      ////////////////////////////////////////
    
      // Open transfer modal
      $scope.showTransferModal = function(parameters) {
        $scope.loadWallet()
        .then(function(walletData){
          UIUtils.loading.hide();
          if (walletData) {
            return Modals.showTransfer(parameters);
          }
        })
        .then(function(result){
          if (result){
            UIUtils.alert.info('INFO.TRANSFER_SENT');
            $state.go('app.view_wallet');
          }
        });
      };
    
      ////////////////////////////////////////
      // Layout Methods
      ////////////////////////////////////////
      $scope.showFab = function(id, timeout) {
        if (!timeout) {
          timeout = 900;
        }
        $timeout(function () {
          // Could not use 'getElementById', because it return only once element,
          // but many fabs can have the same id (many view could be loaded at the same time)
          var fabs = document.getElementsByClassName('button-fab');
          _.forEach(fabs, function(fab){
            if (fab.id == id) {
              fab.classList.toggle('on', true);
            }
          });
        }, timeout);
      };
    
    
    }