We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src/lib/transactionBuilder.js中对address[][]参数编码有问题,导致返回params为空。 let params = [ { type: 'string[][]', value: poolVersion, }, { type: 'uint256[][]', value: versionLen, }, { type: 'address[][]', value: path, }, { type: 'uint256[]', value: amountIn, }, ]; tronWeb.transactionBuilder.triggerConstantContract(contractAddress, methodId, options, params, issuerAddress)方式构建的params参数有问题。
建议修改方案(增加address[][]判断):
if (type === 'address') value = toHex(value).replace(ADDRESS_PREFIX_REGEX, '0x'); else if (type == 'address[]') value = value.map((v) => v.replace(ADDRESS_PREFIX_REGEX, '0x')); else if (type == 'address[][]') { value = value.map((v1) => v1 = v1.map((v) => v.replace(ADDRESS_PREFIX_REGEX, '0x'))); }
The text was updated successfully, but these errors were encountered:
It is now not support multi-dimension address array but we'll record it and will fix it in the next version.
Sorry, something went wrong.
Fixed in TronWeb v6.0.0-beta.0. Welcome to try.
No branches or pull requests
src/lib/transactionBuilder.js中对address[][]参数编码有问题,导致返回params为空。
let params = [
{
type: 'string[][]',
value: poolVersion,
},
{
type: 'uint256[][]',
value: versionLen,
},
{
type: 'address[][]',
value: path,
},
{
type: 'uint256[]',
value: amountIn,
},
];
tronWeb.transactionBuilder.triggerConstantContract(contractAddress, methodId, options, params, issuerAddress)方式构建的params参数有问题。
建议修改方案(增加address[][]判断):
if (type === 'address')
value = toHex(value).replace(ADDRESS_PREFIX_REGEX, '0x');
else if (type == 'address[]')
value = value.map((v) => v.replace(ADDRESS_PREFIX_REGEX, '0x'));
else if (type == 'address[][]') {
value = value.map((v1) => v1 = v1.map((v) => v.replace(ADDRESS_PREFIX_REGEX, '0x')));
}
The text was updated successfully, but these errors were encountered: