Commit Graph

260 Commits

Author SHA1 Message Date
736a71e9d1 container: root: test: unit: common: PluggablePath: add case for invalid characters 2026-01-05 13:06:54 -08:00
8bc6477c27 container: root: common: PluggablePath: add checks for invalid characters 2026-01-05 13:06:54 -08:00
d2ff942fa0 container: root: test: unit: common: PluggablePath: update/add case for invalid family 2026-01-05 13:06:54 -08:00
b775992d63 container: root: common: PluggablePath: expand parent path, refactor 2026-01-05 13:06:54 -08:00
c3d128ea62 container: root: test: benchmark/unit: add bitcoin plugin support
- Adds test cases and benchmark for bitcoin's RNG via `dfi`'s `Random`
  * Currently only supports one of bitcoin's RNG's (`FastRandomContext`)
2025-12-18 16:20:38 -08:00
0bf4c359b1 container: root: macro: add bitcoin plugin support
- Adds support to existing macros for bitcoin's RNG via `dfi`'s `Random`
  * Currently only supports one of bitcoin's RNG's (`FastRandomContext`)
2025-12-18 16:20:38 -08:00
2268ae8083 container: root: src: add bitcoin plugin support
- Adds bitcoin plugin support to `Random` specialization/implementation
  * Currently only supports one of bitcoin's RNG's (`FastRandomContext`)
2025-12-18 16:20:38 -08:00
8d6a796022 container: plugins: root: add bitcoin plugin
Utilizes `libbitcoinkernel` for symbols and headers but also pulls from
non-kernel headers as needed (since current kernel design is a WIP).

See the code documentation in this commit for details.
2025-12-18 16:20:38 -08:00
a609e4d936 container: plugins: root: update example plugin
`dfi` API headers must be managed on an as-needed basis.
2025-12-17 17:04:41 -08:00
a54c7f25a5 container: root: add getter for dfi's root path
Adds impl/test for getting absolute path to all `dfi`'s `root` code.
2025-12-17 17:04:40 -08:00
6f415bd847 container: root: remove loading dfi src API headers by default
Because of the nature of the interpreter, these headers should be
loaded/unloaded on an as-needed basis.

This commit is particularly useful for pluggables in that, if the
pluggable requires that the `dfi` API (or API-related implementations)
have certain preprocessor requisites fulfilled for the pluggable, the
API can now be compiled *after* the pluggable has been loaded but also
*before* the pluggable *requires* the use of the API (or API-related).

In other words, without this commit, a pluggable's `#define`s will be
useless *after* the API (or API-related implementations) is loaded and
compiled (at least not without an API reload, but that is not needed).

NOTE: this change does not affect `dfi`'s pluggable auto-(un|re)loading,
as the pluggable will have already been loaded prior to any other `dfi`
API compiling.
2025-12-17 17:04:34 -08:00
0c35fe1edd container: root: refactor scope for internal/common types
Avoid programmer/compiler confusion for internal/common types.
2025-12-17 16:38:52 -08:00
7b81970330 container: root: test: unit: add pluggable cases
Focuses on base pluggables, pluggable data types and functionality.
2025-12-16 17:13:06 -08:00
29574ca74d container: plugins: root: rewrite example plugin
- Reorganizes to utilize new pluggable framework
- Refactors, adds/updates documentation
2025-12-16 17:13:06 -08:00
8055a9494f container: root: new pluggable framework
- Implements pluggable auto-(un|re)loading
- Refactors, adds/updates documentation
2025-12-16 17:13:06 -08:00
7ca01776fc container: root: refactor using common utility 2025-12-09 15:09:51 -08:00
d156f62fa7 container: root: common: utility: refactor/add tests 2025-12-09 15:09:51 -08:00
ea20413107 container: root: common: utility: refactor/deprecate, add/enhance free functions
- Factors out (and deprecates) `Command`
- Deprecates certain free functions
- Adds better error handling
- Adds more free functions
- Refactors file handling
- Improves documentation

Notes on file loading (and general file handlers):

The interpreter command `.L` will load files but appears to not fail if
the file isn't source code or a library.

Calling `gSystem->Load()` will load a given library but not source file,
and appears to not accept paths (which will be needed for pluggables).

Because `gInterpreter->LoadFile("path")` will load either a source file
or library by given "path", and is consistent with `dfi`'s approach to
path handling, this function appears to be the winner (for now).
2025-12-09 15:09:51 -08:00
a84c404c5b container: root: internal: fix calling base CRTP template functions
ROOT 6.38.00 brings LLVM 20 which errors (or ROOT's Cling errors) when
calling certain base CRTP template functions without a `this` pointer.

Resolves:

  "error: call to non-static member function without an object argument"

NOTE: RandomImpl is not currently affected but is refactored for consistency.
2025-12-01 16:23:42 -08:00
8eb03f6d95 container: root: rootlogon: update the help process
- Less noisy, less intrusive, more helpful
- Will allow for isolating usage help on a per-namespace level
2025-11-21 17:32:38 -08:00
9fec1b427c container: root: change base path, related refactor
The base path is now *outside* of the macro directory; allowing for a
more integrated view of `dfi`'s entire `root` system. This is more
apparent once running an interactive session where the expectation is
(more intuitively) that any path should be relative to 'src/root' and
not 'src/root/macro'.

The rationale for why this was in 'src/root/macro' to begin with stems
from how `root` (by default) will automatically load rootlogon.C in the
directory that `root` is started. This is causing more confusion than
not because `dfi`'s usage of `root` is not limited to macros.

These changes skirt the line between needing a major API bump and not
but, so far, appears to be on the side of *not*. However, the TODOs
noted for macro loading should be addressed prior to any API changes.
2025-11-21 17:32:25 -08:00
273f2cef49 container: root: internal: update TODO re: c++23 2025-11-21 11:28:14 -08:00
9faebb6cea container: plugins: root: fix example3()'s usage of throw handler
The old macros should *not* have been used in any example; as they
were intended for internal use only.

This was noted in Doxygen ...by not noting them as publicly consumable.
2025-11-21 11:15:58 -08:00
ca59169116 container: root: rewrite throw handler, refactor using common types
- Refactor using common types that were once internal
- Removes ancient macro approaches to C++20 solutions
- Changes `Exception` message type to use std::string
  * std::string_view isn't worthwhile in this context
2025-11-21 11:15:58 -08:00
fa91fd02e8 container: root: factor out internal types to common
These types and handlers are too generic to be kept internal only.

They can now be used across all root macros, plugins and overall API.
2025-11-20 17:44:32 -08:00
cf68f02d2f container: root: test: utility: add tests for common 2025-11-19 13:23:52 -08:00
0d4b293b2d client/container: root: refactor common namespace
- Factor out respective common from macro and apply to all scopes
  * `dfi::common`
  * `dfi::macro::common`
  * `dfi::plugin::common`

- Add deprecation warnings in `dfi::macro::common`
  * Common functionality (not macro specific) is now in `dfi::common`

- Add convenience wrappers to inner common impl, where appropriate
  * Allows for backwards compatibility

- Add/update/clarify code docs and Doxygen definitions

- Related refactoring

NOTE: all changes are backward compatible (no need to bump major).
2025-11-19 13:23:52 -08:00
8c76e7cc11 container: root: macro: common: throw if invalid loading path
- Fixes silent failure when attempting to load non-existent/invalid path
- Applies to any macro, plugin or path that's loaded through this class
2025-11-14 13:19:09 -08:00
8b59cee84c client/container: root: migrate to Botan3
- This is possible now that `dfi`'s ROOT build supports C++20
- No internal `dfi` API or impl changes are necessary
  * This includes any Botan signatures
2025-11-07 13:13:53 -08:00
249e2ca77a container: hledger-flow: electrum: add mockup w/ lightning 2025-10-29 15:54:44 -07:00
d684f370ff container: hledger-flow: electrum: add lightning, backwards compat
*WARNING*: lightning support is a WIP due to an unresolved electrum
lightning history bug (see docker-finance #227).

This commit is needed for backwards compatibility, as the new electrum
format will break import - even if lightning is never used.
2025-10-29 15:54:44 -07:00
0266157abe client/container: usage help updates 2025-10-28 12:13:10 -07:00
da40a93ae1 container: lib_taxes: don't attempt to patch non-existent taxable events
An optimization and printing cleanup (attempts to patch won't break)
2025-10-28 12:09:57 -07:00
960e51fe0a container: lib_taxes: fix printing for 'all' years 2025-10-28 12:09:57 -07:00
e9960461b7 container: lib_taxes: fix arg parsing for 'all' years
Impl was not able to process 'all' years because global_arg_year was set
2025-10-28 12:09:57 -07:00
9735317ae8 container: plugins: root: fix example3()'s shell
The spawned shell needs its sourced environment and aliases.

Resolves:

  sh: line 1: dfi: command not found
  Error in <TRint::HandleTermInput()>: std::runtime_error caught:
          FILE = "/home/business/docker-finance/plugins/root/example.cc"
          LINE = 125
          WHAT = "command failed"
2025-10-22 16:01:05 -07:00
aaf3c21b7d container: hledger-flow: ethereum-based: compound: add internal swapping
when supplying/withdrawing.
2025-10-15 10:32:32 -07:00
e3f50ddb72 container: hledger-flow: vultr: add credits support
- Fixes direction to allow for credits issued by Vultr for N instances
- Updates documentation, adds where to put invoices to catch Sales Tax
2025-10-09 12:41:31 -07:00
aac3f780f9 Merge pull request #223 into master
5fb1d6f container: lib_reports: bump Copyright year (Aaron Fiore)
2025-10-03 14:17:50 -07:00
5fb1d6f2b0 container: lib_reports: bump Copyright year 2025-10-03 14:16:13 -07:00
3383b5c73f container: migrate from xsv to xan
`xsv` is no longer maintained and the author recommends `xan` instead.

Fortunately, `xan` is very suitable for our use-case; is very efficient,
and produces no differences in our expected output.
2025-10-03 14:09:34 -07:00
2f293ed566 container: lib_taxes: run linter 2025-10-02 17:19:21 -07:00
66c34a4b1c container: lib_taxes: optimize writes by forking
- Decreases real time in multicore container environments.
  * Given the nature of the writer, there should be no race conditions.
2025-10-02 17:09:48 -07:00
bf3a4e36e6 container: lib_reports: optimize writes by forking
- Decreases real time in multicore container environments.
  * Given the nature of the writer, there should be no race conditions.
2025-10-02 17:09:17 -07:00
3a35e45ffa container: hledger-flow: add explicit amount4 to applicable rules
For rule consistency. Does not affect balances or other functionality.
2025-09-19 12:55:47 -07:00
d83d9835da container: root: macro: Hash: change output to CSV format
The output can now be used with container's CSV tools.
2025-09-19 10:48:01 -07:00
c604ca8e39 container: root: macro: Random: change output to CSV format
The output can now be used with container's CSV tools.
2025-09-19 10:18:36 -07:00
c68a6680ef container: finance: completion: add 'help' to plugins 2025-09-04 15:08:20 -07:00
c3364511b0 container: finance: lib_plugins: update usage help
- Clarify usage, add examples, note plugin support type
  * finance's `plugins` only supports shell-based plugins
    - To use `root` plugins, use `root` command (see `root help`)
2025-09-04 15:08:20 -07:00
745a16e086 container: finance: completion: add root 2025-09-04 15:08:20 -07:00