Search in sources :

Example 1 with HapiFileCreate

use of com.hedera.services.bdd.spec.transactions.file.HapiFileCreate in project hedera-services by hashgraph.

the class RandomContract method suggestedInitializers.

@Override
public List<HapiSpecOperation> suggestedInitializers() {
    List<HapiSpecOperation> ops = new ArrayList<>();
    for (SupportedContract choice : choices) {
        HapiFileCreate op = fileCreate(fileFor(choice)).noLogging().path(choice.getPathToBytecode());
        ops.add(op);
    }
    return ops;
}
Also used : SupportedContract(com.hedera.services.bdd.spec.infrastructure.meta.SupportedContract) ArrayList(java.util.ArrayList) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation) HapiFileCreate(com.hedera.services.bdd.spec.transactions.file.HapiFileCreate)

Example 2 with HapiFileCreate

use of com.hedera.services.bdd.spec.transactions.file.HapiFileCreate in project hedera-services by hashgraph.

the class HapiContractCreate method setBytecodeToDefaultContract.

private void setBytecodeToDefaultContract(HapiApiSpec spec) throws Throwable {
    String implicitBytecodeFile = contract + "Bytecode";
    HapiFileCreate fileCreate = TxnVerbs.fileCreate(implicitBytecodeFile).path(spec.setup().defaultContractPath());
    Optional<Throwable> opError = fileCreate.execFor(spec);
    if (opError.isPresent()) {
        throw opError.get();
    }
    bytecodeFile = Optional.of(implicitBytecodeFile);
}
Also used : ByteString(com.google.protobuf.ByteString) HapiFileCreate(com.hedera.services.bdd.spec.transactions.file.HapiFileCreate)

Aggregations

HapiFileCreate (com.hedera.services.bdd.spec.transactions.file.HapiFileCreate)2 ByteString (com.google.protobuf.ByteString)1 HapiSpecOperation (com.hedera.services.bdd.spec.HapiSpecOperation)1 SupportedContract (com.hedera.services.bdd.spec.infrastructure.meta.SupportedContract)1 ArrayList (java.util.ArrayList)1