Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ section banners, access-group organization, Doxygen patterns, and CMake style.
- Document private members and internal helpers as well as public declarations.
- Keep API comments focused on their declaration and free of implementation details.
- Use the checked-in `.clang-format` with clang-format 15.
- Keep native memory management private and automatic; preserve value semantics.
- Keep ordinary memory management automatic and preserve value semantics. Use the documented native interoperability methods for explicit C access.
- Do not downgrade language features to match older reference projects.
- Follow existing build, test, documentation, and package-consumer checks.
- Keep style-only changes separate from behavioral changes.
Expand Down
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ ADD_LIBRARY (cometa STATIC
lib/src/KeyHandlers/SecureKeyHandler.cpp
lib/src/Providers/ProviderAdapter.cpp
lib/src/Providers/BlockfrostProvider.cpp
lib/src/TransactionBuilder/TransactionConversions.cpp
lib/src/TransactionBuilder/Fee.cpp
lib/src/TransactionBuilder/ScriptDataHash.cpp
lib/src/TransactionBuilder/Balancing/ImplicitCoin.cpp
lib/src/TransactionBuilder/Balancing/TransactionBalanceRequest.cpp
lib/src/TransactionBuilder/Balancing/TransactionBalancing.cpp
lib/src/TransactionBuilder/CoinSelectionRequest.cpp
lib/src/TransactionBuilder/CoinSelectorAdapter.cpp
lib/src/TransactionBuilder/LargeFirstCoinSelector.cpp
Expand Down Expand Up @@ -725,6 +731,8 @@ IF (COMETA_BUILD_TESTS)
lib/tests/Providers/BlockfrostProviderTest.cpp
lib/tests/TransactionBuilder/CoinSelectorAdapterTest.cpp
lib/tests/TransactionBuilder/TransactionEvaluatorAdapterTest.cpp
lib/tests/TransactionBuilder/GovernanceBuilderTest.cpp
lib/tests/TransactionBuilder/TransactionUtilitiesTest.cpp
lib/tests/TransactionBuilder/TransactionBuilderTest.cpp
lib/tests/TransactionBuilder/BuilderConformanceTest.cpp
lib/tests/TransactionBuilder/LifecycleConformanceTest.cpp
Expand Down Expand Up @@ -779,6 +787,12 @@ INSTALL (
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

INSTALL (
DIRECTORY "${cardano_source}/lib/include/cardano"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)

INSTALL (
FILES "${cardano_archive}"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cometa
Expand Down
27 changes: 22 additions & 5 deletions CODING_CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ Use separate access-label groups in this order, omitting groups that do not appl
3. Public static factories.
4. Public observers, modifiers, serialization, and swap.
5. Public assignment and comparison operators.
6. Private constructors used for internal ownership transfer.
7. Private helper methods.
8. Private data members.
6. Explicit native interoperability (adoption, borrowing, and release).
7. Private constructors used for internal ownership transfer.
8. Private helper methods.
9. Private data members.

Repeat `public:` and `private:` to separate those groups. Keep blank lines after
access labels and between documented declarations. Keep implementation order close
Expand All @@ -127,7 +128,15 @@ without meaningful copy semantics may be noncopyable.
Ordinary values use RAII and independent copy semantics; moves and swaps transfer
ownership without allocating. Native C references may be owned privately by these
RAII value classes. Temporary native allocations belong in scoped ownership guards.
Do not expose reference counting, disposal, or raw owning pointers in the public API.
Ordinary C++ operations must not require reference counting or disposal. Explicit
C interoperability is the exception: owning value wrappers provide `nativeHandle()`,
`release()`, and `adopt()` with documented borrowing and transfer contracts.
Reject null adoption; release leaves an empty object and returns null when already
empty. Provide const and mutable borrowed handles. Collections synchronize pending
iterator edits before borrowing or releasing, and mutable borrowing invalidates
C++ iterators and element references. These operations may throw when synchronization
is required. Resources retaining C++ callback state expose borrowing only unless
that state can safely accompany the native ownership transfer.
When a C getter returns a shared reference, clone it before exposing a mutable
value. Returning a named local by value may elide its copy; do not rely on that
return statement to make the result independent.
Expand All @@ -138,6 +147,13 @@ the successful result into its destination. Preserve cleanup on partial failures
and leave the destination unchanged when copy assignment fails. Shared helpers
should have narrow, descriptive names; keep them in private implementation files.

Use the explicit native interoperability API instead of friendship for native access.
Do not introduce stateless access classes or static-method containers solely to
bypass visibility.
Keep conversion functions private, name the values and conversion direction, and
make ownership explicit in their internal documentation. Retain classes for domain
objects, resource ownership, callback state, and other concrete responsibilities.

Use documented `ErrorCode` values and `Error` for operation failures instead of
requiring callers to interpret integers or include C headers. Keep each enum in
its own header. Verify C/C++ enum mappings in unit tests, rather than scattering
Expand Down Expand Up @@ -206,7 +222,8 @@ void setHash(const Blake2bHash& hash);
- Document only the declaration belonging to each comment; describe move behavior
on move operations, not in the class summary.
- Keep public documentation about observable behavior. Do not describe C handles,
reference counts, native storage, or cloning mechanisms in interface documentation.
reference counts, native storage, or cloning mechanisms in ordinary interface documentation.
Native interoperability methods must document pointer ownership, lifetime, and invalidation.
- Use `@remark` only for useful behavior guarantees and important limits.
- Distinguish owned return values from borrowed internal references. Describe
mutation and moved-from behavior accurately.
Expand Down
18 changes: 9 additions & 9 deletions doc/coverage/files.csv
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ lib/include/cardano/protocol_params/proposed_param_updates.h,public header,P12,i
lib/include/cardano/protocol_params/protocol_param_update.h,public header,P12,implemented,Optional parameter proposals with distinct ledger-null states and native CBOR fixtures.
lib/include/cardano/protocol_params/protocol_parameters.h,public header,P12,implemented,Cometa::ProtocolParameters
lib/include/cardano/protocol_params/update.h,public header,P12,implemented,Cometa::Update
lib/include/cardano/providers/provider.h,public header,P19,planned,idiomatic C++ API
lib/include/cardano/providers/provider.h,public header,P19,implemented,Typed C++ equivalent; see function ledger for mappings and tests.
lib/include/cardano/providers/provider_impl.h,public header,P19,implemented,Cometa::Provider callback adapter
lib/include/cardano/scripts/native_scripts/native_script.h,public header,P06.2,implemented,"Composite requirements; independent children; threshold equality; shared native script CBOR, inspection, and hash fixtures."
lib/include/cardano/scripts/native_scripts/native_script_list.h,public header,P06.2,implemented,"Composite requirements; independent children; threshold equality; shared native script CBOR, inspection, and hash fixtures."
Expand Down Expand Up @@ -188,10 +188,10 @@ lib/include/cardano/transaction_body/transaction_input_set.h,public header,P07,i
lib/include/cardano/transaction_body/transaction_output.h,public header,P07,implemented,Owned transaction values; optional datum/reference scripts; unsigned withdrawals; standard sequence aliases; shared output encodings.
lib/include/cardano/transaction_body/transaction_output_list.h,public header,P07,implemented,Owned transaction values; optional datum/reference scripts; unsigned withdrawals; standard sequence aliases; shared output encodings.
lib/include/cardano/transaction_body/value.h,public header,P04.2,implemented,"Signed asset values with checked arithmetic, independent components, and serialization."
lib/include/cardano/transaction_builder/balancing/deferred_redeemer_list.h,public header,P23,planned,domain container with standard C++ iteration/value semantics; audit specialized operations
lib/include/cardano/transaction_builder/balancing/implicit_coin.h,public header,P22,planned,idiomatic C++ API
lib/include/cardano/transaction_builder/balancing/input_to_redeemer_map.h,public header,P22,planned,domain container with standard C++ iteration/value semantics; audit specialized operations
lib/include/cardano/transaction_builder/balancing/transaction_balancing.h,public header,P22,planned,idiomatic C++ API
lib/include/cardano/transaction_builder/balancing/deferred_redeemer_list.h,public header,P23,internal,Private builder and balancing bookkeeping; callbacks use DeferredRedeemer.
lib/include/cardano/transaction_builder/balancing/implicit_coin.h,public header,P22,implemented,Typed C++ equivalent; see function ledger for mappings and tests.
lib/include/cardano/transaction_builder/balancing/input_to_redeemer_map.h,public header,P22,internal,Private builder and balancing bookkeeping; callbacks use DeferredRedeemer.
lib/include/cardano/transaction_builder/balancing/transaction_balancing.h,public header,P22,implemented,Typed C++ equivalent; see function ledger for mappings and tests.
lib/include/cardano/transaction_builder/coin_selection/coin_selection_request.h,public header,P20,implemented,Idiomatic C++ coin selection strategy.
lib/include/cardano/transaction_builder/coin_selection/coin_selection_strategy.h,public header,P20,implemented,Idiomatic C++ coin selection strategy.
lib/include/cardano/transaction_builder/coin_selection/coin_selector.h,public header,P20,implemented,Idiomatic C++ coin selection strategy.
Expand All @@ -202,10 +202,10 @@ lib/include/cardano/transaction_builder/evaluation/native_tx_evaluator.h,public
lib/include/cardano/transaction_builder/evaluation/provider_tx_evaluator.h,public header,P21,implemented,Idiomatic C++ evaluator interface and implementations.
lib/include/cardano/transaction_builder/evaluation/tx_evaluator.h,public header,P21,implemented,Idiomatic C++ evaluator interface and implementations.
lib/include/cardano/transaction_builder/evaluation/tx_evaluator_impl.h,public header,P21,internal,Private native callback bridge.
lib/include/cardano/transaction_builder/fee.h,public header,P22,planned,idiomatic C++ API
lib/include/cardano/transaction_builder/script_data_hash.h,public header,P22,planned,idiomatic C++ API
lib/include/cardano/transaction_builder/sub_transaction_builder.h,public header,P23,planned,idiomatic C++ API
lib/include/cardano/transaction_builder/transaction_builder.h,public header,P22,planned,idiomatic C++ API
lib/include/cardano/transaction_builder/fee.h,public header,P22,implemented,Typed C++ equivalent; see function ledger for mappings and tests.
lib/include/cardano/transaction_builder/script_data_hash.h,public header,P22,implemented,Typed C++ equivalent; see function ledger for mappings and tests.
lib/include/cardano/transaction_builder/sub_transaction_builder.h,public header,P23,implemented,Typed C++ equivalent; see function ledger for mappings and tests.
lib/include/cardano/transaction_builder/transaction_builder.h,public header,P22,implemented,Typed C++ equivalent; see function ledger for mappings and tests.
lib/include/cardano/typedefs.h,public header,P01a.1,internal,"C ABI, ownership, buffers and build metadata; map through C++ values and private support."
lib/include/cardano/uplc/uplc_apply_params.h,public header,P06.3,implemented,Versioned Plutus scripts; owned bytes; versioned hashes; shared parameter application fixtures and allocation failures.
lib/include/cardano/voting_procedures/governance_action_id_list.h,public header,P14,implemented,Cometa::GovernanceActionIdList
Expand Down
Loading
Loading