使用来自drizzle/react-components的ContractData尝试并调用一个从结构返回多个参数的读取函数
MyComponent.js
<div>
<h2>Get Participant Details</h2>
<ContractData
drizzle={drizzle}
drizzleState={drizzleState}
contract="supplyChain"
method="getParticipantDetails"
methodArgs={[1, "modelNumber"]}
/>固定性合约
struct participant {
string userName;
string password;
string participantType;
address participantAddress;
}
function getParticipantDetails(uint32 _p_id) public view returns (string,address,string) {
return (participants[_p_id].userName, participants[_p_id].participantAddress, participants[_p_id].participantType);
}不确定如何准确地读取带有drizzy值的元组
发布于 2021-12-01 15:04:54
可以帮助您进行https://github.com/trufflesuite/drizzle/blob/develop/ui-tests/react-redux/src/MyComponent.js
来自行:合同ComplexStorage的188
但是我看到了methodArgs add的错误标签:
添加:methodArgs="1,"modelNumber"“
https://stackoverflow.com/questions/68432591
复制相似问题