Search in sources :

Example 1 with TokenAccountKey

use of com.hedera.mirror.common.domain.token.TokenAccountKey in project hedera-mirror-node by hashgraph.

the class SqlEntityListener method onTokenAccount.

@Override
public void onTokenAccount(TokenAccount tokenAccount) throws ImporterException {
    if (tokenAccounts.containsKey(tokenAccount.getId())) {
        log.warn("Skipping duplicate token account association: {}", tokenAccount);
        return;
    }
    var key = new TokenAccountKey(tokenAccount.getId().getTokenId(), tokenAccount.getId().getAccountId());
    TokenAccount merged = tokenAccountState.merge(key, tokenAccount, this::mergeTokenAccount);
    tokenAccounts.put(merged.getId(), merged);
}
Also used : TokenAccount(com.hedera.mirror.common.domain.token.TokenAccount) TokenAccountKey(com.hedera.mirror.common.domain.token.TokenAccountKey)

Aggregations

TokenAccount (com.hedera.mirror.common.domain.token.TokenAccount)1 TokenAccountKey (com.hedera.mirror.common.domain.token.TokenAccountKey)1