Search in sources :

Example 16 with MerkleToken

use of com.hedera.services.state.merkle.MerkleToken in project hedera-services by hashgraph.

the class TokenMetaUtilsTest method classifiesRoyaltyWithNoFallback.

@Test
void classifiesRoyaltyWithNoFallback() {
    // setup:
    final var treasury = new EntityId(1, 2, 4);
    var royaltyFeeNoFallbackToken = new MerkleToken(Long.MAX_VALUE, 100, 1, "ZPHYR", "West Wind Art", false, true, treasury);
    royaltyFeeNoFallbackToken.setTokenType(NON_FUNGIBLE_UNIQUE);
    royaltyFeeNoFallbackToken.setFeeSchedule(List.of(FcCustomFee.royaltyFee(1, 2, null, new EntityId(1, 2, 5))));
    // given:
    final var meta = TokenMetaUtils.signingMetaFrom(royaltyFeeNoFallbackToken);
    // expect:
    assertFalse(meta.hasRoyaltyWithFallback());
    assertSame(treasury, meta.treasury());
}
Also used : EntityId(com.hedera.services.state.submerkle.EntityId) MerkleToken(com.hedera.services.state.merkle.MerkleToken) Test(org.junit.jupiter.api.Test)

Aggregations

MerkleToken (com.hedera.services.state.merkle.MerkleToken)16 Test (org.junit.jupiter.api.Test)9 EntityId (com.hedera.services.state.submerkle.EntityId)8 MerkleAccount (com.hedera.services.state.merkle.MerkleAccount)6 MerkleTokenRelStatus (com.hedera.services.state.merkle.MerkleTokenRelStatus)5 MerkleUniqueToken (com.hedera.services.state.merkle.MerkleUniqueToken)5 TransactionalLedger (com.hedera.services.ledger.TransactionalLedger)4 HashMapBackingAccounts (com.hedera.services.ledger.backing.HashMapBackingAccounts)4 HashMapBackingNfts (com.hedera.services.ledger.backing.HashMapBackingNfts)4 HashMapBackingTokenRels (com.hedera.services.ledger.backing.HashMapBackingTokenRels)4 HashMapBackingTokens (com.hedera.services.ledger.backing.HashMapBackingTokens)4 EntityNum (com.hedera.services.utils.EntityNum)3 AliasManager (com.hedera.services.ledger.accounts.AliasManager)2 StackedContractAliases (com.hedera.services.ledger.accounts.StackedContractAliases)2 NftId (com.hedera.services.store.models.NftId)2 AccountID (com.hederahashgraph.api.proto.java.AccountID)2 MerkleMap (com.swirlds.merkle.map.MerkleMap)2 ByteString (com.google.protobuf.ByteString)1 NetworkInfo (com.hedera.services.config.NetworkInfo)1 MutableStateChildren (com.hedera.services.context.MutableStateChildren)1