Update profile_hash on blockchain
519576
def update_user(self, username, profile, owner_privkey):
        

        url = self.base_url + "/users/" + username + "/update"

        owner_pubkey = get_pubkey_from_privkey(owner_privkey)

        payload = {
            'profile': profile,
            'owner_pubkey': owner_pubkey
            }

        resp = self._post_request(url, payload)

        try:
            unsigned_tx = resp['unsigned_tx']
        except:
            return resp

        dht_resp = write_dht_profile(profile)
        dht_resp = dht_resp[0]

        if not dht_resp['status'] == 'success':
            return {"error": "DHT write failed"}

        # sign all unsigned inputs
        signed_tx = sign_all_unsigned_inputs(owner_privkey, unsigned_tx)

        return self.broadcast_transaction(signed_tx)
1020003
def _hash(self, hash_name):
        
        m = hashlib.new(hash_name)
        for chunk in self.chunks(8192, mode="rb"):
            m.update(chunk)
        return m
1044583
def update_from_hash(hash)
      j = self
      #update top line params
      j.update_attributes(:active => hash['active'],
                          :trigger => hash['trigger'])
      (1..5).to_a.each do |s_idx|
        stage_string = hash["stage#{s_idx.to_s}"]
        s = Stage.find_by_path("#{j.path}/stage#{s_idx.to_s}")
        if stage_string.to_s.length==0
          #delete this stage and all stages after
          if s
            j = s.job
            j.stages[(s.idx-1)..-1].each{|ps| ps.delete}
            #just in case
            s.delete
          end
          break
        elsif s.nil?
          #create this stage
          s = Stage.find_or_create_by_path("#{j.path}/stage#{s_idx.to_s}")
        end
        #parse command string, update stage with it
        s_handler, call, param_string = [""*3]
        stage_string.split(" ").ie do |spls|
          s_handler = spls.first.split(".").first
          call = spls.first.split(".").last
          param_string = spls[1..-1].join(" ").strip
        end
        s.update_attributes(:call=>call, :handler=>s_handler, :param_string=>param_string)
      end
      return j.reload
    end
522914
def add_hashed_value(self, hash_value, store_key):
        
        if self._unique and hash_value in self._index:
            raise NonUnique('Hash value {} already in index'.format(hash_value))
        if store_key not in self._index[hash_value]:
            self._index[hash_value].append(store_key)
        if hash_value not in self._reverse_index[store_key]:
            self._reverse_index[store_key].append(hash_value)
708337
function onUpdateProfile() {
  var displayName = $('#display-name').val();
  var photoURL = $('#photo-url').val();
  activeUser().updateProfile({
    'displayName': displayName,
    'photoURL': photoURL
  }).then(function() {
    refreshUserData();
    alertSuccess('Profile updated!');
  }, onAuthError);
}
729319
def update(registration_id, tags_add: nil, tags_remove: nil, clear_tags: false, alis: nil, mobile: nil)
      tags =
        if clear_tags
            ''
        else
          hash = {}
          hash[:add] = [tags_add].flatten unless tags_add.nil?
          hash[:remove] = [tags_remove].flatten unless tags_remove.nil?
          hash.empty? ? nil : hash
        end
      body = {
        tags: tags,
        alias: alis,
        mobile: mobile
      }.select { |_, value| !value.nil? }

      url = base_url + registration_id
      Http::Client.post(@jpush, url, body: body)
    end
955810
def db_continue( block_id, consensus_hash ):
    

    # every so often, clean up
    if (block_id % 20) == 0:
        log.debug("Pre-emptive garbage collection at %s" % block_id)
        gc.collect(2)

    return is_running() or os.environ.get("BLOCKSTACK_TEST") == "1"
122654
def update_txn_with_extra_data(self, txn):
        
        # For RAW and ENC attributes, only hash is stored in the ledger.
        if get_type(txn) == ATTRIB:
            txn_data = get_payload_data(txn)
            # The key needs to be present and not None
            key = RAW if (RAW in txn_data and txn_data[RAW] is not None) else \
                ENC if (ENC in txn_data and txn_data[ENC] is not None) else None
            if key:
                txn_data[key] = self.attributeStore.get(txn_data[key])
        return txn
77474
def update_head_candidate(forward_pending_transaction=true)
      logger.debug "updating head candidate", head: head

      # collect uncles
      blk = head # parent of the block we are collecting uncles for
      uncles = get_brothers(blk).map(&:header).uniq

      (@env.config[:max_uncle_depth]+2).times do |i|
        blk.uncles.each {|u| uncles.delete u }
        blk = blk.get_parent if blk.has_parent?
      end

      raise "strange uncle found!" unless uncles.empty? || uncles.map(&:number).max <= head.number

      uncles = uncles[0, @env.config[:max_uncles]]

      # create block
      ts = [Time.now.to_i, head.timestamp+1].max
      _env = Env.new DB::OverlayDB.new(head.db), config: @env.config, global_config: @env.global_config
      hc = Block.build_from_parent head, @coinbase, timestamp: ts, uncles: uncles, env: _env
      raise ValidationError, "invalid uncles" unless hc.validate_uncles

      @pre_finalize_state_root = hc.state_root
      hc.finalize

      # add transactions from previous head candidate
      old_hc = @head_candidate
      @head_candidate = hc

      if old_hc
        tx_hashes = head.get_transaction_hashes
        pending = old_hc.get_transactions.select {|tx| !tx_hashes.include?(tx.full_hash) }

        if pending.true?
          if forward_pending_transaction
            logger.debug "forwarding pending transaction", num: pending.size
            pending.each {|tx| add_transaction tx }
          else
            logger.debug "discarding pending transaction", num: pending.size
          end
        end
      end
    end
237677
def update(self, update):
        

        params = shlex.split(update)
        if params[0] in self.addr:
            self.addr[params[0]].update(*params)

        else:
            a = Addr(self)
            # add both name and IP address
            self.addr[params[0]] = a
            self.addr[params[1]] = a
            a.update(*params)
            self.notify("addrmap_added", *[a], **{})
894361
def update_transfer(
            self,
            nonce: Nonce,
            balance_hash: BalanceHash,
            additional_hash: AdditionalHash,
            partner_signature: Signature,
            signature: Signature,
            block_identifier: BlockSpecification,
    ):
        
        self.token_network.update_transfer(
            channel_identifier=self.channel_identifier,
            partner=self.participant2,
            balance_hash=balance_hash,
            nonce=nonce,
            additional_hash=additional_hash,
            closing_signature=partner_signature,
            non_closing_signature=signature,
            given_block_identifier=block_identifier,
        )
637826
public void updateProfile(ProfileUpdate profile) {
		getResourceFactory().getApiResource("/user/profile/")
				.entity(profile, MediaType.APPLICATION_JSON_TYPE).put();
	}
38573
def set(ctx, key, value):
    
    if key == "default_account" and value[0] == "@":
        value = value[1:]
    ctx.blockchain.config[key] = value
1349197
def shallow_update(other_hash)
      other_hash.each_pair do |k, v|
        regular_writer(convert_key(k), convert_value(v, true))
      end
      self
    end
1089220
def update(gandi, resource, name, size, quantity, password, sshkey,
           upgrade, console, snapshotprofile, reset_mysql_password,
           background, delete_snapshotprofile):
    

    if snapshotprofile and delete_snapshotprofile:
        raise UsageError('You must not set snapshotprofile and '
                         'delete-snapshotprofile.')

    pwd = None
    if password:
        pwd = click.prompt('password', hide_input=True,
                           confirmation_prompt=True)

    if delete_snapshotprofile:
        snapshotprofile = ''

    result = gandi.paas.update(resource, name, size, quantity, pwd,
                               sshkey, upgrade, console, snapshotprofile,
                               reset_mysql_password, background)
    if background:
        gandi.pretty_echo(result)

    return result
627212
def update(tag_value, devices_add: nil, devices_remove: nil)
      rids = {}
      rids[:add] = [devices_add].flatten unless devices_add.nil?
      rids[:remove] = [devices_remove].flatten unless devices_remove.nil?

      body = { registration_ids: rids }
      url = base_url + tag_value
      Http::Client.post(@jpush, url, body: body)
    end
978019
function savePrivateProfile(objPrivateProfile, address, attestor_address, onDone){
	db.query(
		"INSERT "+db.getIgnore()+" INTO private_profiles (unit, payload_hash, attestor_address, address, src_profile) VALUES(?,?,?,?,?)", 
		[objPrivateProfile.unit, objPrivateProfile.payload_hash, attestor_address, address, JSON.stringify(objPrivateProfile.src_profile)], 
		function (res) {
			var private_profile_id = (res.insertId && res.affectedRows) ? res.insertId : 0;

			var insert_fields = function(current_src_profile) {
				var arrQueries = [];
				var isSrcProfileUpdated = false;
				for (var field in objPrivateProfile.src_profile){
					var arrValueAndBlinding = objPrivateProfile.src_profile[field];
					if (ValidationUtils.isArrayOfLength(arrValueAndBlinding, 2)) {
						if (!current_src_profile || !current_src_profile[field] || !ValidationUtils.isArrayOfLength(current_src_profile[field], 2)) {
							if (current_src_profile) {
								isSrcProfileUpdated = true;
								current_src_profile[field] = arrValueAndBlinding;
							}
							db.addQuery(arrQueries, "INSERT INTO private_profile_fields (private_profile_id, field, value, blinding) VALUES(?,?,?,?)", 
							[private_profile_id, field, arrValueAndBlinding[0], arrValueAndBlinding[1] ]);
						}
					}
				}
				if (isSrcProfileUpdated)
					db.addQuery(arrQueries, "UPDATE private_profiles SET src_profile=? WHERE private_profile_id=?", [JSON.stringify(current_src_profile), private_profile_id]);
				async.series(arrQueries, onDone);
			}

			if (!private_profile_id) { // already saved profile but with new fields being revealed
				db.query("SELECT private_profile_id, src_profile FROM private_profiles WHERE payload_hash=?", [objPrivateProfile.payload_hash], function(rows) {
					if (!rows.length)
						throw Error("can't insert private profile "+JSON.stringify(objPrivateProfile));
					private_profile_id = rows[0].private_profile_id;
					var src_profile = JSON.parse(rows[0].src_profile);
					insert_fields(src_profile);
				});
			}
			else
				insert_fields();

		}
	);
}