Closed mFragaBA closed 2 weeks ago
The changes in miden_tx
broke some of the imports here, I already commited some fixes to the parent branch so we only have to merge them.
The changes in
miden_tx
broke some of the imports here, I already commited some fixes to the parent branch so we only have to merge them.
done! Rebased and pushed
InvalidNoteInputsError
seems like an internal-only error which doesn't appear in the public interface. If so, we should hide it (e.g., usepub(crate)
).
While it does not appear in the public interface directly, it is used in NoteScreenerError
which is part of the public api. Making InvalidNoteInputsError
results in the following warning:
1 warning: type `InvalidNoteInputsError` is more private than the item `NoteScreenerE
rror::InvalidNoteInputsError::0`
--> src/errors.rs:398:28
|
398 | InvalidNoteInputsError(InvalidNoteInputsError),
| ^^^^^^^^^^^^^^^^^^^^^^ field `NoteScreenerError::Inva
lidNoteInputsError::0` is reachable at visibility `pub`
|
note: but type `InvalidNoteInputsError` is only usable at visibility `pub(crate)`
--> src/errors.rs:428:1
|
428 | pub(crate) enum InvalidNoteInputsError {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default
While it does not appear in the public interface directly, it is used in
NoteScreenerError
which is part of the public api. MakingInvalidNoteInputsError
results in the following warning:
Ah - I see! Let's keep it as is then.
Is this ready for another review? Or should I hold off for now?
Is this ready for another review? Or should I hold off for now?
should be, yes. I haven't been able to update the PR description to include the newer commits, but looking at the specific commit changes should be pretty self explanatory. Also opened #374 to refactor the errors
closes #362. closes #284.
I tried to have each commit as self contained as possible:
StoreConfig
an associated type ofStore
. This allows the consumers of the library to re-use theClientConfig
struct when providing their own store implementation. Not only that but we expect it to satisfy a few trait bounds (usually they can be derived) such asDebug
,Default
,Eq
,PartialEq
,Serialize
,DeserializeOwned
.std
in base so we should add it here as well to be explicit about it.uuid
andtest_utils
. This comes at a bit of a cost. Unless we're on unit tests of the client, we can't use anything under#[cfg(test)]
because in those cases (like the CLI and integration tests) the client gets compiled but not in test mode. I couldn't find a built in way to do so and the workaround is what we had withtest_utils
which is to define a custom feature flag, but the problem is that it cannot be hidden. In order to removeuuid
andtest_utils
I also had to remove some tests fromsrc/cli/...
, but considering we're adding very similar tests on #353 it's not a big deal.CliConfig
frommiden_client
. The way to do so was by inverting the dependency between it and theClientConfig
struct. So we go from "AClientConfig
can have aCliConfig
defined" to "AllCliConfig
has aClientConfig
defined"rusqlite
andrusqlite_migration
as features by prepending them with adep:
onCargo.toml
Discussion