Transactions Hyperledger composer如何强制执行事务输入的有效性?
在我的应用程序中,我的事务建模如下:Transactions Hyperledger composer如何强制执行事务输入的有效性?,transactions,hyperledger-fabric,hyperledger-composer,Transactions,Hyperledger Fabric,Hyperledger Composer,在我的应用程序中,我的事务建模如下: transaction Invoice { o String invoiceNumber o DateTime invoiceDt o Double amount o Integer creditPeriod o String poNumber --> Buyer buyer --> Seller seller } 我想确保买方和卖方都在买方/卖方登记处 当我在Composer中测试时,即使交
transaction Invoice {
o String invoiceNumber
o DateTime invoiceDt
o Double amount
o Integer creditPeriod
o String poNumber
--> Buyer buyer
--> Seller seller
}
我想确保买方和卖方都在买方/卖方登记处
当我在Composer中测试时,即使交易中的买方不在买方注册中心,交易仍然是提交的
非常感谢您的帮助
感谢并问候…因此,检查您是否确实有买家和/或卖家取决于您是否明确检查您的交易逻辑-我们本身不强制执行。理想情况下,在提交()事务之前,您会对两个设置进行检查吗 但是TP函数中的答案是在链中抛出一个错误-那么事务将不会提交 例如
// and catch any exceptions that are triggered
.catch(function (error) {
throw error;
});