Substrate: Remaining renames (metaissue)

Created on 6 Dec 2019  路  10Comments  路  Source: paritytech/substrate

A tentative list of issues that are still remaining to wrap up the "big refactor" thing.
Most likely it should be one PR per rename (i.e. keep them small and focused) - it's should be just a mechanical work.
Feel free to leave a comment if you work on one.

Crate names:

  • [x] sc-application-crypto -> sp-application-crypto
  • [x] sp-transaction-pool-api -> sp-transaction-pool
  • [x] sp-core-storage -> sp-storage
  • [x] transaction-factory -> substrate-transaction-factory
  • [x] move chain-spec-builder to bin
  • [ ] sc-client-api -> sc-api ?
  • [ ] sc-client-db -> sc-db ?

Folder names:

  • [x] primitives/sr-arithmetic -> primitives/arithmetic
  • [x] primitives/sr-api -> primitives/api
  • [x] primitives/sr-io -> primitives/io
  • [x] primitives/sr-primitives -> primitives/runtime
  • [x] primitives/sr-sandbox -> primitives/sandbox
  • [x] primitives/sr-staking-primitives -> primitives/staking
  • [x] primitives/sr-std -> primitives/std
  • [x] primitives/sr-version -> primitives/version
  • [x] primitives/block-builder/runtime-api -> primitives/block-builder
  • [x] test/utils -> test-utils
  • [x] client/rpc/api -> client/rpc-api
  • [x] client/utils/wasm-builder-runner -> utils/wasm-builder-runner
  • [x] client/grafana-data-source -> utils/grafana-data-source (?)

Other:

  • [ ] Merge sp-serializer with sp-core or sp-runtime
  • [x] Merge sp-transaction-pool-runtime-api with sp-transaction-pool
I6-refactor 馃Ч P5-sometimesoon

All 10 comments

Tackling:

Merge sp-transaction-pool-runtime-api with sp-transaction-pool

refs #4099

We also have to clean up the remaining ../client-dependencies in /primitives ... maybe means moving consensus-slots from client to primitives or move around the Traits for it (because sc-consensus-slots has many sc--dependencies)

Yeah, I think the SlotData trait just belongs to primitives. Either common or a new crate for slots primitives.

primitives/sr-primitives -> primitives/runtime

4280

primitives/sr-std -> primitives/sp-std

4327

primitives/sr-io -> primitives/sp-io

4328

The idea to clean up alias-imports (which I would already apply for folder rename-PRs), is to use a script. The problem is, however, that this is inherently local to the specific crate, so we'd need something that reads the local Cargo.toml-file, finds the aliases, replaces the local alias with the actual package-name and then updates the Cargo.toml. This script can then be applied one at one package at a time (deepest first, probably). But this isn't a trivail thing, and I am not sure it makes sense to do that in bash or maybe even just make a short rust-cli for it.

I have a different thing on my schedule right now, but could see if I can get to it after.

@gnunicorn It would be good to finish up all the renames and moves this week, I might find some time to write the script earlier. Let's coordinate to avoid duplicating efforts.

[ ] test/utils -> test-utils

Not sure I agree on that one, test also contains test/client and thus groups the test-area nicely together. I don't see much benefit having test and test-utils in root...

@gnunicorn does it really contain test/client?
image

The latest commit only seems to have utils inside, hence I opted in for flattened structure.

@tomusdrw you are right, that was on my local checkout only. sure, let's rename it then.

Re:

  • sc-client-api -> sc-api ?
  • sc-client-db -> sc-db ?

I agree the client- in there is redundant, but neither of the other short-names feels appropriate ... didn't do this yet...

Was this page helpful?
0 / 5 - 0 ratings