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

when getting events from block 2535089, retriever.GetEvents() got error #361

Open
ryuuyq opened this issue Aug 9, 2023 · 1 comment
Open

Comments

@ryuuyq
Copy link

ryuuyq commented Aug 9, 2023

when getting events from block 2535089, retriever.GetEvents() got error :

event parsing: error 0: exec function error: event topics decoding: event #1: expected more bytes, but could not decode any more

	testURL := "wss://rpc.polkadot.io"
	api, err := gsrpc.NewSubstrateAPI(testURL)
	if err != nil {
		log.Printf("Couldn't connect to '%s': %s\n", testURL, err)
		return
	}
	retriever, err := retriever.NewDefaultEventRetriever(state.NewEventProvider(api.RPC.State), api.RPC.State)
	if err != nil {
		log.Printf("Couldn't create event retriever: %s", err)
		return
	}

	blockHash, err := api.RPC.Chain.GetBlockHash(uint64(2535089))
	if err != nil {
		log.Printf("Couldn't retrieve blockHash for '%s', block number %d: %s\n", testURL, header.Number, err)
		return
	}

	events, err := retriever.GetEvents(blockHash)
	if err != nil {
		log.Printf("Couldn't retrieve events for '%s', block number %d: %s\n", testURL, header.Number, err)
		return
	}

	log.Printf("Found %d events for '%s', at block number %d.\n", len(events), testURL, header.Number)
@cdamian
Copy link
Contributor

cdamian commented Dec 5, 2023

@ryuuyq - please refer to - #357 (comment)

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