package com.wavesplatform.database

import com.google.common.primitives.Shorts

object KeyTags extends Enumeration {
  type KeyTag = Value
  val Version,
  Height,
  Score,
  HeightOf,
  WavesBalanceHistory,
  WavesBalance,
  AssetBalanceHistory,
  AssetBalance,
  AssetDetailsHistory,
  AssetDetails,
  LeaseBalanceHistory,
  LeaseBalance,
  LeaseStatusHistory,
  LeaseStatus,
  FilledVolumeAndFeeHistory,
  FilledVolumeAndFee,
  ChangedAddresses,
  ChangedAssetBalances,
  ChangedDataKeys,
  AddressIdOfAlias,
  LastAddressId,
  AddressId,
  IdToAddress,
  AddressScriptHistory,
  AddressScript,
  ApprovedFeatures,
  ActivatedFeatures,
  DataHistory,
  Data,
  SponsorshipHistory,
  Sponsorship,
  CarryFee,
  AssetScriptHistory,
  AssetScript,
  SafeRollbackHeight,
  BlockInfoAtHeight,
  NthTransactionInfoAtHeight,
  AddressTransactionSeqNr,
  AddressTransactionHeightTypeAndNums,
  TransactionMetaById,
  BlockTransactionsFee,
  InvokeScriptResult,
  BlockReward,
  WavesAmount,
  HitSource,
  DisabledAliases,
  AssetStaticInfo,
  NftCount,
  NftPossession,
  BloomFilterChecksum,
  IssuedAssets,
  UpdatedAssets,
  SponsoredAssets,
  StateHash = Value

  final implicit class KeyTagExt(val t: KeyTag) extends AnyVal {
    @inline def prefixBytes: Array[Byte] = Shorts.toByteArray(t.id.toShort)
  }
}
