use of com.iota.iri.model.Hash in project iri by iotaledger.
the class MilestoneViewModelTest method previous.
@Test
public void previous() throws Exception {
int first = 1;
int next = 2;
MilestoneViewModel nextMilestone = new MilestoneViewModel(next, new Hash("99CDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUV99999"));
nextMilestone.store(tangle);
new MilestoneViewModel(first, new Hash("9ACDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUV99999")).store(tangle);
assertTrue(first == nextMilestone.previous(tangle).index());
}
use of com.iota.iri.model.Hash in project iri by iotaledger.
the class MilestoneViewModelTest method nextWithSnapshot.
@Test
public void nextWithSnapshot() throws Exception {
int firstSnapshot = 8;
int next = 9;
MilestoneViewModel milestoneViewModelmid = new MilestoneViewModel(next, new Hash("GBCDEBGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUV99999"));
milestoneViewModelmid.store(tangle);
MilestoneViewModel milestoneViewModel = new MilestoneViewModel(firstSnapshot, new Hash("GBCDEFGHIJKLMNODQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUV99999"));
milestoneViewModel.store(tangle);
// assertTrue(next == milestoneViewModel.nextWithSnapshot().index());
}
use of com.iota.iri.model.Hash in project iri by iotaledger.
the class MilestoneViewModelTest method getHash.
@Test
public void getHash() throws Exception {
Hash milestoneHash = new Hash("DBCDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUV99999");
MilestoneViewModel milestoneViewModel = new MilestoneViewModel(++index, milestoneHash);
assertEquals(milestoneHash, milestoneViewModel.getHash());
}
use of com.iota.iri.model.Hash in project iri by iotaledger.
the class MilestoneViewModelTest method updateSnapshot.
@Test
public void updateSnapshot() throws Exception {
Hash milestoneHash = new Hash("CBCDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUV99999");
MilestoneViewModel milestoneViewModel = new MilestoneViewModel(++index, milestoneHash);
assertTrue(milestoneViewModel.store(tangle));
MilestoneViewModel.clear();
assertEquals(MilestoneViewModel.get(tangle, index).getHash(), milestoneHash);
}
use of com.iota.iri.model.Hash in project iri by iotaledger.
the class MilestoneViewModelTest method index.
@Test
public void index() throws Exception {
Hash milestoneHash = new Hash("EBCDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUVWXYZ9ABCDEFGHIJKLMNOPQRSTUV99999");
MilestoneViewModel milestoneViewModel = new MilestoneViewModel(++index, milestoneHash);
assertTrue(index == milestoneViewModel.index());
}
Aggregations