Since `go1.18` the runtime has a package that provides information about module
versions, version control information, and build flags embedded in executable
files built by the go command.
The new packages allows us to get information needed by the `version` command
without having to rely on `ldflags` set at build time.
This can be really helpful while debugging errors from people using custom
binaries. For example a build from master.
This commit sends the returned value of pred() inside a goroutine such
that when a predicate function never returns during the first run, the
wait package can timeout properly.
This commit adds a new component, `HarnessTest`, as a test manager, which
is responsible for managing the state change in the itest. It is built
on top of `HarnessNode` and will be handling assertions so that a test
can be created without unnecessary attention to node's unwanted
failures. This commit also adds a minimal set of assertions.
This commit adds a new struct, `nodeManager`, to manage running nodes.
It keeps track of the running nodes, and manages the start and stop of
the nodes with the context of `HarnessTest`.
This commit adds several helper functions and a fee service. Note that
the fee service is identical to what's inside `lntest`. Once the
migration is done, the old file will be removed.
This commit adds a new struct, `HarnessNode`, to manage the lnd process
used in our itest. This struct is built upon `HarnessRPC`, `State`, and
`NodeWatcher`.
This commit adds a new struct, `nodeWatcher`, to keep track of all graph
topology updates of a given node, including updates from channel edges,
policies, and peers.
This commit adds a new package `lntemp/node` and inside it a new struct
`State` is added to track the internal node state. This enables us using
the same running nodes accross tests without wrong uncleaned states.
This commit starts the construction of the new package `lntemp`. This
package serves as the scaffolding while we migrate our old itest into
the new one. Once the migration is finished, the package will be put
back to `lntest`.
This commit adds a new flag `temptest` so we can run new and old tests
separately. This flag will be removed once the migration from old tests
to new tests is finished.
mockChainBackend simulates a chain backend and
tracks the number of calls via a private property
called chainCallCount. This commit uses a write
mutex instead of read mutex in the call to GetBlock,
adds a getter method to access chainCallCount
with a read mutex and uses a write mutex in
resetChainCallCount.
In this commit, the new ListClientSession functional options and new
FetchSessionCommittedUpdates function are utilised in order to allow us
to completely remove the CommittedUpdates member from the ClientSession
struct.
With this commit we fix a few occurrences of loop variables being
accessed in closures.
While we touch the code, we also migrate it to using the require
library.
In this commit, a new tower client db function is added that can be used
to fetch all the committed updates for a given session ID. This is done
in preparation for an upcoming commit where the CommittedUpdates will be
removed from the ClientSession struct.
In this commit, we start making use of the new ListClientSession
functional options added in the previous commit. We use the functional
options in order to calculate the max commit heights per channel on the
construction of the tower client. We also use the options to count the
total number of acked and committed updates. With this commit, we are
also able to completely remove the AckedUpdates member of the
ClientSession since it is no longer used anywhere in the code.
This commit adds functional options to the ListClientSessions call that
can be used to perform a variety of extra operations during the DB
query. These functional options are not yet used in this commit.