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

Filtering transfer logs returns empty data #24241

Closed
beansgum opened this issue Jan 15, 2022 · 2 comments
Closed

Filtering transfer logs returns empty data #24241

beansgum opened this issue Jan 15, 2022 · 2 comments

Comments

@beansgum
Copy link

System information

Geth version: geth version

Geth
Version: 1.10.15-stable
Git Commit: 8be800ffa9c4992666e2620e0ab4725a1a83352b
Architecture: amd64
Go Version: go1.17.5
Operating System: linux
GOPATH=/home/ubuntu/go
GOROOT=go

OS & Version: Linux

Expected behaviour

Expected vlog.Data to contain log data.

Actual behaviour

vlog.Data has a length of 0.

Steps to reproduce the behaviour

query := ethereum.FilterQuery{
	FromBlock: big.NewInt(startBlock),
	ToBlock:   big.NewInt(startBlock + blockIntervals),
	Topics:    [][]common.Hash{{transferEventTopicId}},
}

logs, err := client.FilterLogs(context.Background(), query)
if err != nil {
	return err
}
for _, vLog := range logs {

	if vLog.Removed {
		continue
	}

	event := tokencontract.TokencontractTransfer{}
	err := contractAbi.UnpackIntoInterface(&event, "Transfer", vLog.Data)
	if err != nil {
		log.Errorf("error unpacking into interface: %v", err)
		continue
	}
}

Backtrace

error unpacking into interface: abi: attempting to unmarshall an empty string while arguments are expected
@MariusVanDerWijden
Copy link
Member

Could you add a link to your code, so we can reproduce this?

@s1na
Copy link
Contributor

s1na commented Dec 7, 2022

I bet this was also related to #25457. Anyway since there has been no activity for along time I'll go ahead and close. Feel free to re-open if you're still facing this issue.

@s1na s1na closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@ligi @s1na @MariusVanDerWijden @beansgum and others