Decode result and typecast it to an Address

@param {web3} web3Provider - It could be value chain or utility chain provider
@param {string} result - current contract address

@return {promise}
508170
function (web3Provider, result) {
    return new Promise(function (onResolve, onReject) {
      onResolve(web3Provider.eth.abi.decodeParameter('address', result));
    });
  }
1305192
@Override
  public FutureResultImpl<T> setResult(T result) {
    this.result = result;
    succeeded = true;
    checkCallHandler();
    return this;
  }
494747
function(err, results) {
  if(err) {
    this.success = false;
    this.error = err;
    this.results = null;

    // customize error for error types
    if(util.isError(err)) {
      this.error = {
        message: err.message,
        type: err.type,
        arguments: err.arguments
      };
      if(NODE_ENV === 'development') {
        this.error.stack = err.stack;
      }
    }    

  } else {
    this.success = true;
    this.error = null;      
    this.results = convertToClient(results);    
  }
}
238345
def result(*params, &parser)
      Result.new(
        @client,
        host,
        path,
        merged_params(*params),
        &parser
      ).result
    end
533728
function result () {
    // wait for all queries to complete then build result
    return this.promise.then(results => {
        // if the entire result set is a cached view then skip processing
        if (results._cachedView) {
            // result is from collection view
            if (this.modelViewEngine.hasCollection) {
                return results
            }
            // result is record(s)
            else {
                return this.resultRaw(results)
            }
        }
        // order results if needed
        if (results.length > 1) {
            results = this.orderResults(results)
        }
        // if there are model views then build result with ModelViewEngine
        // otherwise build result based on raw data
        return defined(this.modelViewEngine)
            ? this.resultModelView(results)
            : this.resultRaw(results)
    })
}
501224
function (err, result) {
                            me.closeConnection(openConnection);
                            if (err) {
                                if (err.state !== '42S02') return cb(err);
                                result = [];
                            }
                            cb(null, result);
                        }
1112904
function promiseResult (options, data) {
		log(`promiseResult: data ${data}`);
		return new Promise((resolve, reject) => {
			/* Check cache to avoid I/O. */
			const cacheHit = checkCache(config, pattern);
			if (cacheHit !== RESPONSE_UNKNOWN) {
				log(`Cache hit: ${cacheHit}`);
				return resolve(cacheHit);
			}

			const req = https.request(options, (res) => {
				res.setEncoding('utf8');

				let response = '';
				res.on('data', (chunk) => {
					log(`Got data`);
					response += chunk;
				});

				res.on('end', () => {
					log(`end: I got ${JSON.stringify(response)}`);

					const result = serverResponseToRESPONSE(response);
					log(`end: result ${result}`);
					updateCache(config, postObject.pattern, result);

					if (result === RESPONSE_INVALID) {
						return reject(result);
					} else {
						return resolve(result);
					}
				});
			});

			req.on('error', (e) => {
				log(`Error: ${e}`);
				return reject(RESPONSE_INVALID);
			});

			// Write data to request body.
			log(`Writing to req:\n${data}`);
			req.write(data);
			req.end();
		});
	}
824294
function processResult(result) {
    return {
        whenErrorIs: (errorCode) => {
            if (
                errorCode === EAUDITNOLOCK &&
                packageLockHasNotBeenFound(result)
            ) {
                const summary = result.error.summary || '';
                result.error.summary = `package.json file is missing or is badly formatted. ${summary}`;
                return result;
            }
            return result;
        },
    };
}
445646
function (owner) {
    const web3Provider = web3ProviderFactory.getProvider('value', 'ws')
    ;

    // Validate addresses
    if (!basicHelper.isAddressValid(owner)) {
      let errObj = responseHelper.error({
        internal_error_identifier: 't_s_fm_8',
        api_error_identifier: 'invalid_address',
        error_config: basicHelper.fetchErrorConfig()
      });
      return Promise.resolve(errObj);
    }

    return web3Provider.eth.getBalance(owner)
      .then(function(balance) {
        return responseHelper.successWithData({balance: balance});
      })
      .catch(function (err) {
        //Format the error
        logger.error(err);
        return responseHelper.error({
          internal_error_identifier: 't_s_fm_9',
          api_error_identifier: 'something_went_wrong',
          error_config: basicHelper.fetchErrorConfig()
        });
      });
  }
110940
function chain(promise,
               onResolve = idResolveHandler,
               onReject = idRejectHandler) {
  var deferred = getDeferred(promise.constructor);
  switch (promise.status_) {
    case undefined:
      throw TypeError;
    case 0:
      promise.onResolve_.push(onResolve, deferred);
      promise.onReject_.push(onReject, deferred);
      break;
    case +1:
      promiseEnqueue(promise.value_, [onResolve, deferred]);
      break;
    case -1:
      promiseEnqueue(promise.value_, [onReject, deferred]);
      break;
  }
  return deferred.promise;
}
144121
function getPromise(provider, extension) {
			var contentTypeIds = provider.getProperty("contentType") || provider.getProperty("contentTypes"), //$NON-NLS-1$ //$NON-NLS-0$
			    fileTypes = provider.getProperty("fileTypes"); // backwards compatibility //$NON-NLS-0$
			if (contentTypeIds) {
				return Deferred.when(contentTypeService.isSomeExtensionOf(contentType, contentTypeIds)).then(
					function (isMatch) {
						return isMatch ? provider : null;
					});
			} else if (extension && fileTypes && fileTypes.indexOf(extension) !== -1) {
				var d = new Deferred();
				d.resolve(provider);
				return d;
			}
			return null;
		}
115451
function getResults(result, objects) {
		
		// if there are no results, resolve an empty array
		if (!result) {
			return new Promise(function(resolve, reject) {
				resolve([]);
			});
		}
		
		// if the result object is undefined or not an array, make it one
		result.objects = result.objects || [];
		result.objects = Array.isArray(result.objects) ? result.objects : [result.objects];
		objects        = _.union(objects, result.objects);
		
		// if the result has a token, there are more results, continue to get them
		if (result.token) {
			return _client.method('ContinueRetrievePropertiesEx', {
				_this: _client._sc.propertyCollector,
				token: result.token
			})
			.then(function(results) {
				return getResults(results, objects);
			});
		}
		
		// if there are no more results, return the formatted results
		else {
			return new Promise(function(resolve, reject) {
				resolve(env.format(objects));
			});
		}
	}
1246036
function fetchResults(searchText) {
      var items = $scope.$parent.$eval(self.remoteMethod),
        isList = angular.isArray(items),
        isPromise = items ? !!items.then : false; // Every promise should contain a `then` property

      if (isList) onResultsRetrieved(items);
      else if (isPromise) handleAsyncResults(items);

      function handleAsyncResults(items) {
        if (!items) return;

        items = $q.when(items);
        setLoading(true);
        items.then(onResultsRetrieved);
      }

      function onResultsRetrieved(matches) {

        // Just cache the results if the request is now outdated.
        // The request becomes outdated, when the new searchText has changed during the result fetching.
        if ((searchText || '') !== (self.searchText || '')) {
          return;
        }

        handleResults(matches);
      }
    }
273759
function promisify_func(result_transformer) {
    result_transformer = result_transformer || identity;

    var transformer = function (func_promise) {
        return function (/* ... */) {
            var args = arguments;
            return result_transformer(when(func_promise, function (func) {
                return func.apply(null, args);
            }));
        };
    };

    transformer.for_property = function (obj_promise, prop) {
        return function (/* ... */) {
            var args = arguments;
            return result_transformer(when(obj_promise, function (obj) {
                return obj[prop].apply(obj, args);
            }));
        };
    };

    return transformer;
}
1174505
function () {
      const encodeABI = contract.deploy(options).encodeABI();
      txParams.data = encodeABI;

      return new Promise(function (onResolve, onReject) {
        web3Provider.eth.sendTransaction(txParams)
          .on('transactionHash', function(transactionHash){
            onResolve(transactionHash)
          })
          .on('error', onReject);
      });
    }
698009
async function () {
    const encodedABI = simpleTokenContractObj.methods.transfer(receiverAddress, bigNumAmount.toString(10)).encodeABI();

    const estimateGasObj = new EstimateGasKlass({
      contract_name: simpleTokenContractName,
      contract_address: oThis.contractAddress,
      chain: 'value',
      sender_address: senderAddress,
      method_name: 'transfer',
      method_arguments: [receiverAddress, bigNumAmount.toString(10)]
    });

    const estimateGasResponse = await estimateGasObj.perform()
      , gasToUse = estimateGasResponse.data.gas_to_use
    ;

    // set txParams for firing event
    const rawTxParams = {
      from: senderAddress, to: receiverAddress, value: bigNumAmount.toString(10),
      gasPrice: VC_GAS_PRICE, gas: gasToUse
    };

    // set params in notification data
    notificationData.message.payload.params.txParams = rawTxParams; // one time

    // set txParams for executing transaction
    const txParams = {
      from: senderAddress,
      to: oThis.contractAddress,
      data: encodedABI,
      gasPrice: VC_GAS_PRICE,
      gas: gasToUse
    };

    // Unlock account and send transaction
    return new Promise(function (onResolve, onReject) {
      const onReceipt = function (receipt) {
        // Publish event
        notificationData.message.kind = 'transaction_mined';
        openSTNotification.publishEvent.perform(notificationData);

        // send response
        if (basicHelper.isReturnTypeTxReceipt(returnType)) {
          return onResolve(responseHelper.successWithData({
            transaction_uuid: txUUID,
            transaction_hash: receipt.transactionHash,
            transaction_receipt: receipt
          }));
        }
      };

      web3Provider.eth.personal.unlockAccount(senderAddress, senderPassphrase)
        .then(function () {
          return web3Provider.eth.sendTransaction(txParams)
            .on('transactionHash', function (transactionHash) {
              // set transaction hash in notification data
              notificationData.message.payload.transaction_hash = transactionHash; // one time
              // Publish event
              notificationData.message.kind = 'transaction_initiated';
              openSTNotification.publishEvent.perform(notificationData);

              // send response
              if (basicHelper.isReturnTypeTxHash(returnType)) {
                return onResolve(responseHelper.successWithData({
                  transaction_uuid: txUUID,
                  transaction_hash: transactionHash,
                  transaction_receipt: {}
                }));
              }
            })
            .on('receipt', onReceipt)
        })
        .catch(async function (reason) {
          logger.error("ST :: Transaction failed.\n\t Reason:", reason);

          const onCatchError = function () {
            // set error data in notification data
            notificationData.message.payload.error_data = reason;
            // Publish event
            notificationData.message.kind = 'transaction_error';
            openSTNotification.publishEvent.perform(notificationData);

            // send response
            let errObj = responseHelper.error({
              internal_error_identifier: 'l_ci_st_transfer_6',
              api_error_identifier: 'transaction_failed',
              error_config: basicHelper.fetchErrorConfig()
            });
            return onResolve(errObj);
          };

          const isNotMinedInSomeBlocksError = reason.message.includes('not mined within');
          if (isNotMinedInSomeBlocksError) {
            // get receipt
            const res = await contractInteractHelper.getTransactionReceiptFromTrasactionHash(
              web3Provider,
              notificationData.message.payload.transaction_hash
            );

            if (res.isSuccess()) {
              onReceipt(res.data.receipt);
            } else {
              onCatchError();
            }
          } else {
            onCatchError();
          }

        });

    });

  }
1269908
function (result) {
    // update status
    me.resolved = true;
    me.rejected = false;
    me.pending = false;

    _onSuccess.forEach(function (fn) {
      fn(result);
    });

    _process = function (onSuccess, onFail) {
      onSuccess(result);
    };

    _resolve = _reject = function () { };

    return me;
  }