Skip to content
New issue

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

abi: length larger than int64: #274

Open
abing258 opened this issue Apr 15, 2024 · 5 comments
Open

abi: length larger than int64: #274

abing258 opened this issue Apr 15, 2024 · 5 comments

Comments

@abing258
Copy link

image I called the query method and obtained the following result.
@bxq2011hust
Copy link
Member

The error is because the output mismatches the method return value. You should check if the method abi matches with the contract code or maybe the call request has failed

@abing258
Copy link
Author

该错误是因为输出与方法返回值不匹配。您应该检查方法abi是否与合约代码匹配或者调用请求失败

image After checking, I found that this method added some garbled characters to the input parameters

@bxq2011hust
Copy link
Member

bxq2011hust commented Apr 17, 2024

length larger than int64 possible reasons:

  1. expect int64, but return exceeds the range of int64. maybe you get uint64 as return but use int64 to Unpack
  2. the call request is failed because the logic of contract, you should check if call return error, if it is the output is the encoded bytes of "Error(string)", doc is here
  3. the method you used to Unpack is mismatch the call request, for example call a method get() returns string and use get() returns int64 to Unpack

@abing258
Copy link
Author

length larger than int64可能的原因:

  1. 期望int64,但返回超出了int64的范围。也许你得到 uint64 作为返回,但使用 int64 来解压
  2. 由于合约逻辑,调用请求失败,您应该检查调用是否返回错误,如果是输出是“Error(string)”的编码字节,文档在这里
  3. 您用于 Unpack 的方法与调用请求不匹配,例如调用一个方法get() returns string并用于get() returns int64 Unpack
  1. There is no problem with the contract logic. I can get the result by calling it with webase
  2. I generated the SDK file using Abigen and did not make any individual changes

@bxq2011hust
Copy link
Member

It doesn't sound very reasonable. Please provide the code, environment information, and reproduction method so that we can track it
@abing258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants