fabric-composer 事务 return 是什么数据类型?

What data type does a fabric-composer transaction return?

我对我的结构分类账交易需要什么数据类型感到困惑return。

样本网络认为 Promise 需要 returned,但我不清楚 Promise 是否是预期的 return 值 and/or 如果returned Promise 需要 return 任何特定类型(例如字符串或布尔值)。

function onSampleTransaction(sampleTransaction) {
    sampleTransaction.asset.value = sampleTransaction.newValue;
    return getAssetRegistry('org.acme.sample.SampleAsset')
      .then(function (assetRegistry) {
          return assetRegistry.update(sampleTransaction.asset);
      });
}

fabric-composer 事务处理什么数据类型return?

为了执行交易,您必须 return a Promise,但是 returnPromise 的类型无关紧要。

Return 类型始终是 Promise,开发人员根据他的知识或返回的类型解析类型。例如,Exists 函数 returns 一个可以解析为布尔值的 Promise,其值为 true 或 false。