From 0fb3736530fb975627292d0f4b93adddf113a7d0 Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Fri, 7 Jul 2023 10:54:29 -0700 Subject: [PATCH 1/2] Verbose logging for Issue #229 * logging.properties: increase verbosity in 3 packages * OmniClient.java: log results of omniGetBalance calls --- .../src/main/java/foundation/omni/rpc/OmniClient.java | 4 +++- omnij-rpc/src/integ/logging.properties | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/omnij-jsonrpc/src/main/java/foundation/omni/rpc/OmniClient.java b/omnij-jsonrpc/src/main/java/foundation/omni/rpc/OmniClient.java index 67c94ed2..8a247b45 100644 --- a/omnij-jsonrpc/src/main/java/foundation/omni/rpc/OmniClient.java +++ b/omnij-jsonrpc/src/main/java/foundation/omni/rpc/OmniClient.java @@ -206,7 +206,9 @@ public List> omniGetActiveDExSells() throws JsonRpcException */ public BalanceEntry omniGetBalance(Address address, CurrencyID currency) throws JsonRpcException, IOException { - return send("omni_getbalance", BalanceEntry.class, address, currency.getValue()); + var result = send("omni_getbalance", BalanceEntry.class, address, currency.getValue()); + log.info("omni_getbalance result for {}, {}: {}", address, currency, result); + return result; } /** diff --git a/omnij-rpc/src/integ/logging.properties b/omnij-rpc/src/integ/logging.properties index 2dd2a5d2..97044d2e 100644 --- a/omnij-rpc/src/integ/logging.properties +++ b/omnij-rpc/src/integ/logging.properties @@ -11,3 +11,7 @@ org.consensusj.jsonrpc.level=WARNING # Set bitcoinj log level to WARNING to avoid "Creating bitcoinj 0.14.3 context" INFO message org.bitcoinj.core.level=WARNING +foundation.omni.rpc=FINEST + +foundation.omni.test=FINEST +foundation.omni.test.rpc.sto=FINEST From bb136712ce84ffbcff04bdadd3a5d84cb737c8c2 Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Sat, 8 Jul 2023 17:09:38 -0700 Subject: [PATCH 2/2] SendToOwnersTestPlanSpec: add more asserts of actorAddress OMNI balance --- .../omni/test/rpc/sto/SendToOwnersTestPlanSpec.groovy | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/sto/SendToOwnersTestPlanSpec.groovy b/omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/sto/SendToOwnersTestPlanSpec.groovy index abdf40a9..e29509cf 100644 --- a/omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/sto/SendToOwnersTestPlanSpec.groovy +++ b/omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/sto/SendToOwnersTestPlanSpec.groovy @@ -55,13 +55,24 @@ class SendToOwnersTestPlanSpec extends BaseRegTestSpec { def startMSC = OmniDivisibleValue.of(mscAvailable + mscReserved) def actorAddress = createFundedAddress(startBTC, startMSC, false) def currencyMSC = CurrencyID.of(ecosystem.value()) + + assertBalance(actorAddress, currencyMSC, startMSC, 0.divisible) + def currencySPT = getStoProperty(actorAddress, data) + if (currencySPT != CurrencyID.OMNI && currencySPT != CurrencyID.TOMNI) { + assertBalance(actorAddress, currencyMSC, startMSC, 0.divisible) + } + // Create a DEx offer to reserve an amount if (mscReserved > 0) { reserveAmountMSC(actorAddress, currencyMSC, mscReserved.divisible) } + if (currencySPT != CurrencyID.OMNI && currencySPT != CurrencyID.TOMNI) { + assertBalance(actorAddress, currencyMSC, mscAvailable, mscReserved) + } + when: "the owners are funded" def ownerIds = 0..