Search in sources :

Example 1 with FixedFeeSpec

use of com.hedera.services.state.submerkle.FixedFeeSpec in project hedera-services by hashgraph.

the class TokenMetaUtilsTest method classifiesRoyaltyWithFallback.

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

Aggregations

MerkleToken (com.hedera.services.state.merkle.MerkleToken)1 EntityId (com.hedera.services.state.submerkle.EntityId)1 FixedFeeSpec (com.hedera.services.state.submerkle.FixedFeeSpec)1 Test (org.junit.jupiter.api.Test)1