mirror of https://github.com/qortal/qortal
Qortal Core - Main Code Repository
Decentralized Data Network - Blockchain - TRUE Cross-Chain Trading - Application and Website Hosting - Much More - Qortal is the future internet infrastructure for the global digital world.
https://qortal.dev
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.2 KiB
57 lines
1.2 KiB
package test; |
|
|
|
import org.bitcoinj.script.Script; |
|
import org.bitcoinj.script.ScriptBuilder; |
|
import org.junit.Test; |
|
|
|
import com.google.common.hash.HashCode; |
|
|
|
import crosschain.BTC; |
|
|
|
public class BTCTests { |
|
|
|
@Test |
|
public void testWatchAddress() throws Exception { |
|
// String testAddress = "mrTDPdM15cFWJC4g223BXX5snicfVJBx6M"; |
|
String testAddress = "1GRENT17xMQe2ukPhwAeZU1TaUUon1Qc65"; |
|
|
|
long testStartTime = 1539000000L; |
|
|
|
BTC btc = BTC.getInstance(); |
|
|
|
btc.watch(testAddress, testStartTime); |
|
|
|
Thread.sleep(5000); |
|
|
|
btc.watch(testAddress, testStartTime); |
|
|
|
btc.shutdown(); |
|
} |
|
|
|
@Test |
|
public void testWatchScript() throws Exception { |
|
long testStartTime = 1539000000L; |
|
|
|
BTC btc = BTC.getInstance(); |
|
|
|
byte[] redeemScriptHash = HashCode.fromString("3dbcc35e69ebc449f616fa3eb3723dfad9cbb5b3").asBytes(); |
|
Script redeemScript = ScriptBuilder.createP2SHOutputScript(redeemScriptHash); |
|
redeemScript.setCreationTimeSeconds(testStartTime); |
|
|
|
// btc.watch(redeemScript); |
|
|
|
Thread.sleep(5000); |
|
|
|
// btc.watch(redeemScript); |
|
|
|
btc.shutdown(); |
|
} |
|
|
|
@Test |
|
public void updateCheckpoints() throws Exception { |
|
BTC btc = BTC.getInstance(); |
|
|
|
btc.updateCheckpoints(); |
|
} |
|
|
|
}
|
|
|