Search in sources :

Example 26 with InvalidTransactionException

use of com.hedera.services.exceptions.InvalidTransactionException in project hedera-services by hashgraph.

the class TokenGrantKycTransitionLogicTest method capturesInvalidGrantKyc.

@Test
void capturesInvalidGrantKyc() {
    givenValidTxnCtx();
    // and:
    doThrow(new InvalidTransactionException(TOKEN_HAS_NO_KYC_KEY)).when(tokenRelationship).changeKycState(true);
    // then:
    assertFailsWith(() -> subject.doStateTransition(), TOKEN_HAS_NO_KYC_KEY);
    verify(tokenStore, never()).commitTokenRelationships(List.of(tokenRelationship));
}
Also used : InvalidTransactionException(com.hedera.services.exceptions.InvalidTransactionException) Test(org.junit.jupiter.api.Test)

Aggregations

InvalidTransactionException (com.hedera.services.exceptions.InvalidTransactionException)26 Test (org.junit.jupiter.api.Test)24 TransactionID (com.hederahashgraph.api.proto.java.TransactionID)4 JContractIDKey (com.hedera.services.legacy.core.jproto.JContractIDKey)1 JEd25519Key (com.hedera.services.legacy.core.jproto.JEd25519Key)1 HederaWorldState (com.hedera.services.store.contracts.HederaWorldState)1 HederaWorldUpdater (com.hedera.services.store.contracts.HederaWorldUpdater)1 Key (com.hederahashgraph.api.proto.java.Key)1 ArrayDeque (java.util.ArrayDeque)1 Map (java.util.Map)1 Bytes (org.apache.tuweni.bytes.Bytes)1 Address (org.hyperledger.besu.datatypes.Address)1 Wei (org.hyperledger.besu.datatypes.Wei)1 Gas (org.hyperledger.besu.evm.Gas)1 MutableAccount (org.hyperledger.besu.evm.account.MutableAccount)1 MessageFrame (org.hyperledger.besu.evm.frame.MessageFrame)1