Search in sources :

Example 1 with Tangle

use of com.iota.iri.storage.Tangle in project iri by iotaledger.

the class BundleValidatorTest method isInconsistent.

@Test
public void isInconsistent() throws Exception {
    String[] trytes = { "999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999CFDEZBLZQYA9999999999999999999999999999999999999999999ZZWQHWD99C99999999C99999999CKWWDBWSCLMQULCTAAJGXDEMFJXPMGMAQIHDGHRBGEMUYNNCOK9YPHKEEFLFCZUSPMCJHAKLCIBQSGWAS999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999", "999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999ZZWQHWD99B99999999C99999999CKWWDBWSCLMQULCTAAJGXDEMFJXPMGMAQIHDGHRBGEMUYNNCOK9YPHKEEFLFCZUSPMCJHAKLCIBQSGWAS999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999", "999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999VUWVAYOAJBZ9999999999999999999999999999999999999999999ZZWQHWD99A99999999C99999999CKWWDBWSCLMQULCTAAJGXDEMFJXPMGMAQIHDGHRBGEMUYNNCOK9YPHKEEFLFCZUSPMCJHAKLCIBQSGWAS999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999", "999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999FPHIWXZWXNFVHFOUKSIAKQIEQCFGQRJLWXHOLAQV9ALVRMAXQSASTPWAAVAKHHLRLXFGGIUYQDVRUHHRQB99999999999999999999999999999999999999999999999999999ZZWQHWD99999999999C99999999CKWWDBWSCLMQULCTAAJGXDEMFJXPMGMAQIHDGHRBGEMUYNNCOK9YPHKEEFLFCZUSPMCJHAKLCIBQSGWAS999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999" };
    List<TransactionViewModel> transactions = Arrays.stream(trytes).map(Converter::allocatingTritsFromTrytes).map(t -> new TransactionViewModel(t, Hash.calculate(SpongeFactory.Mode.CURLP81, t))).map(t -> {
        try {
            t.store(tangle);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return t;
    }).collect(Collectors.toList());
// Assert.assertFalse(BundleValidator.isInconsistent(transactions, false));
// Assert.assertFalse(BundleValidator.isInconsistent(transactions, true));
}
Also used : AfterClass(org.junit.AfterClass) Arrays(java.util.Arrays) Tangle(com.iota.iri.storage.Tangle) BeforeClass(org.junit.BeforeClass) RocksDBPersistenceProvider(com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider) Test(org.junit.Test) Hash(com.iota.iri.model.Hash) Collectors(java.util.stream.Collectors) List(java.util.List) SpongeFactory(com.iota.iri.hash.SpongeFactory) Converter(com.iota.iri.utils.Converter) TransactionViewModel(com.iota.iri.controllers.TransactionViewModel) TemporaryFolder(org.junit.rules.TemporaryFolder) TransactionViewModel(com.iota.iri.controllers.TransactionViewModel) Test(org.junit.Test)

Example 2 with Tangle

use of com.iota.iri.storage.Tangle in project iri by iotaledger.

the class BundleValidatorTest method validateAll9s.

@Test
public void validateAll9s() throws Exception {
    String[] trytes = { "999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999XIJLRVTWOHCLAHVDWBJKESBMYK9LSEVZWWPXKMPTJJGIMRGLLBPR9WKORVCANWVQY9NKRGGYDMKF99999VKSMFDJWZJLVMYUOWAHEVGVK9CIMSYQ99PVAQFVZGVSTRIAQEOJLUDHOWSJKZVVEBTCLDMMEHVEIX9999ZXYZDVQSXGJEXRHKSVVDGIRYQFMJTBBJLPNVSOWQEFB9QXV9ALVUIUJRMKWEANEOK9LQ9HNMWFNJXGOWX" };
    List<TransactionViewModel> transactions = Arrays.stream(trytes).map(Converter::allocatingTritsFromTrytes).map(t -> new TransactionViewModel(t, Hash.calculate(SpongeFactory.Mode.CURLP81, t))).map(t -> {
        try {
            t.store(tangle);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return t;
    }).collect(Collectors.toList());
// Assert.assertTrue(BundleValidator.validate(tangle,transactions.get(0).getBundleHash()).get(0).size() == transactions.size());
}
Also used : AfterClass(org.junit.AfterClass) Arrays(java.util.Arrays) Tangle(com.iota.iri.storage.Tangle) BeforeClass(org.junit.BeforeClass) RocksDBPersistenceProvider(com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider) Test(org.junit.Test) Hash(com.iota.iri.model.Hash) Collectors(java.util.stream.Collectors) List(java.util.List) SpongeFactory(com.iota.iri.hash.SpongeFactory) Converter(com.iota.iri.utils.Converter) TransactionViewModel(com.iota.iri.controllers.TransactionViewModel) TemporaryFolder(org.junit.rules.TemporaryFolder) TransactionViewModel(com.iota.iri.controllers.TransactionViewModel) Test(org.junit.Test)

Example 3 with Tangle

use of com.iota.iri.storage.Tangle in project iri by iotaledger.

the class TransactionValidatorTest method setUp.

@BeforeClass
public static void setUp() throws Exception {
    dbFolder.create();
    logFolder.create();
    tangle = new Tangle();
    tangle.addPersistenceProvider(new RocksDBPersistenceProvider(dbFolder.getRoot().getAbsolutePath(), logFolder.getRoot().getAbsolutePath(), 1000));
    tangle.init();
    TipsViewModel tipsViewModel = new TipsViewModel();
    MessageQ messageQ = new MessageQ(0, "", 0, false);
    TransactionRequester txRequester = new TransactionRequester(tangle, messageQ);
    txValidator = new TransactionValidator(tangle, tipsViewModel, txRequester, messageQ);
    txValidator.init(false, MAINNET_MWM, TESTNET_MWM);
}
Also used : TransactionRequester(com.iota.iri.network.TransactionRequester) MessageQ(com.iota.iri.zmq.MessageQ) TipsViewModel(com.iota.iri.controllers.TipsViewModel) RocksDBPersistenceProvider(com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider) Tangle(com.iota.iri.storage.Tangle) BeforeClass(org.junit.BeforeClass)

Example 4 with Tangle

use of com.iota.iri.storage.Tangle in project iri by iotaledger.

the class BundleValidatorTest method validate.

@Test
public void validate() throws Exception {
    String[] trytes = { "999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999SQYSGYNQDUEMYK9RSEJXLBSGWBSEVIMZWQPHLMPKBAIJCTAEPDYLLRTESZSW9FMQYNSGQZKRKCXGNUWDOA99999999999999999999999999999999999999999999999999999RMADHWD99999999999D99999999GIXTMJIGESMVEKQNM9JOEUNO9CRQVIRTRVXOBV9ODB9MUAHOVAONAFHZLIQLWTQWTZUYGPEAORENMU9CBOFPLCLNEBUUIJBFHXKQTAQFCZZACGXQEGPTUUMGYXWSEFUK9MKTVJRPUUJESLUSN9FPRHMMLBRNG99999IHAVDVHYJDKRYAOTUYNJCSNERFHACSDTCQIO9IPWSUGQN9DAVNJRUNLMZSRRFLUFLTRSGYVJLKOCW9999RDDGUFUSZZMJIGAHCWHWCNNBHSLYVCPBZOHGQQPMIPTWCMREXAQY9IIWOSYSUUWMBQOAUTXBZ9DOWWMPF", "XXNZSYGCAIEQA9JXNUNAFYGOKRPFPFONH9SNPOKQHURAKQBDDWUIXSFCNFZLTJQJXDJZEMIHLIQTF9NXWKPDCX9PUBVIAJFBCZLBSXUSMBUUBTZWBWFBXARYKGHWZR9ZYVKX9WDTXMQIUFCZJZVMGTFOAFKKPWKAGB9N9BUWJJFELOFMCWZGIGEEZWXYBQONGGC9IRHPDHSSJYMBUAFTRWPCGACLSKXZYLHXHXZRSKCO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UYGPEAORENMU9CBLBKHIWPHSOQRNKCRNEBRWRFVPPSQHENFAPJKLMWZOTVWXDDALUMLVCOXTWEEL9PRYD9CMVTUULUCC9999IHAVDVHYJDKRYAOTUYNJCSNERFHACSDTCQIO9IPWSUGQN9DAVNJRUNLMZSRRFLUFLTRSGYVJLKOCW9999LAAIEDNOAODKHWVDSHBPTASMYDJUIXNIHROGKQOKUYEGEDSGXPBKCLPVHKGSGRGXKZGQKTRCMMNWZODSX", "999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999XXIOBS9NSVFA9AUBBOLXBNXNEXIEYAXVXITMWRGUCJNSMPGDZNCZUVAKPG9NNWLKLQJIINXLD9HVEBPVWC99999999999999999999999999999999999999999999999999999VMADHWD99D99999999D99999999GIXTMJIGESMVEKQNM9JOEUNO9CRQVIRTRVXOBV9ODB9MUAHOVAONAFHZLIQLWTQWTZUYGPEAORENMU9CBIHAVDVHYJDKRYAOTUYNJCSNERFHACSDTCQIO9IPWSUGQN9DAVNJRUNLMZSRRFLUFLTRSGYVJLKOCW9999MYZPDMYYXPQGOANGLNMWZPAD9WNKKASTLDROFMAEZHXDTMTDCPSGTVMUMSXPEWIWLXMIUQTOAEMRX9999YSXGJFBLETJTPG9LTUJPPZYCSORFLSFUXVREBLQ9XAASFHSXGFKRPGQLIVOJRDFECSDJPEWQUKTXKWGDD" };
    List<TransactionViewModel> transactions = Arrays.stream(trytes).map(Converter::allocatingTritsFromTrytes).map(t -> new TransactionViewModel(t, Hash.calculate(SpongeFactory.Mode.CURLP81, t))).map(t -> {
        try {
            t.store(tangle);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return t;
    }).collect(Collectors.toList());
// Assert.assertTrue(BundleValidator.validate(tangle,transactions.get(0).getBundleHash()).get(0).size() == transactions.size());
}
Also used : AfterClass(org.junit.AfterClass) Arrays(java.util.Arrays) Tangle(com.iota.iri.storage.Tangle) BeforeClass(org.junit.BeforeClass) RocksDBPersistenceProvider(com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider) Test(org.junit.Test) Hash(com.iota.iri.model.Hash) Collectors(java.util.stream.Collectors) List(java.util.List) SpongeFactory(com.iota.iri.hash.SpongeFactory) Converter(com.iota.iri.utils.Converter) TransactionViewModel(com.iota.iri.controllers.TransactionViewModel) TemporaryFolder(org.junit.rules.TemporaryFolder) TransactionViewModel(com.iota.iri.controllers.TransactionViewModel) Test(org.junit.Test)

Example 5 with Tangle

use of com.iota.iri.storage.Tangle in project iri by iotaledger.

the class TipsManagerTest method setUp.

@BeforeClass
public static void setUp() throws Exception {
    tangle = new Tangle();
    dbFolder.create();
    logFolder.create();
    tangle.addPersistenceProvider(new RocksDBPersistenceProvider(dbFolder.getRoot().getAbsolutePath(), logFolder.getRoot().getAbsolutePath(), 1000));
    tangle.init();
    TipsViewModel tipsViewModel = new TipsViewModel();
    MessageQ messageQ = new MessageQ(0, null, 1, false);
    TransactionRequester transactionRequester = new TransactionRequester(tangle, messageQ);
    TransactionValidator transactionValidator = new TransactionValidator(tangle, tipsViewModel, transactionRequester, messageQ);
    Milestone milestone = new Milestone(tangle, Hash.NULL_HASH, Snapshot.initialSnapshot.clone(), transactionValidator, true, messageQ);
    LedgerValidator ledgerValidator = new LedgerValidator(tangle, milestone, transactionRequester, messageQ);
    tipsManager = new TipsManager(tangle, ledgerValidator, transactionValidator, tipsViewModel, milestone, 15, messageQ);
}
Also used : TransactionRequester(com.iota.iri.network.TransactionRequester) MessageQ(com.iota.iri.zmq.MessageQ) Milestone(com.iota.iri.Milestone) TransactionValidator(com.iota.iri.TransactionValidator) TipsViewModel(com.iota.iri.controllers.TipsViewModel) RocksDBPersistenceProvider(com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider) Tangle(com.iota.iri.storage.Tangle) LedgerValidator(com.iota.iri.LedgerValidator) BeforeClass(org.junit.BeforeClass)

Aggregations

Tangle (com.iota.iri.storage.Tangle)5 RocksDBPersistenceProvider (com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider)5 BeforeClass (org.junit.BeforeClass)5 TransactionViewModel (com.iota.iri.controllers.TransactionViewModel)3 SpongeFactory (com.iota.iri.hash.SpongeFactory)3 Hash (com.iota.iri.model.Hash)3 Converter (com.iota.iri.utils.Converter)3 Arrays (java.util.Arrays)3 List (java.util.List)3 Collectors (java.util.stream.Collectors)3 AfterClass (org.junit.AfterClass)3 Test (org.junit.Test)3 TemporaryFolder (org.junit.rules.TemporaryFolder)3 TipsViewModel (com.iota.iri.controllers.TipsViewModel)2 TransactionRequester (com.iota.iri.network.TransactionRequester)2 MessageQ (com.iota.iri.zmq.MessageQ)2 LedgerValidator (com.iota.iri.LedgerValidator)1 Milestone (com.iota.iri.Milestone)1 TransactionValidator (com.iota.iri.TransactionValidator)1