private void testIssueMultipleFullAssets()
      throws CantDefineContractPropertyException, CantIssueDigitalAssetsException {
    LOG.info("MAP_TEST_MULTIPLE_FULL_ASSETS");
    DigitalAsset digitalAsset = new DigitalAsset();
    digitalAsset.setPublicKey(new ECCKeyPair().getPublicKey());
    digitalAsset.setDescription("Descripcion de prueba");
    digitalAsset.setGenesisAddress(
        new CryptoAddress("n1zVgphtAoxgDMUzKV5ATeggwvUwnssb7m", CryptoCurrency.BITCOIN));
    digitalAsset.setGenesisAmount(1000);

    List<Resource> resources = new ArrayList<>();
    Resource resource = new Resource();
    resource.setId(UUID.randomUUID());
    resource.setName("Foto 1");
    resource.setFileName("imagen2.png");
    resource.setResourceType(ResourceType.IMAGE);
    resource.setResourceDensity(ResourceDensity.HDPI);
    resource.setResourceBinayData(
        new byte[] {0xa, 0x2, 0xf, (byte) 0xff, (byte) 0xff, (byte) 0xff});

    Resource resource2 = new Resource();
    resource2.setId(UUID.randomUUID());
    resource2.setName("Foto 1");
    resource2.setFileName("imagen2.png");
    resource2.setResourceType(ResourceType.IMAGE);
    resource2.setResourceDensity(ResourceDensity.HDPI);
    resource2.setResourceBinayData(
        new byte[] {0xa, 0x2, 0xf, (byte) 0xff, (byte) 0xff, (byte) 0xff});

    Resource resource3 = new Resource();
    resource3.setId(UUID.randomUUID());
    resource3.setName("Foto 1");
    resource3.setFileName("imagen2.png");
    resource3.setResourceType(ResourceType.IMAGE);
    resource3.setResourceDensity(ResourceDensity.HDPI);
    resource3.setResourceBinayData(
        new byte[] {0xa, 0x2, 0xf, (byte) 0xff, (byte) 0xff, (byte) 0xff});

    resources.add(resource);
    resources.add(resource2);
    resources.add(resource3);
    digitalAsset.setResources(resources);
    IdentityAssetIssuer identityAssetIssuer = new MockIdentityAssetIssuerForTest();
    digitalAsset.setName("Asset de prueba");
    digitalAsset.setIdentityAssetIssuer(identityAssetIssuer);
    DigitalAssetContract contract = new DigitalAssetContract();
    contract.setContractProperty(
        new ContractProperty(DigitalAssetContractPropertiesConstants.REDEEMABLE, Boolean.TRUE));
    digitalAsset.setContract(contract);

    System.out.println(digitalAsset.toString());
    this.assetIssuingTransactionManager.issueAssets(
        digitalAsset, 10, "TESTING PUBLICKEY", BlockchainNetworkType.REG_TEST);
    LOG.info("MAP_END_TEST_MULTIPLE_FULL_ASSETS");
  }
Exemplo n.º 2
0
 public static boolean isValidContract(DigitalAssetContract digitalAssetContract) {
   // For now, we going to check, only, the expiration date
   ContractProperty contractProperty =
       digitalAssetContract.getContractProperty(
           DigitalAssetContractPropertiesConstants.EXPIRATION_DATE);
   return isValidExpirationDate(contractProperty);
 }