Permalink
Browse files

Update for generate() API changes in Bitcoin Core/bitcoinj-addons

* replace generateBlock() with generate()
  • Loading branch information...
msgilligan committed Dec 9, 2016
1 parent bc0811a commit ddda1a585271e1c6a48bcfb79425a9532791776d
Showing with 167 additions and 172 deletions.
  1. +1 −1 README.adoc
  2. +2 −2 adoc/regtest-intro.adoc
  3. +8 −8 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/activation/AllPairDExActivationSpec.groovy
  4. +3 −3 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/activation/BaseActivationSpec.groovy
  5. +3 −3 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/activation/GracePeriodSpec.groovy
  6. +8 −8 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/activation/MetaDExActivationSpec.groovy
  7. +2 −2 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/activation/MetaDExFeesActivationSpec.groovy
  8. +6 −6 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/activation/OverOfferDeactivationSpec.groovy
  9. +2 −2 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/basic/SendRawTransactionSpec.groovy
  10. +1 −1 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/basic/SimpleSendSpec.groovy
  11. +8 −8 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/crowdsale/CloseCrowdsaleSpec.groovy
  12. +9 −9 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/crowdsale/CrowdsaleParticipationSpec.groovy
  13. +13 −13 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/dex/DexSpec.groovy
  14. +4 −4 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/dex/DexVersionsSpec.groovy
  15. +4 −4 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/exodus/MoneyManSpec.groovy
  16. +17 −17 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/mdex/MetaDexSpec.groovy
  17. +8 −8 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/misc/ClientConfigurationAndFundingSpec.groovy
  18. +1 −1 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/reorgs/BaseReorgSpec.groovy
  19. +3 −3 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/reorgs/PropertyCreationReorgSpec.groovy
  20. +8 −8 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/reorgs/SendToOwnersReorgSpec.groovy
  21. +3 −3 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/reorgs/SimpleSendReorgSpec.groovy
  22. +5 −5 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/sendall/SendAllSpec.groovy
  23. +15 −15 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/smartproperty/ManagedPropertySpec.groovy
  24. +2 −2 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/smartproperty/SmartPropertySpec.groovy
  25. +8 −8 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/sto/SendToManyOwnersSpec.groovy
  26. +2 −2 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/sto/SendToOwnersSpec.groovy
  27. +12 −12 omnij-rpc/src/integ/groovy/foundation/omni/test/rpc/sto/SendToOwnersTestPlanSpec.groovy
  28. +2 −2 omnij-rpc/src/integ/groovy/foundation/omni/test/tx/OmniTxBuilderIntegSpec.groovy
  29. +2 −7 omnij-rpc/src/main/groovy/foundation/omni/rpc/OmniCLIClient.groovy
  30. +3 −3 omnij-rpc/src/main/groovy/foundation/omni/test/OmniTestSupport.groovy
  31. +2 −2 src/scripts/regtest-send-many.sh
@@ -193,7 +193,7 @@ These sample Spock "feature tests" are from the file https://github.com/OmniLaye
"Test Subcategory", "ManagedTokens",
"http://www.omnilayer.org",
"This is a test for managed properties")
generateBlock()
generate()
def creationTx = omniGetTransaction(creationTxid)
currencyID = new CurrencyID(creationTx.propertyid as Long)
@@ -4,11 +4,11 @@ Bitcoin 0.9 and later include support for Regression Test Mode (aka RegTest mode

For example the following command will generate 101 blocks

./bitcoin-cli -regtest setgenerate true 101
./bitcoin-cli -regtest generate 101

And yes, you get the newly mined coins. They can't be spent anywhere, but they're great for testing.

The best documentation of RegTest mode that I've seen so far is https://bitcoinj.github.io/testing[How to test applications] on the new https://bitcoinj.github.io[Bitcoinj website].
The best documentation of RegTest mode that I've seen so far is https://bitcoinj.github.io/testing[How to test applications] on the new https://bitcoinj.github.io[bitcoinj website].


Other Links::
@@ -38,7 +38,7 @@ class AllPairDExActivationSpec extends BaseActivationSpec {
def "Creating trades involving two non-Omni pairs before the activation is invalid"() {
when:
def txid = omniSendTrade(actorAddress, tokenA, 445.indivisible, tokenB, 20.indivisible)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == false
@@ -54,7 +54,7 @@ class AllPairDExActivationSpec extends BaseActivationSpec {

when:
def txid = omniSendActivation(actorAddress, allPairDExFeatureId, activationBlock, minClientVersion)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid
@@ -80,7 +80,7 @@ class AllPairDExActivationSpec extends BaseActivationSpec {
def "Creating trades involving non-Omni tokens during the grace period is still invalid"() {
when:
def txid = omniSendTrade(actorAddress, tokenA, 445.indivisible, tokenB, 20.indivisible)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == false
@@ -93,7 +93,7 @@ class AllPairDExActivationSpec extends BaseActivationSpec {
def "After the successful activation of the feature, the feature activation completed"() {
setup:
while (getBlockCount() < activationBlock) {
generateBlock()
generate()
}

when:
@@ -123,7 +123,7 @@ class AllPairDExActivationSpec extends BaseActivationSpec {

when:
def tradeTxid = omniSendTrade(actorAddress, tokenA, amountForSale, tokenB, amountDesired)
generateBlock()
generate()

then:
omniGetTransaction(tradeTxid).valid
@@ -146,7 +146,7 @@ class AllPairDExActivationSpec extends BaseActivationSpec {

when:
def cancelTxid = omniSendCancelTradesByPrice(actorAddress, tokenA, amountForSale, tokenB, amountDesired)
generateBlock()
generate()

then:
omniGetTransaction(cancelTxid).valid
@@ -183,7 +183,7 @@ class AllPairDExActivationSpec extends BaseActivationSpec {

when: "trader A offers SPX and desired SPY"
def txidOfferA = omniSendTrade(traderA, propertySPX, amountSPX, propertySPY, amountSPY)
generateBlock()
generate()

then: "it is a valid open order"
omniGetTrade(txidOfferA).valid
@@ -201,7 +201,7 @@ class AllPairDExActivationSpec extends BaseActivationSpec {

when: "trader B offers SPY and desires SPX"
def txidOfferB = omniSendTrade(traderB, propertySPY, amountSPY, propertySPX, amountSPX)
generateBlock()
generate()

then: "the order is filled"
omniGetTrade(txidOfferB).valid
@@ -48,7 +48,7 @@ abstract class BaseActivationSpec extends BaseRegTestSpec {
throw new AssumptionViolatedException('The client has no "omni_getactivations" command')
}

generateBlock()
generate()
def currentBlockCount = getBlockCount()
initialBlock = getBlockHash(currentBlockCount)
}
@@ -58,11 +58,11 @@ abstract class BaseActivationSpec extends BaseRegTestSpec {
return
}
for (int i = 0; i < 50; ++i) {
generateBlock()
generate()
}
invalidateBlock(initialBlock)
clearMemPool()
generateBlock()
generate()
}

def skipIfActivated(def featureId) {
@@ -24,7 +24,7 @@ class GracePeriodSpec extends BaseActivationSpec {

when:
def txid = omniSendActivation(actorAddress, unallocatedFeatureId, activationBlock, minClientVersion)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == false
@@ -41,7 +41,7 @@ class GracePeriodSpec extends BaseActivationSpec {

when:
def txid = omniSendActivation(actorAddress, unallocatedFeatureId, activationBlock, minClientVersion)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == false
@@ -58,7 +58,7 @@ class GracePeriodSpec extends BaseActivationSpec {

when:
def txid = omniSendActivation(actorAddress, unallocatedFeatureId, activationBlock, minClientVersion)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == true
@@ -43,7 +43,7 @@ class MetaDExActivationSpec extends BaseActivationSpec {

when:
def tradeTxid = omniSendTrade(actorAddress, testID, amountForSale, CurrencyID.TOMNI, amountDesired)
generateBlock()
generate()

then:
omniGetTransaction(tradeTxid).valid
@@ -66,7 +66,7 @@ class MetaDExActivationSpec extends BaseActivationSpec {

when:
def cancelTxid = omniSendCancelAllTrades(actorAddress, Ecosystem.TOMNI)
generateBlock()
generate()

then:
omniGetTrade(cancelTxid).valid
@@ -86,7 +86,7 @@ class MetaDExActivationSpec extends BaseActivationSpec {
def "Creating trades involving main ecosystem tokens before the activation is invalid"() {
when:
def txid = omniSendTrade(actorAddress, mainID, 5.divisible, CurrencyID.OMNI, 2.divisible)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == false
@@ -102,7 +102,7 @@ class MetaDExActivationSpec extends BaseActivationSpec {

when:
def txid = omniSendActivation(actorAddress, metaDExFeatureId, activationBlock, minClientVersion)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid
@@ -128,7 +128,7 @@ class MetaDExActivationSpec extends BaseActivationSpec {
def "Creating trades involving main ecosystem tokens during the grace period is still invalid"() {
when:
def txid = omniSendTrade(actorAddress, CurrencyID.OMNI, startMSC, mainID, 25.divisible)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == false
@@ -141,7 +141,7 @@ class MetaDExActivationSpec extends BaseActivationSpec {
def "After the successful activation of the feature, the feature activation completed"() {
setup:
while (getBlockCount() < activationBlock) {
generateBlock()
generate()
}

when:
@@ -171,7 +171,7 @@ class MetaDExActivationSpec extends BaseActivationSpec {

when:
def tradeTxid = omniSendTrade(actorAddress, CurrencyID.OMNI, amountForSale, mainID, amountDesired)
generateBlock()
generate()

then:
omniGetTransaction(tradeTxid).valid
@@ -194,7 +194,7 @@ class MetaDExActivationSpec extends BaseActivationSpec {

when:
def cancelTxid = omniSendCancelTradesByPrice(actorAddress, CurrencyID.OMNI, amountForSale, mainID, amountDesired)
generateBlock()
generate()

then:
omniGetTransaction(cancelTxid).valid
@@ -35,7 +35,7 @@ class MetaDExFeesActivationSpec extends BaseActivationSpec {

when:
def txid = omniSendActivation(actorAddress, metaDExFeesFeatureId, activationBlock, minClientVersion)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid
@@ -61,7 +61,7 @@ class MetaDExFeesActivationSpec extends BaseActivationSpec {
def "After the successful activation of the feature, the feature activation completed"() {
setup:
while (getBlockCount() < activationBlock) {
generateBlock()
generate()
}

when:
@@ -36,7 +36,7 @@ class OverOfferDeactivationSpec extends BaseActivationSpec {
when:
def txid = createDexSellOffer(
actorAddress, CurrencyID.OMNI, orderAmountMSC, orderAmountBTC, stdBlockSpan, stdCommitFee, actionNew)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid
@@ -55,7 +55,7 @@ class OverOfferDeactivationSpec extends BaseActivationSpec {

when:
def txid = omniSendActivation(actorAddress, overOffersFeatureId, activationBlock, minClientVersion)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid
@@ -70,13 +70,13 @@ class OverOfferDeactivationSpec extends BaseActivationSpec {
def blockBeforeActivation = activationBlock - 1

while (getBlockCount() < blockBeforeActivation - 1) { // two extra, for transaction confirmation
generateBlock()
generate()
}

when:
def txid = createDexSellOffer(
actorAddress, CurrencyID.OMNI, orderAmountMSC, orderAmountBTC, stdBlockSpan, stdCommitFee, actionNew)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid
@@ -98,7 +98,7 @@ class OverOfferDeactivationSpec extends BaseActivationSpec {
when:
def txid = createDexSellOffer(
actorAddress, CurrencyID.OMNI, orderAmountMSC, orderAmountBTC, stdBlockSpan, stdCommitFee, actionNew)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == false
@@ -118,7 +118,7 @@ class OverOfferDeactivationSpec extends BaseActivationSpec {
when:
def txid = createDexSellOffer(
actorAddress, CurrencyID.OMNI, orderAmountMSC, orderAmountBTC, stdBlockSpan, stdCommitFee, actionNew)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid
@@ -29,7 +29,7 @@ class SendRawTransactionSpec extends BaseRegTestSpec {
def txid = client.omniSendRawTx(activeAddress, rawTxHex, passiveAddress)

and: "a new block is mined"
client.generateBlock()
client.generate()

then: "the transaction confirms"
def transaction = client.omniGetTransaction(txid)
@@ -54,7 +54,7 @@ class SendRawTransactionSpec extends BaseRegTestSpec {
def txid = client.omniSendRawTx(activeAddress, rawTxHex)

and: "a new block is mined"
client.generateBlock()
client.generate()

then: "the transaction confirmed"
def transaction = client.omniGetTransaction(txid)
@@ -28,7 +28,7 @@ class SimpleSendSpec extends BaseRegTestSpec {
omniSend(faucetAddress, toAddress, OMNI, amount)

and: "a block is generated"
generateBlock()
generate()
def endBalance = omniGetBalance(faucetAddress, OMNI).balance

then: "the toAddress has the correct OMNI balance and source address is reduced by right amount"
@@ -23,7 +23,7 @@ class CloseCrowdsaleSpec extends BaseRegTestSpec {

def txid = createCrowdsale(actorAddress, Ecosystem.TOMNI, PropertyType.DIVISIBLE, CurrencyID.TOMNI, 500000000L,
2147483648L, 0 as Byte, 0 as Byte)
generateBlock()
generate()
def creationTx = omniGetTransaction(txid)
assert (creationTx.valid)
currencyID = new CurrencyID(creationTx.propertyid as Long)
@@ -33,7 +33,7 @@ class CloseCrowdsaleSpec extends BaseRegTestSpec {
def "Closing a non-existing crowdsale is invalid"() {
when:
def txid = closeCrowdsale(actorAddress, new CurrencyID(CurrencyID.MAX_REAL_ECOSYSTEM_VALUE))
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == false
@@ -42,7 +42,7 @@ class CloseCrowdsaleSpec extends BaseRegTestSpec {
def "Closing a non-crowdsale is invalid"() {
when:
def txid = closeCrowdsale(actorAddress, nonCrowdsaleID)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == false
@@ -51,7 +51,7 @@ class CloseCrowdsaleSpec extends BaseRegTestSpec {
def "A crowdsale can not be closed by a non-issuer"() {
when:
def txid = closeCrowdsale(otherAddress, currencyID)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == false
@@ -63,7 +63,7 @@ class CloseCrowdsaleSpec extends BaseRegTestSpec {
def "Before closing a crowdsale, tokens can be purchased"() {
when:
def txid = omniSend(otherAddress, actorAddress, CurrencyID.TOMNI, 0.5.divisible)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid
@@ -80,7 +80,7 @@ class CloseCrowdsaleSpec extends BaseRegTestSpec {
def "A crowdsale can be closed with transaction type 53"() {
when:
def txid = closeCrowdsale(actorAddress, currencyID)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid
@@ -92,7 +92,7 @@ class CloseCrowdsaleSpec extends BaseRegTestSpec {
def "A crowdsale can only be closed once"() {
when:
def txid = closeCrowdsale(actorAddress, currencyID)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid == false
@@ -101,7 +101,7 @@ class CloseCrowdsaleSpec extends BaseRegTestSpec {
def "Sending tokens, after a crowdsale was closed, does not grant tokens"() {
when:
def txid = omniSend(otherAddress, actorAddress, CurrencyID.TOMNI, 0.5.divisible)
generateBlock()
generate()

then:
omniGetTransaction(txid).valid
Oops, something went wrong.

0 comments on commit ddda1a5

Please sign in to comment.