From 0fb3736530fb975627292d0f4b93adddf113a7d0 Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Fri, 7 Jul 2023 10:54:29 -0700 Subject: [PATCH 1/3] 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/3] 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.. Date: Tue, 11 Jul 2023 12:26:38 -0700 Subject: [PATCH 3/3] test-omni-integ-regtest.sh: run '*SendToOwnersTestPlan*' only (and run activation tests first, of course) --- test-omni-integ-regtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-omni-integ-regtest.sh b/test-omni-integ-regtest.sh index c7085c58..7a6f2012 100755 --- a/test-omni-integ-regtest.sh +++ b/test-omni-integ-regtest.sh @@ -37,7 +37,7 @@ BTCPID=$! # Run integration tests echo "Running Omni RPC integration tests in RegTest mode..." -./gradlew clean regTest --scan --stacktrace +./gradlew clean omnij-rpc:activationRegTest omnij-rpc:regTest --tests '*SendToOwnersTestPlan*' --scan --stacktrace GRADLESTATUS=$? exit $GRADLESTATUS