我正在使用composer-client
设置与HyperLedger作曲家连接的API我制作了一个NetworkService类来与HyperLedger交互,并且内部有一个函数:
let bizNetConnection = new BusinessNetworkConnection();
public createTransaction(type: String, transData: Object): Promise<any> {
const newTransaction = this.factory.newTransaction(`${config.get("ns")}`, type);
let trans = Object.assign(newTransaction, transData);
return new Promise((resolve: any, reject: any) => {
bizNetConnection.submitTransaction(trans)
.then((res: any) => {resolve(res)})
.catch((error: any) => {reject(error)})
})
}
在submitTransaction
函数之后,res
始终为undefined