使用 drizzle/react-components 中的 ContractData 尝试调用从结构返回多个参数的读取函数
我的组件.js
<div>
<h2>Get Participant Details</h2>
<ContractData
drizzle={drizzle}
drizzleState={drizzleState}
contract="supplyChain"
method="getParticipantDetails"
methodArgs={[1, "modelNumber"]}
/>
Solidity 合约
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);
}
不确定如何用 Drizzle 准确读取元组