Revise backup loop tests to not rely on time.Sleep anymore and remove
unused fields from them.
Removed 3ns TTL from tpreader test dataDB configuration that caused in-
consistent results.
Ensure connManager cache is reloaded in filter tests. Before they could
cause deadlocks.
Remove redundant inits, global vars and setup tests for debit and
accounts tests.
Optimize some analyzers tests.
-update cached filter indexes count
-add the flaky constraint to a couple more tests
-fix unstable cores integration test
-fix unstable filterindexes integration test
Constructor looks inside the params' balance map for the Factors key.
It expects either a string representing a JSON serialized map or the
map itself.
BalanceFilter Clone function has been updated to set a deep copy of
the original Factors map instead of a shallow one.
BalanceFilter getter function for Factors now returns nil instead of
an empty map. It's slightly more memory efficient and assignment to
this map will not be attempted, so it's panic proof.
BalanceFilter.ModifyBalance now updates Factors only if the key is
found in the request params' Balance map. Setting Factors to null is also
possible as long as the Factors key exists and is set to null.
Note: only *set_balance can overwrite the Factors map, all the others
can only set it if the balance does exist prior to sending the request.
Update balance integration tests.
The rpcclient constructor could not see the centralized
Encoding flag because it didn't have the necessary build
constraints. Added the constraints in lib_test.go files
where it wasn't alone. In all the other cases, it was
moved to the first file where it was needed.
Only for agents/ers tests. Done to prevent cyclic imports when
adding ers APIs to apier package.
In case of v2.AttrSetAccount, use a literal struct instead.
Applies to both file readers and loader (for loader, the blank statement
was used anyway).
It's redundant because for file readers, the rdr.dir value was always
passed as the parameter when it was already part of the method's object.
Parameter had to also be removed from the WatchDir function and the
functions it depends on.
Retrieve the Accounting BalanceCharge inside a new variable and reuse
that instead of repeatedly indexing the map. It is always assumed that
the BalanceCharge exists in the map and is non-nil. A comment was
added as a reminder.
TotalCost cannot be calculated anymore from ChargingIncrement alone.
The function is not used, so it will not be causing any issues for
now.
BalanceCharge clone function now handles the case where it is nil
to avoid any possible nil pointer dereference.
TestBalanceFactor will now test refunding to mixed balanced types.
A sleep of 10ms is called before initial acc retrieval to wait for
tps to finish loading.
Factor will be computed only once at the start of the function, instead
of doing it on every Increments iteration.
'amount' variable will be updated and rounded only when the computed
balances factor is different from its default value (1).