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

Split std into different packages #3874

Open
Kouteki opened this issue Mar 3, 2025 · 0 comments
Open

Split std into different packages #3874

Kouteki opened this issue Mar 3, 2025 · 0 comments
Assignees

Comments

@Kouteki
Copy link
Contributor

Kouteki commented Mar 3, 2025

Description

Split into different packages

Package name ideas (see related gist)

  • chain - containing critical chain types, like Address, AddressList.
  • chain/runtime - containing meta-VM functions, like CurrentRealm, PrevRealm, AssertOriginCall.
    • not runtime as it has a different API and usage than Go's runtime
  • chain/banker - containing the Banker and Coin types, and related functions and methods to deal with the native banker.
  • chain/params - containing the SetParamBool, SetParamString, ... types

The division into packages should help to reduce the scope of each package, helping us create modular packages. It's not definitive; some questions remain on where to put the Emit functions.

Why: at the time being, all Gno-specific functions are lumped together in a single, big std package. Naming packages like base, util or common is considered bad practice in Go, where instead packages should be more specific and be concerned with specific purposes.

Status: consensus.

References:

Meta issue: #1475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants