Search in sources :

Example 6 with FcTokenAllowanceId

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

the class SerializationUtils method deserializeNftAllowances.

public static Map<FcTokenAllowanceId, FcTokenAllowance> deserializeNftAllowances(final SerializableDataInputStream in) throws IOException {
    var numNftAllowances = in.readInt();
    if (numNftAllowances == 0) {
        return Collections.emptyMap();
    }
    final Map<FcTokenAllowanceId, FcTokenAllowance> nftAllowances = new TreeMap<>();
    while (numNftAllowances-- > 0) {
        final FcTokenAllowanceId nftAllowanceId = in.readSerializable();
        final FcTokenAllowance value = in.readSerializable();
        nftAllowances.put(nftAllowanceId, value);
    }
    return nftAllowances;
}
Also used : FcTokenAllowanceId(com.hedera.services.state.submerkle.FcTokenAllowanceId) FcTokenAllowance(com.hedera.services.state.submerkle.FcTokenAllowance) TreeMap(java.util.TreeMap)

Aggregations

FcTokenAllowanceId (com.hedera.services.state.submerkle.FcTokenAllowanceId)6 FcTokenAllowance (com.hedera.services.state.submerkle.FcTokenAllowance)4 EntityNum (com.hedera.services.utils.EntityNum)4 TreeMap (java.util.TreeMap)4 Test (org.junit.jupiter.api.Test)3 ArrayList (java.util.ArrayList)2 ByteString (com.google.protobuf.ByteString)1 MutableStateChildren (com.hedera.services.context.MutableStateChildren)1 StateView (com.hedera.services.context.primitives.StateView)1 HederaAccountCustomizer (com.hedera.services.ledger.accounts.HederaAccountCustomizer)1 JKey (com.hedera.services.legacy.core.jproto.JKey)1 JKeyList (com.hedera.services.legacy.core.jproto.JKeyList)1 MerkleAccount (com.hedera.services.state.merkle.MerkleAccount)1 MerkleAccountTokens (com.hedera.services.state.merkle.MerkleAccountTokens)1 MerkleToken (com.hedera.services.state.merkle.MerkleToken)1 MerkleTokenRelStatus (com.hedera.services.state.merkle.MerkleTokenRelStatus)1 EntityId (com.hedera.services.state.submerkle.EntityId)1 ExpirableTxnRecord (com.hedera.services.state.submerkle.ExpirableTxnRecord)1 AccountID (com.hederahashgraph.api.proto.java.AccountID)1 TokenID (com.hederahashgraph.api.proto.java.TokenID)1