Search in sources :

Example 6 with NContract

use of com.icodici.universa.contract.services.NContract in project universa by UniversaBlockchain.

the class NSmartContractTest method goodNSmartContractFromDSL.

@Test
public void goodNSmartContractFromDSL() throws Exception {
    Contract smartContract = NSmartContract.fromDslFile(rootPath + "NotaryNSmartDSLTemplate.yml");
    smartContract.addSignerKeyFromFile(rootPath + "_xer0yfe2nn1xthc.private.unikey");
    smartContract.seal();
    smartContract.check();
    smartContract.traceErrors();
    assertTrue(smartContract.isOk());
    assertEquals(NSmartContract.SmartContractType.N_SMART_CONTRACT.name(), smartContract.getDefinition().getExtendedType());
    assertEquals(NSmartContract.SmartContractType.N_SMART_CONTRACT.name(), smartContract.get("definition.extended_type"));
    assertTrue(smartContract instanceof NSmartContract);
    assertTrue(smartContract instanceof NContract);
}
Also used : NSmartContract(com.icodici.universa.contract.services.NSmartContract) NContract(com.icodici.universa.contract.services.NContract) NContract(com.icodici.universa.contract.services.NContract) NSmartContract(com.icodici.universa.contract.services.NSmartContract) Test(org.junit.Test)

Aggregations

NContract (com.icodici.universa.contract.services.NContract)6 NSmartContract (com.icodici.universa.contract.services.NSmartContract)6 Test (org.junit.Test)6 PrivateKey (com.icodici.crypto.PrivateKey)4 Binder (net.sergeych.tools.Binder)2