Search in sources :

Example 41 with Key

use of com.hederahashgraph.api.proto.java.Key in project hedera-services by hashgraph.

the class NewSpecKeyList method submitOp.

@Override
protected boolean submitOp(HapiApiSpec spec) throws Throwable {
    List<Key> childKeys = keys.stream().map(spec.registry()::getKey).collect(toList());
    Key newList = Key.newBuilder().setKeyList(KeyList.newBuilder().addAllKeys(childKeys)).build();
    spec.registry().saveKey(name, newList);
    SigControl[] childControls = childKeys.stream().map(spec.keys()::controlFor).toArray(SigControl[]::new);
    spec.keys().setControl(newList, SigControl.listSigs(childControls));
    return false;
}
Also used : SigControl(com.hedera.services.bdd.spec.keys.SigControl) Key(com.hederahashgraph.api.proto.java.Key)

Example 42 with Key

use of com.hederahashgraph.api.proto.java.Key in project hedera-services by hashgraph.

the class ValidationScenarios method parse.

private static void parse(String[] args) {
    var KEY_VALUE_PATTERN = Pattern.compile("([\\w\\d]+)=([\\w\\d,.-]+)");
    for (String arg : args) {
        var matcher = KEY_VALUE_PATTERN.matcher(arg);
        if (!matcher.matches()) {
            log.warn(String.format("Ignoring command-line argument '%s'", arg));
        } else {
            if ("target".equals(keyOf(matcher))) {
                params.setTargetNetwork(valueOf(matcher));
            } else if ("defaultNodePayment".equals(keyOf(matcher))) {
                try {
                    params.setDefaultNodePayment(Long.parseLong(valueOf(matcher)));
                } catch (NumberFormatException ignore) {
                }
            } else if ("novel".equals(keyOf(matcher))) {
                params.setNovelContent(valueOf(matcher).toLowerCase().equals("true"));
            } else if ("revocation".equals(keyOf(matcher))) {
                params.setRevocationService(valueOf(matcher).toLowerCase().equals("true"));
            } else if ("scenarios".equals(keyOf(matcher))) {
                Set<String> legal = Arrays.stream(Scenario.class.getEnumConstants()).map(Object::toString).collect(Collectors.toSet());
                List<String> listed = Arrays.stream(valueOf(matcher).split(",")).map(name -> name.equals("fees") ? "FEE_SNAPSHOTS" : name).map(name -> name.equals("syskeys") ? "SYSTEM_KEYS" : name).map(name -> name.equals("xfers") ? "TRANSFERS_ONLY" : name).map(name -> name.equals("sysFilesDown") ? "SYS_FILES_DOWN" : name).map(name -> name.equals("sysFilesUp") ? "SYS_FILES_UP" : name).filter(v -> legal.contains(v.toUpperCase())).collect(toList());
                if (listed.size() == 1) {
                    params.setScenarios(EnumSet.of(Scenario.valueOf(listed.get(0).toUpperCase())));
                } else if (listed.size() > 1) {
                    params.setScenarios(EnumSet.of(Scenario.valueOf(listed.get(0).toUpperCase()), listed.subList(1, listed.size()).stream().map(String::toUpperCase).map(Scenario::valueOf).toArray(n -> new Scenario[n])));
                }
            } else if ("config".equals(keyOf(matcher))) {
                params.setConfigLoc(valueOf(matcher));
            } else {
                log.warn(String.format("Ignoring unknown parameter key '%s'", keyOf(matcher)));
            }
        }
    }
    System.out.println(params.getScenarios());
}
Also used : Arrays(java.util.Arrays) LongSupplier(java.util.function.LongSupplier) TxnVerbs.cryptoCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate) ServicesConfigurationList(com.hederahashgraph.api.proto.java.ServicesConfigurationList) CryptoScenario(com.hedera.services.bdd.suites.utils.validation.domain.CryptoScenario) UnaryOperator(java.util.function.UnaryOperator) KeyStoreException(java.security.KeyStoreException) ON(com.hedera.services.bdd.spec.keys.SigControl.ON) TxnVerbs.contractDelete(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractDelete) ConsensusScenario(com.hedera.services.bdd.suites.utils.validation.domain.ConsensusScenario) TxnVerbs.tokenDelete(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenDelete) Matcher(java.util.regex.Matcher) Map(java.util.Map) KeyList(com.hederahashgraph.api.proto.java.KeyList) QueryVerbs.contractCallLocal(com.hedera.services.bdd.spec.queries.QueryVerbs.contractCallLocal) HapiCryptoTransfer.tinyBarsFromTo(com.hedera.services.bdd.spec.transactions.crypto.HapiCryptoTransfer.tinyBarsFromTo) BigInteger(java.math.BigInteger) DEFAULT_LUCKY_NUMBER(com.hedera.services.bdd.suites.utils.validation.domain.ContractScenario.DEFAULT_LUCKY_NUMBER) Files.readString(java.nio.file.Files.readString) DEFAULT_CONTRACT_RESOURCE(com.hedera.services.bdd.suites.utils.validation.domain.ContractScenario.DEFAULT_CONTRACT_RESOURCE) FeeSnapshotsScenario(com.hedera.services.bdd.suites.utils.validation.domain.FeeSnapshotsScenario) EnumSet(java.util.EnumSet) InvalidProtocolBufferException(com.google.protobuf.InvalidProtocolBufferException) TxnVerbs.contractCall(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCall) ControlForKey(com.hedera.services.bdd.spec.keys.ControlForKey) Property(org.yaml.snakeyaml.introspector.Property) ContractFnResultAsserts.resultWith(com.hedera.services.bdd.spec.assertions.ContractFnResultAsserts.resultWith) Set(java.util.Set) TxnVerbs.submitMessageTo(com.hedera.services.bdd.spec.transactions.TxnVerbs.submitMessageTo) TransactionRecordAsserts.recordWith(com.hedera.services.bdd.spec.assertions.TransactionRecordAsserts.recordWith) KeyFactory(com.hedera.services.bdd.spec.keys.KeyFactory) Logger(org.apache.logging.log4j.Logger) Stream(java.util.stream.Stream) SYSTEM_KEYS(com.hedera.services.bdd.suites.utils.validation.ValidationScenarios.Scenario.SYSTEM_KEYS) QueryVerbs.getContractBytecode(com.hedera.services.bdd.spec.queries.QueryVerbs.getContractBytecode) LEGACY_THROTTLES_FIRST_ORDER(com.hedera.services.bdd.suites.utils.sysfiles.serdes.JutilPropsToSvcCfgBytes.LEGACY_THROTTLES_FIRST_ORDER) PERSISTENT_TOPIC_NAME(com.hedera.services.bdd.suites.utils.validation.domain.ConsensusScenario.PERSISTENT_TOPIC_NAME) TxnVerbs.tokenDissociate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenDissociate) PERSISTENT_FILE_NAME(com.hedera.services.bdd.suites.utils.validation.domain.FileScenario.PERSISTENT_FILE_NAME) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) SCENARIO_PAYER_NAME(com.hedera.services.bdd.suites.utils.validation.domain.Network.SCENARIO_PAYER_NAME) TxnVerbs.tokenAssociate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenAssociate) TopicID(com.hederahashgraph.api.proto.java.TopicID) UtilVerbs.withOpContext(com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext) QueryVerbs.getVersionInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getVersionInfo) UtilVerbs.balanceSnapshot(com.hedera.services.bdd.spec.utilops.UtilVerbs.balanceSnapshot) TxnVerbs.createTopic(com.hedera.services.bdd.spec.transactions.TxnVerbs.createTopic) Setting(com.hederahashgraph.api.proto.java.Setting) UtilVerbs.keyFromPem(com.hedera.services.bdd.spec.utilops.UtilVerbs.keyFromPem) Network(com.hedera.services.bdd.suites.utils.validation.domain.Network) ArrayList(java.util.ArrayList) OptionalLong(java.util.OptionalLong) TxnVerbs.cryptoUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoUpdate) Payment(com.hedera.services.bdd.spec.fees.Payment) AccountID(com.hederahashgraph.api.proto.java.AccountID) SYS_FILES_UP(com.hedera.services.bdd.suites.utils.validation.ValidationScenarios.Scenario.SYS_FILES_UP) NOVEL_CONTRACT_NAME(com.hedera.services.bdd.suites.utils.validation.domain.ContractScenario.NOVEL_CONTRACT_NAME) FileID(com.hederahashgraph.api.proto.java.FileID) LongStream(java.util.stream.LongStream) SysFileSerde(com.hedera.services.bdd.suites.utils.sysfiles.serdes.SysFileSerde) FILE(com.hedera.services.bdd.suites.utils.validation.ValidationScenarios.Scenario.FILE) Scenarios(com.hedera.services.bdd.suites.utils.validation.domain.Scenarios) Files(java.nio.file.Files) TxnVerbs.tokenFreeze(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenFreeze) FileScenario(com.hedera.services.bdd.suites.utils.validation.domain.FileScenario) Constructor(org.yaml.snakeyaml.constructor.Constructor) BufferedWriter(java.io.BufferedWriter) CONTRACT(com.hedera.services.bdd.suites.utils.validation.ValidationScenarios.Scenario.CONTRACT) IOException(java.io.IOException) UtilVerbs.updateLargeFile(com.hedera.services.bdd.spec.utilops.UtilVerbs.updateLargeFile) HapiPropertySource(com.hedera.services.bdd.spec.HapiPropertySource) QueryVerbs.getFileInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getFileInfo) TransferListAsserts.includingDeduction(com.hedera.services.bdd.spec.assertions.TransferListAsserts.includingDeduction) TxnVerbs.burnToken(com.hedera.services.bdd.spec.transactions.TxnVerbs.burnToken) CustomSpecAssert.allRunFor(com.hedera.services.bdd.spec.utilops.CustomSpecAssert.allRunFor) File(java.io.File) NodeTuple(org.yaml.snakeyaml.nodes.NodeTuple) AtomicLong(java.util.concurrent.atomic.AtomicLong) TxnVerbs.fileCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileCreate) CommonUtils(com.swirlds.common.CommonUtils) OFF(com.hedera.services.bdd.spec.keys.SigControl.OFF) Paths(java.nio.file.Paths) ContractScenario(com.hedera.services.bdd.suites.utils.validation.domain.ContractScenario) TxnVerbs.tokenUnfreeze(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenUnfreeze) PersistentFile(com.hedera.services.bdd.suites.utils.validation.domain.PersistentFile) SigControl(com.hedera.services.bdd.spec.keys.SigControl) IntConsumer(java.util.function.IntConsumer) TxnVerbs.contractUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractUpdate) TxnVerbs.cryptoTransfer(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer) SYS_FILES_DOWN(com.hedera.services.bdd.suites.utils.validation.ValidationScenarios.Scenario.SYS_FILES_DOWN) QueryVerbs.getContractInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getContractInfo) ContractID(com.hederahashgraph.api.proto.java.ContractID) QueryVerbs.getTxnRecord(com.hedera.services.bdd.spec.queries.QueryVerbs.getTxnRecord) QueryVerbs.getAccountInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountInfo) SysFilesUpScenario(com.hedera.services.bdd.suites.utils.validation.domain.SysFilesUpScenario) Collectors.toMap(java.util.stream.Collectors.toMap) AccountInfoAsserts.changeFromSnapshot(com.hedera.services.bdd.spec.assertions.AccountInfoAsserts.changeFromSnapshot) FEE_SNAPSHOTS(com.hedera.services.bdd.suites.utils.validation.ValidationScenarios.Scenario.FEE_SNAPSHOTS) VERSIONS(com.hedera.services.bdd.suites.utils.validation.ValidationScenarios.Scenario.VERSIONS) SENDER_NAME(com.hedera.services.bdd.suites.utils.validation.domain.CryptoScenario.SENDER_NAME) NOVEL_TOPIC_NAME(com.hedera.services.bdd.suites.utils.validation.domain.ConsensusScenario.NOVEL_TOPIC_NAME) PersistentContract(com.hedera.services.bdd.suites.utils.validation.domain.PersistentContract) UtilVerbs.newKeyNamed(com.hedera.services.bdd.spec.utilops.UtilVerbs.newKeyNamed) HapiApiSpec.customHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.customHapiSpec) TxnVerbs.deleteTopic(com.hedera.services.bdd.spec.transactions.TxnVerbs.deleteTopic) DEFAULT_BYTECODE_RESOURCE(com.hedera.services.bdd.suites.utils.validation.domain.ContractScenario.DEFAULT_BYTECODE_RESOURCE) Collectors(java.util.stream.Collectors) ByteString(com.google.protobuf.ByteString) UpdateAction(com.hedera.services.bdd.suites.utils.validation.domain.UpdateAction) List(java.util.List) Node(com.hedera.services.bdd.suites.utils.validation.domain.Node) TxnVerbs.grantTokenKyc(com.hedera.services.bdd.spec.transactions.TxnVerbs.grantTokenKyc) TxnVerbs.tokenUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenUpdate) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation) SysFilesDownScenario(com.hedera.services.bdd.suites.utils.validation.domain.SysFilesDownScenario) Optional(java.util.Optional) Pattern(java.util.regex.Pattern) TxnVerbs.wipeTokenAccount(com.hedera.services.bdd.spec.transactions.TxnVerbs.wipeTokenAccount) VersionInfoScenario(com.hedera.services.bdd.suites.utils.validation.domain.VersionInfoScenario) IntStream(java.util.stream.IntStream) TxnVerbs.fileDelete(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileDelete) QueryVerbs.getAccountRecords(com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountRecords) QueryVerbs.getTopicInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getTopicInfo) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TxnVerbs.fileUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileUpdate) AtomicReference(java.util.concurrent.atomic.AtomicReference) INVALID_SIGNATURE(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_SIGNATURE) ContractResources(com.hedera.services.bdd.spec.infrastructure.meta.ContractResources) PERSISTENT_CONTRACT_NAME(com.hedera.services.bdd.suites.utils.validation.domain.ContractScenario.PERSISTENT_CONTRACT_NAME) Yaml(org.yaml.snakeyaml.Yaml) TxnVerbs(com.hedera.services.bdd.spec.transactions.TxnVerbs) NOVEL_ACCOUNT_NAME(com.hedera.services.bdd.suites.utils.validation.domain.CryptoScenario.NOVEL_ACCOUNT_NAME) ValidationConfig(com.hedera.services.bdd.suites.utils.validation.domain.ValidationConfig) TokenMovement.moving(com.hedera.services.bdd.spec.transactions.token.TokenMovement.moving) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) TxnVerbs.cryptoDelete(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoDelete) DEFAULT_CONTENTS_RESOURCE(com.hedera.services.bdd.suites.utils.validation.domain.FileScenario.DEFAULT_CONTENTS_RESOURCE) TxnVerbs.fileAppend(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileAppend) KeyShape(com.hedera.services.bdd.spec.keys.KeyShape) TxnVerbs.revokeTokenKyc(com.hedera.services.bdd.spec.transactions.TxnVerbs.revokeTokenKyc) TxnVerbs.mintToken(com.hedera.services.bdd.spec.transactions.TxnVerbs.mintToken) TxnVerbs.tokenCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.tokenCreate) QueryVerbs.getFileContents(com.hedera.services.bdd.spec.queries.QueryVerbs.getFileContents) SUITE_PASSED(com.hedera.services.bdd.suites.HapiApiSuite.FinalOutcome.SUITE_PASSED) TxnVerbs.updateTopic(com.hedera.services.bdd.spec.transactions.TxnVerbs.updateTopic) SYS_FILE_SERDES(com.hedera.services.bdd.suites.utils.sysfiles.serdes.StandardSerdes.SYS_FILE_SERDES) RECEIVER_NAME(com.hedera.services.bdd.suites.utils.validation.domain.CryptoScenario.RECEIVER_NAME) Optional.ofNullable(java.util.Optional.ofNullable) QueryVerbs.getAccountBalance(com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountBalance) Tag(org.yaml.snakeyaml.nodes.Tag) SpecUtils(com.hedera.services.bdd.suites.utils.keypairs.SpecUtils) ContractFnResultAsserts.isLiteralResult(com.hedera.services.bdd.spec.assertions.ContractFnResultAsserts.isLiteralResult) TRANSFERS_ONLY(com.hedera.services.bdd.suites.utils.validation.ValidationScenarios.Scenario.TRANSFERS_ONLY) LongConsumer(java.util.function.LongConsumer) Consumer(java.util.function.Consumer) CRYPTO(com.hedera.services.bdd.suites.utils.validation.ValidationScenarios.Scenario.CRYPTO) Key(com.hederahashgraph.api.proto.java.Key) CONSENSUS(com.hedera.services.bdd.suites.utils.validation.ValidationScenarios.Scenario.CONSENSUS) Collectors.toList(java.util.stream.Collectors.toList) UtilVerbs(com.hedera.services.bdd.spec.utilops.UtilVerbs) Assertions(org.junit.jupiter.api.Assertions) Representer(org.yaml.snakeyaml.representer.Representer) TxnVerbs.contractCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.contractCreate) LogManager(org.apache.logging.log4j.LogManager) NOVEL_FILE_NAME(com.hedera.services.bdd.suites.utils.validation.domain.FileScenario.NOVEL_FILE_NAME) Files.readString(java.nio.file.Files.readString) ByteString(com.google.protobuf.ByteString) CryptoScenario(com.hedera.services.bdd.suites.utils.validation.domain.CryptoScenario) ConsensusScenario(com.hedera.services.bdd.suites.utils.validation.domain.ConsensusScenario) FeeSnapshotsScenario(com.hedera.services.bdd.suites.utils.validation.domain.FeeSnapshotsScenario) FileScenario(com.hedera.services.bdd.suites.utils.validation.domain.FileScenario) ContractScenario(com.hedera.services.bdd.suites.utils.validation.domain.ContractScenario) SysFilesUpScenario(com.hedera.services.bdd.suites.utils.validation.domain.SysFilesUpScenario) SysFilesDownScenario(com.hedera.services.bdd.suites.utils.validation.domain.SysFilesDownScenario) VersionInfoScenario(com.hedera.services.bdd.suites.utils.validation.domain.VersionInfoScenario)

Example 43 with Key

use of com.hederahashgraph.api.proto.java.Key in project hedera-services by hashgraph.

the class SysFilesUpdate method updateTargetFromHumanReadable.

private HapiApiSpec updateTargetFromHumanReadable() {
    byte[] bytes = new byte[0];
    String nodesOverride = envNodes();
    System.out.println("Targeting " + nodesOverride);
    String loc = humanReadableFileNames.get(target);
    String readableFile = qualifiedPath(nodesOverride, loc, false);
    try {
        if (BOOK_FILES.contains(target)) {
            AddressBookPojo pojoBook = mapper.readValue(new File(readableFile), AddressBookPojo.class);
            var addressBook = NodeAddressBook.newBuilder();
            pojoBook.getEntries().stream().flatMap(updateConverters.get(target)).forEach(addressBook::addNodeAddress);
            bytes = addressBook.build().toByteArray();
        } else if (target == SystemFile.EXCHANGE_RATES) {
            var pojoRates = mapper.readValue(new File(readableFile), ExchangeRatesPojo.class);
            bytes = pojoRates.toProto().toByteArray();
        } else if (target == SystemFile.FEE_SCHEDULE) {
            final var literal = java.nio.file.Files.readString(Paths.get(readableFile));
            bytes = FeesJsonToProtoSerde.parseFeeScheduleFromJson(literal).toByteArray();
        } else {
            var jutilConfig = new Properties();
            jutilConfig.load(java.nio.file.Files.newInputStream(Paths.get(readableFile)));
            ServicesConfigurationList.Builder protoConfig = ServicesConfigurationList.newBuilder();
            jutilConfig.stringPropertyNames().stream().sorted(JutilPropsToSvcCfgBytes.LEGACY_THROTTLES_FIRST_ORDER).forEach(prop -> protoConfig.addNameValue(Setting.newBuilder().setName(prop).setValue(jutilConfig.getProperty(prop))));
            bytes = protoConfig.build().toByteArray();
        }
    } catch (Exception e) {
        System.out.println(String.format("File '%s' should contain a human-readable %s representation!", readableFile, target.toString()));
        e.printStackTrace();
        System.exit(1);
    }
    final byte[] toUpload = bytes;
    return customHapiSpec(String.format("Update-%s-FromHumanReadable", target)).withProperties(Map.of("nodes", nodesOverride, "default.payer", defaultPayerOverride, "startupAccounts.path", startupAccountsPathOverride)).given(withOpContext((spec, opLog) -> {
        var sysFileOcKeystore = SpecUtils.asOcKeystore(new File(DEFAULT_SYSFILE_PEM_LOC), KeyFactory.PEM_PASSPHRASE);
        var sysFileKey = Key.newBuilder().setEd25519(ByteString.copyFrom(com.swirlds.common.CommonUtils.unhex(sysFileOcKeystore.getPublicKeyAbyteStr()))).build();
        opLog.info("Will ensure default public key :: " + sysFileKey + " (hex = " + sysFileOcKeystore.getPublicKeyAbyteStr() + ")");
        spec.registry().saveKey(DEFAULT_SYSFILE_KEY, sysFileKey);
        spec.keys().incorporate(DEFAULT_SYSFILE_KEY, sysFileOcKeystore);
    }), keyFromPem(DEFAULT_SYSFILE_PEM_LOC).name("insurance").simpleWacl().passphrase(KeyFactory.PEM_PASSPHRASE)).when().then(withOpContext((spec, opLog) -> {
        if (toUpload.length < (6 * 1024)) {
            var singleOp = fileUpdate(registryNames.get(target)).payingWith(DEFAULT_PAYER).fee(feeToOffer()).contents(toUpload).signedBy(DEFAULT_PAYER, DEFAULT_SYSFILE_KEY);
            CustomSpecAssert.allRunFor(spec, singleOp);
        } else {
            int n = 0;
            while (n < toUpload.length) {
                int thisChunkSize = Math.min(toUpload.length - n, 4096);
                byte[] thisChunk = Arrays.copyOfRange(toUpload, n, n + thisChunkSize);
                HapiSpecOperation subOp;
                if (n == 0) {
                    subOp = fileUpdate(registryNames.get(target)).fee(feeToOffer()).wacl("insurance").contents(thisChunk).signedBy(DEFAULT_PAYER, DEFAULT_SYSFILE_KEY).hasKnownStatusFrom(SUCCESS, FEE_SCHEDULE_FILE_PART_UPLOADED);
                } else {
                    subOp = fileAppend(registryNames.get(target)).fee(feeToOffer()).content(thisChunk).signedBy(DEFAULT_PAYER, DEFAULT_SYSFILE_KEY).hasKnownStatusFrom(SUCCESS, FEE_SCHEDULE_FILE_PART_UPLOADED);
                }
                CustomSpecAssert.allRunFor(spec, subOp);
                n += thisChunkSize;
            }
        }
    }));
}
Also used : KeyPair(java.security.KeyPair) Arrays(java.util.Arrays) ServicesConfigurationList(com.hederahashgraph.api.proto.java.ServicesConfigurationList) Base64(org.apache.commons.codec.binary.Base64) CommonUtils(com.hedera.services.legacy.proto.utils.CommonUtils) NodeAddressBook(com.hederahashgraph.api.proto.java.NodeAddressBook) Map(java.util.Map) SplittableRandom(java.util.SplittableRandom) Path(java.nio.file.Path) EnumSet(java.util.EnumSet) EnumMap(java.util.EnumMap) CurrentAndNextFeeSchedule(com.hederahashgraph.api.proto.java.CurrentAndNextFeeSchedule) UtilVerbs.newKeyNamed(com.hedera.services.bdd.spec.utilops.UtilVerbs.newKeyNamed) HapiApiSpec.customHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.customHapiSpec) SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS) Collectors(java.util.stream.Collectors) ByteString(com.google.protobuf.ByteString) KeyFactory(com.hedera.services.bdd.spec.keys.KeyFactory) List(java.util.List) Logger(org.apache.logging.log4j.Logger) Stream(java.util.stream.Stream) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation) ExchangeRateSet(com.hederahashgraph.api.proto.java.ExchangeRateSet) Optional(java.util.Optional) NodeAddress(com.hederahashgraph.api.proto.java.NodeAddress) Pattern(java.util.regex.Pattern) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) ByteArrayOutputStream(java.io.ByteArrayOutputStream) UtilVerbs.withOpContext(com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext) Ed25519KeyStore(com.hedera.services.bdd.suites.utils.keypairs.Ed25519KeyStore) KeyPairObj(com.hedera.services.legacy.core.KeyPairObj) TxnVerbs.fileUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileUpdate) Function(java.util.function.Function) Setting(com.hederahashgraph.api.proto.java.Setting) UtilVerbs.keyFromPem(com.hedera.services.bdd.spec.utilops.UtilVerbs.keyFromPem) TxnVerbs.cryptoUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoUpdate) TxnUtils(com.hedera.services.bdd.spec.transactions.TxnUtils) CustomSpecAssert(com.hedera.services.bdd.spec.utilops.CustomSpecAssert) Charset(java.nio.charset.Charset) Files(com.google.common.io.Files) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) FeesJsonToProtoSerde(com.hedera.services.sysfiles.serdes.FeesJsonToProtoSerde) TxnVerbs.fileAppend(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileAppend) ObjectOutputStream(java.io.ObjectOutputStream) QueryVerbs.getFileContents(com.hedera.services.bdd.spec.queries.QueryVerbs.getFileContents) Properties(java.util.Properties) FEE_SCHEDULE_FILE_PART_UPLOADED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.FEE_SCHEDULE_FILE_PART_UPLOADED) BufferedWriter(java.io.BufferedWriter) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) IOException(java.io.IOException) QueryVerbs.getFileInfo(com.hedera.services.bdd.spec.queries.QueryVerbs.getFileInfo) JutilPropsToSvcCfgBytes(com.hedera.services.bdd.suites.utils.sysfiles.serdes.JutilPropsToSvcCfgBytes) PropertySource.asAccount(com.hedera.services.bdd.spec.PropertySource.asAccount) SpecUtils(com.hedera.services.bdd.suites.utils.keypairs.SpecUtils) File(java.io.File) Key(com.hederahashgraph.api.proto.java.Key) Paths(java.nio.file.Paths) LogManager(org.apache.logging.log4j.LogManager) AccountKeyListObj(com.hedera.services.legacy.core.AccountKeyListObj) ByteString(com.google.protobuf.ByteString) Properties(java.util.Properties) IOException(java.io.IOException) ServicesConfigurationList(com.hederahashgraph.api.proto.java.ServicesConfigurationList) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation) File(java.io.File)

Aggregations

Key (com.hederahashgraph.api.proto.java.Key)43 ByteString (com.google.protobuf.ByteString)20 Test (org.junit.jupiter.api.Test)20 ThresholdKey (com.hederahashgraph.api.proto.java.ThresholdKey)14 KeyList (com.hederahashgraph.api.proto.java.KeyList)12 List (java.util.List)12 ArrayList (java.util.ArrayList)10 HapiApiSpec (com.hedera.services.bdd.spec.HapiApiSpec)8 PrivateKey (java.security.PrivateKey)8 Optional (java.util.Optional)7 LogManager (org.apache.logging.log4j.LogManager)7 Logger (org.apache.logging.log4j.Logger)7 HapiApiSuite (com.hedera.services.bdd.suites.HapiApiSuite)6 IOException (java.io.IOException)6 Map (java.util.Map)6 MoreObjects (com.google.common.base.MoreObjects)5 AccountID (com.hederahashgraph.api.proto.java.AccountID)5 HederaFunctionality (com.hederahashgraph.api.proto.java.HederaFunctionality)5 Transaction (com.hederahashgraph.api.proto.java.Transaction)5 TransactionBody (com.hederahashgraph.api.proto.java.TransactionBody)5