FISCO-BCOS / go-sdk

golang SDK of FISCO BCOS
Apache License 2.0
73 stars 58 forks source link

abigen将文件转换成Go文件写接口没有生成解析返回值的代码 #150

Open QianGuoZi opened 2 years ago

QianGuoZi commented 2 years ago

solidity(v0.4.25)中写函数的返回值似乎无法解析出来,读函数需要添加constant关键字才可以拿到返回值(view关键字没有尝试) // SetIdDTrace is a paid mutator transaction binding the contract method 0xbbf74676. // // Solidity: function setIdDTrace(int256 _idA, int256 _idD) returns(int256) func (_Tls *TlsSession) SetIdDTrace(_idA *big.Int, _idD *big.Int) (*types.Transaction, *types.Receipt, error) { return _Tls.Contract.SetIdDTrace(&_Tls.TransactOpts, _idA, _idD) }

// GetId is a free data retrieval call binding the contract method 0xd4e2e579. // // Solidity: function get_id(string idStr) constant returns(int256) func (_Tls *TlsSession) GetId(idStr string) (*big.Int, error) { return _Tls.Contract.GetId(&_Tls.CallOpts, idStr) } 感觉可以改进一下?XD

QianGuoZi commented 2 years ago

代码贴得好丑,再贴一次((

// GetId is a free data retrieval call binding the contract method 0xd4e2e579.
//
// Solidity: function get_id(string idStr) constant returns(int256)
func (_Tls *TlsCallerSession) GetId(idStr string) (*big.Int, error) {
    return _Tls.Contract.GetId(&_Tls.CallOpts, idStr)
}
// SetIdDTrace is a paid mutator transaction binding the contract method 0xbbf74676.
//
// Solidity: function setIdDTrace(int256 _idA, int256 _idD) returns(int256)
func (_Tls *TlsSession) SetIdDTrace(_idA *big.Int, _idD *big.Int) (*types.Transaction, *types.Receipt, error) {
    return _Tls.Contract.SetIdDTrace(&_Tls.TransactOpts, _idA, _idD)
}
bxq2011hust commented 2 years ago

abigen没有生成解析写接口的返回值的代码,TODO

bxq2011hust commented 1 year ago

https://github.com/FISCO-BCOS/go-sdk/pull/183/files