Redundant Header.GetIndex() method #1477

Open
opened 2025-12-28 17:16:35 +00:00 by sami · 1 comment
Owner

Originally created by @AliceInHunterland on GitHub (Jan 30, 2025).

It is preferable to avoid that, but generics in Go don't support structural types for now, ref. golang/go#51259.

// GetIndex returns the index of the block.
func (b *Header) GetIndex() uint32 {
	return b.Index
}

Describe the solution you'd like

So one day redundant code should be removed.

Describe alternatives you've considered

Additional context

https://github.com/nspcc-dev/neo-go/pull/3789#discussion_r1931703212

Originally created by @AliceInHunterland on GitHub (Jan 30, 2025). ## Is your feature request related to a problem? Please describe. <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when ... --> It is preferable to avoid that, but generics in Go don't support structural types for now, ref. golang/go#51259. ``` // GetIndex returns the index of the block. func (b *Header) GetIndex() uint32 { return b.Index } ``` ## Describe the solution you'd like <!-- A clear and concise description of what you want to happen. --> So one day redundant code should be removed. ## Describe alternatives you've considered <!-- A clear and concise description of any alternative solutions or features you've considered. --> ## Additional context <!-- Add any other context or screenshots about the feature request here. --> https://github.com/nspcc-dev/neo-go/pull/3789#discussion_r1931703212
Author
Owner

@AnnaShaleva commented on GitHub (Jan 30, 2025):

Attach the link to the original conversation.

@AnnaShaleva commented on GitHub (Jan 30, 2025): Attach the link to the original conversation.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neo-go#1477
No description provided.