Пример #1
0
 @Test
 public void earliestKeyTime() throws Exception {
   long now = Utils.currentTimeSeconds(); // mock
   long yesterday = now - 86400;
   assertEquals(now, group.getEarliestKeyCreationTime());
   Utils.rollMockClock(10000);
   group.freshKey(KeyChain.KeyPurpose.RECEIVE_FUNDS);
   Utils.rollMockClock(10000);
   group.freshKey(KeyChain.KeyPurpose.RECEIVE_FUNDS);
   // Check that all keys are assumed to be created at the same instant the seed is.
   assertEquals(now, group.getEarliestKeyCreationTime());
   ECKey key = new ECKey();
   key.setCreationTimeSeconds(yesterday);
   group.importKeys(key);
   assertEquals(yesterday, group.getEarliestKeyCreationTime());
 }