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

FindStorageByHash can't be used with C# nodes when omitting start param #3137

Closed
ixje opened this issue Sep 20, 2023 · 0 comments · Fixed by #3166
Closed

FindStorageByHash can't be used with C# nodes when omitting start param #3137

ixje opened this issue Sep 20, 2023 · 0 comments · Fixed by #3166
Labels
bug Something isn't working
Milestone

Comments

@ixje
Copy link
Contributor

ixje commented Sep 20, 2023

Current Behavior

causes error in C# node

Expected Behavior

return requested storage

Possible Solution

When passing nil as start it should send some bogus 3rd param to the FindStorage RPC Method such that start will default to 0. Right now it only send 2 params, while the RPC method always expects 3 (ref)

A C# node now errors with

Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')

while trying to access _params[2] in the linked reference code.

Steps to Reproduce

var PrefixAccount = []byte{0x14}

func main() {
	c, err := NewRpcClient("http://seed1t5.neo.org:20332")
	if err != nil {
		panic(fmt.Errorf("failed to create rpc client to node: %v", err))
	}
	response, err := c.FindStorageByHash(neo.Hash, PrefixAccount, nil)
	if err != nil {
		panic(err)
	}
}

Your Environment

  • Version used: 0.102.0
@ixje ixje added the bug Something isn't working label Sep 20, 2023
@AnnaShaleva AnnaShaleva added this to the v0.102.1 milestone Sep 20, 2023
AnnaShaleva added a commit that referenced this issue Oct 18, 2023
Close #3137.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants