maidsafe / sn_dbc

Safe Network DBCs
BSD 3-Clause "New" or "Revised" License
15 stars 16 forks source link

refactor: move mock code into new mock mod #165

Closed dan-da closed 2 years ago

dan-da commented 2 years ago

This moves all "extra" functionality into a new module "mock" with a corresponding feature flag and its own Error enum.

The moved items are:

 GenesisBuilderMock --> mock::GenesisBuilder
 SpentbookNodeMock  --> mock::SpentbookNode
 SimpleKeyManager   --> mock::KeyManager
 SimpleSigner       --> mock::Signer

This makes the core library leaner, meaner and easier to audit/review/understand.

It also makes it extra clear what is mock functionality when using the lib. eg, in test cases, mint-repl or sn_dbc_examples.

Cargo changes:

Code changes:

dan-da commented 2 years ago

note: cargo tests are failing. Once #168 is merged, I will rebase this on top.

dan-da commented 2 years ago

rebased on latest master. I will merge it once CI tests pass.