FuelLabs/sway

Reorganizing sway-std-lib

Open

#1,759 opened on May 29, 2022

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Rust (5,421 forks)batch import
bigbikesheddingenhancementgood first issuelib: std

Repository metrics

Stars
 (61,702 stars)
PR merge metrics
 (Avg merge 22h 6m) (16 merged PRs in 30d)

Description

Description

Type: Improvement

What does your feature accomplish?

It makes it easier to navigate the standard library depending on the context. Furthermore, it makes it easier to scale the size of the library.

How does your feature accomplishes your goal?

It accomplishes this by looking at the context of what each file achieves and groups them together under directories e.g. ecr.sw and hash.sw can be grouped under hashing or cryptography.

Draft implementation

  1. We have a chain.sw which only has a dep decleration inside. We also have a chain directory. This should be reorganized.
  2. We have context.sw and also a context directory, this too should be fixed.
  3. assert.sw and require.sw should probably be grouped together if not placed in the same file
  4. option.sw and result.sw should also be together, perhaps with logging.sw?
  5. ecr.sw and hash.sw should be together, keep in mind that we have a vm directory which is specifically for EVM equivalent ecr
  6. intrinsics.sw, storage.sw, block.sw, context.sw and chain.sw could be together?
  7. address.sw, contract_id.sw, b512.sw and u128.sw can be together?

cc @nfurfaro @adlerjohn @sezna @otrho

Contributor guide