Search in sources :

Example 1 with KeyLabel

use of com.hedera.services.bdd.spec.keys.KeyLabel in project hedera-services by hashgraph.

the class CryptoUpdateSuite method updateWithOneEffectiveSig.

private HapiApiSpec updateWithOneEffectiveSig() {
    KeyLabel ONE_UNIQUE_KEY = complex(complex("X", "X", "X", "X", "X", "X", "X"), complex("X", "X", "X", "X", "X", "X", "X"));
    SigControl SINGLE_SIG = KeyShape.threshSigs(2, KeyShape.threshSigs(1, OFF, OFF, OFF, OFF, OFF, OFF, OFF), KeyShape.threshSigs(3, OFF, OFF, OFF, ON, OFF, OFF, OFF));
    return defaultHapiSpec("UpdateWithOneEffectiveSig").given(newKeyNamed("repeatingKey").shape(TWO_LEVEL_THRESH).labels(ONE_UNIQUE_KEY), cryptoCreate(TARGET_ACCOUNT).key("repeatingKey").balance(1_000_000_000L)).when().then(cryptoUpdate(TARGET_ACCOUNT).sigControl(forKey("repeatingKey", SINGLE_SIG)).receiverSigRequired(true).hasKnownStatus(SUCCESS));
}
Also used : KeyLabel(com.hedera.services.bdd.spec.keys.KeyLabel) SigControl(com.hedera.services.bdd.spec.keys.SigControl)

Example 2 with KeyLabel

use of com.hedera.services.bdd.spec.keys.KeyLabel in project hedera-services by hashgraph.

the class OverlappingKeysSuite method feeCalcUsesNumPayerKeys.

private HapiApiSpec feeCalcUsesNumPayerKeys() {
    SigControl SHAPE = threshSigs(2, threshSigs(2, ANY, ANY, ANY), threshSigs(2, ANY, ANY, ANY));
    KeyLabel ONE_UNIQUE_KEY = complex(complex("X", "X", "X"), complex("X", "X", "X"));
    SigControl SIGN_ONCE = threshSigs(2, threshSigs(3, ON, OFF, OFF), threshSigs(3, OFF, OFF, OFF));
    return defaultHapiSpec("PayerSigRedundancyRecognized").given(newKeyNamed("repeatingKey").shape(SHAPE).labels(ONE_UNIQUE_KEY), cryptoCreate("testAccount").key("repeatingKey").balance(1_000_000_000L)).when().then(QueryVerbs.getAccountInfo("testAccount").sigControl(forKey("repeatingKey", SIGN_ONCE)).payingWith("testAccount").numPayerSigs(5).hasAnswerOnlyPrecheck(INSUFFICIENT_TX_FEE), QueryVerbs.getAccountInfo("testAccount").sigControl(forKey("repeatingKey", SIGN_ONCE)).payingWith("testAccount").numPayerSigs(6));
}
Also used : KeyLabel(com.hedera.services.bdd.spec.keys.KeyLabel) SigControl(com.hedera.services.bdd.spec.keys.SigControl)

Aggregations

KeyLabel (com.hedera.services.bdd.spec.keys.KeyLabel)2 SigControl (com.hedera.services.bdd.spec.keys.SigControl)2