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

helper function that converts any sequence type to bytes #80

Open
radkomih opened this issue Sep 5, 2023 · 1 comment
Open

helper function that converts any sequence type to bytes #80

radkomih opened this issue Sep 5, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@radkomih
Copy link
Collaborator

radkomih commented Sep 5, 2023

Implement a generic function that converts any Sequence or FixedSequence to bytes

Previously there were some issues with the compiler #38.

type SequentialU8 interface {
	Sequence[U8] | FixedSequence[U8]
}

func SequentialU8ToBytes[S SequentialU8](bytes S) []byte {
	result := make([]byte, len(bytes))
	for i, v := range bytes {
		result[i] = byte(v)
	}
	return result
}
@radkomih radkomih added enhancement New feature or request good first issue Good for newcomers labels Sep 5, 2023
@radkomih radkomih moved this from 🆕 New to 📋 Backlog in Gosemble - Polkadot Runtimes Sep 5, 2023
@radkomih radkomih moved this from 📋 Backlog to 🆕 New in Gosemble - Polkadot Runtimes Nov 8, 2023
@radkomih
Copy link
Collaborator Author

radkomih commented Dec 5, 2023

Not going to do it right now, depending on whether we are going to stick to the current Goscale approach (using interface and wrapper types implementing an encode method) or switch to a different approach for encoding.

@Kirqkas Kirqkas moved this from 🆕 New to 📋 Backlog in Gosemble - Polkadot Runtimes Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant