Documentation ¶
Index ¶
- Constants
- Variables
- func BuildPDEPoolForPairKey(beaconHeight uint64, token1IDStr string, token2IDStr string) []byte
- func BuildPDESharesKey(beaconHeight uint64, token1IDStr string, token2IDStr string, ...) ([]byte, error)
- func BuildPDESharesKeyV2(beaconHeight uint64, token1IDStr string, token2IDStr string, ...) ([]byte, error)
- func BuildPDETradeFeesKey(beaconHeight uint64, token1IDStr string, token2IDStr string, ...) []byte
- func BuildPDETradingFeeKey(beaconHeight uint64, token1IDStr string, token2IDStr string, ...) ([]byte, error)
- func BuildWaitingPDEContributionKey(beaconHeight uint64, pairID string) []byte
- func CleanUpPreviousBeaconBestState(db incdb.Database) error
- func CleanUpPreviousShardBestState(db incdb.Database, shardID byte) error
- func DeleteIndexedOTAKey(db incdb.Database, theKey []byte) error
- func DeleteTransactionIndex(db incdb.Database, txHash common.Hash) error
- func GetAllCacheCommitteeFromBlock(db incdb.Database) (map[int]map[common.Hash][]incognitokey.CommitteePublicKey, error)
- func GetBeaconBlockByHash(db incdb.KeyValueReader, hash common.Hash) ([]byte, error)
- func GetBeaconBlockHashToIndexKey(hash common.Hash) []byte
- func GetBeaconConfirmInstantFinalityShardBlock(db incdb.KeyValueReader, sid byte, index uint64) (*common.Hash, error)
- func GetBeaconConfirmShardBlockPrefix(shardID byte, index uint64) []byte
- func GetBeaconConsensusRootHashKey(height uint64) []byte
- func GetBeaconFeatureRootHashKey(height uint64) []byte
- func GetBeaconHashToBlockKey(hash common.Hash) []byte
- func GetBeaconIndexToBlockHashKey(index uint64) []byte
- func GetBeaconRewardRootHashKey(height uint64) []byte
- func GetBeaconRootsHash(db incdb.KeyValueReader, hash common.Hash) ([]byte, error)
- func GetBeaconRootsHashKey(hash common.Hash) []byte
- func GetBeaconSlashRootHashKey(height uint64) []byte
- func GetBeaconViews(db incdb.KeyValueReader) ([]byte, error)
- func GetBeaconViewsKey() []byte
- func GetBlockHashToFFIndexKey(hash common.Hash) []byte
- func GetBlockHashToValidationDataKey(hash common.Hash) []byte
- func GetCacheCommitteeFromBlock(db incdb.Database, hash common.Hash, cid int) ([]incognitokey.CommitteePublicKey, error)
- func GetCacheCommitteeFromBlockKey(hash common.Hash, cid int) []byte
- func GetCachedCoinHashes(db incdb.Database) ([][]byte, error)
- func GetCrossShardNextHeight(db incdb.KeyValueReader, fromShard byte, toShard byte, curHeight uint64) ([]byte, error)
- func GetCrossShardNextHeightKey(fromShard byte, toShard byte, height uint64) []byte
- func GetFeeEstimator(db incdb.KeyValueReader, shardID byte) ([]byte, error)
- func GetFeeEstimatorPrefix(shardID byte) []byte
- func GetFinalizedBeaconBlockHashByIndex(db incdb.KeyValueReader, index uint64) (*common.Hash, error)
- func GetFinalizedShardBlockHashByIndex(db incdb.KeyValueReader, sid byte, index uint64) (*common.Hash, error)
- func GetFlatFileIndexByBlockHash(db incdb.KeyValueReader, hash common.Hash) (uint64, error)
- func GetIndexedOTAKeys(db incdb.Database) ([][]byte, error)
- func GetLastBeaconBlockKey() []byte
- func GetLastBeaconHeightConfirmCrossShardKey() []byte
- func GetLastBeaconStateConfirmCrossShard(db incdb.Database) []byte
- func GetLastShardBlockKey(shardID byte) []byte
- func GetOutCoinsByIndexedOTAKey(db incdb.Database, tokenID common.Hash, shardID byte, publicKey []byte) ([][]byte, error)
- func GetPreviousBeaconBestState(db incdb.Database) ([]byte, error)
- func GetPreviousBestStateKey(shardID int) []byte
- func GetPreviousShardBestState(db incdb.Database, shardID byte) ([]byte, error)
- func GetPruneStatus(db incdb.KeyValueReader) ([]byte, error)
- func GetPruneStatusKey() []byte
- func GetRootHashPrefix() []byte
- func GetShardBestState(db incdb.KeyValueReader, shardID byte) ([]byte, error)
- func GetShardBestStateKey(shardID byte) []byte
- func GetShardBlockByHash(db incdb.KeyValueReader, hash common.Hash) ([]byte, error)
- func GetShardBlockHashToIndexKey(hash common.Hash) []byte
- func GetShardCommitteeRewardRootHashKey(shardID byte, height uint64) []byte
- func GetShardConsensusRootHashKey(shardID byte, height uint64) []byte
- func GetShardFeatureRootHashKey(shardID byte, height uint64) []byte
- func GetShardHashToBlockKey(hash common.Hash) []byte
- func GetShardIndexToBlockHashKey(shardID byte, index uint64, hash common.Hash) []byte
- func GetShardIndexToBlockHashPrefix(shardID byte, index uint64) []byte
- func GetShardRootsHash(db incdb.KeyValueReader, shardID byte, hash common.Hash) ([]byte, error)
- func GetShardRootsHashKey(shardID byte, hash common.Hash) []byte
- func GetShardRootsHashPrefix(shardID byte) []byte
- func GetShardSlashRootHashKey(shardID byte, height uint64) []byte
- func GetShardTransactionRootHashKey(shardID byte, height uint64) []byte
- func GetStakingTx(db incdb.KeyValueReader, sid byte, hash common.Hash) ([]byte, error)
- func GetStakingTxKey(shardID byte, hash common.Hash) []byte
- func GetStoreTxByPublicKey(publicKey []byte, txID common.Hash, shardID byte) []byte
- func GetStoreTxByPublicPrefix(publicKey []byte) []byte
- func GetTransactionByHash(db incdb.Database, txHash common.Hash) (common.Hash, int, error)
- func GetTransactionHashKey(hash common.Hash) []byte
- func GetTxByCoinIndex(db incdb.Database, index []byte, tokenID common.Hash, shardID byte) (*common.Hash, error)
- func GetTxByPublicKey(db incdb.Database, publicKey []byte) (map[byte][]common.Hash, error)
- func GetTxByPublicKeyV2(db incdb.Database, publicKey []byte, skip, limit uint) (map[byte][]common.Hash, uint, uint, error)
- func GetTxBySerialNumber(db incdb.Database, serialNumber []byte, tokenID common.Hash, shardID byte) (*common.Hash, error)
- func GetValidationDataByBlockHash(db incdb.KeyValueReader, hash common.Hash) ([]byte, error)
- func GetViewBeaconKey(view common.Hash, height uint64) []byte
- func GetViewPrefixWithValue(view common.Hash) []byte
- func GetViewShardKey(view common.Hash, shardID byte, height uint64) []byte
- func HasBeaconBlock(db incdb.KeyValueReader, hash common.Hash) (bool, error)
- func HasBeaconConfirmInstantFinalityShardBlock(db incdb.KeyValueReader, sid byte, index uint64) (bool, error)
- func HasShardBlock(db incdb.KeyValueReader, hash common.Hash) (bool, error)
- func RestoreCrossShardNextHeights(db incdb.Database, fromShard byte, toShard byte, curHeight uint64) error
- func StoreBeaconBlockByHash(db incdb.KeyValueWriter, hash common.Hash, v interface{}) error
- func StoreBeaconConfirmInstantFinalityShardBlock(db incdb.KeyValueWriter, sid byte, index uint64, hash common.Hash) error
- func StoreBeaconRootsHash(db incdb.KeyValueWriter, hash common.Hash, rootsHash interface{}) error
- func StoreBeaconViews(db incdb.KeyValueWriter, val []byte) error
- func StoreCacheCommitteeFromBlock(db incdb.KeyValueWriter, hash common.Hash, cid int, ...) error
- func StoreCachedCoinHash(db incdb.Database, theCoinHash []byte) error
- func StoreCrossShardNextHeight(db incdb.KeyValueWriter, fromShard byte, toShard byte, curHeight uint64, ...) error
- func StoreFeeEstimator(db incdb.KeyValueWriter, val []byte, shardID byte) error
- func StoreFinalizedBeaconBlockHashByIndex(db incdb.KeyValueWriter, index uint64, hash common.Hash) error
- func StoreFinalizedShardBlockHashByIndex(db incdb.KeyValueWriter, sid byte, index uint64, hash common.Hash) error
- func StoreFlatFileIndexByBlockHash(db incdb.KeyValueWriter, hash common.Hash, index uint64) error
- func StoreIndexedOTAKey(db incdb.Database, theKey []byte, state int) error
- func StoreIndexedOutCoins(db incdb.Database, tokenID common.Hash, publicKey []byte, outputCoins [][]byte, ...) error
- func StoreLastBeaconStateConfirmCrossShard(db incdb.Database, state interface{}) error
- func StorePreviousBeaconBestState(db incdb.Database, data []byte) error
- func StorePreviousShardBestState(db incdb.Database, shardID byte, data []byte) error
- func StorePruneStatus(db incdb.KeyValueWriter, v []byte) error
- func StoreShardBestState(db incdb.KeyValueWriter, shardID byte, v interface{}) error
- func StoreShardBlock(db incdb.KeyValueWriter, hash common.Hash, v interface{}) error
- func StoreShardRootsHash(db incdb.KeyValueWriter, shardID byte, hash common.Hash, rootsHash interface{}) error
- func StoreStakingTx(db incdb.KeyValueWriter, sid byte, hash common.Hash, data []byte) error
- func StoreTransactionIndex(db incdb.KeyValueWriter, txHash common.Hash, blockHash common.Hash, index int) error
- func StoreTxByCoinIndex(db incdb.Database, index []byte, tokenID common.Hash, shardID byte, ...) error
- func StoreTxByPublicKey(db incdb.Database, publicKey []byte, txID common.Hash, shardID byte) error
- func StoreTxBySerialNumber(db incdb.Database, serialNumber []byte, tokenID common.Hash, shardID byte, ...) error
- func StoreValidationDataByBlockHash(db incdb.KeyValueWriter, hash common.Hash, val []byte) error
- type BridgeTokenInfo
- type PDEContribution
- type PDEPoolForPair
- type Pdexv3Contribution
- func (contribution *Pdexv3Contribution) Amount() uint64
- func (contribution *Pdexv3Contribution) Amplifier() uint
- func (contribution *Pdexv3Contribution) Clone() *Pdexv3Contribution
- func (contribution *Pdexv3Contribution) MarshalJSON() ([]byte, error)
- func (contribution *Pdexv3Contribution) NftID() common.Hash
- func (contribution *Pdexv3Contribution) OtaReceiver() string
- func (contribution *Pdexv3Contribution) PoolPairID() string
- func (contribution *Pdexv3Contribution) SetAmount(amount uint64)
- func (contribution *Pdexv3Contribution) ShardID() byte
- func (contribution *Pdexv3Contribution) TokenID() common.Hash
- func (contribution *Pdexv3Contribution) TxReqID() common.Hash
- func (contribution *Pdexv3Contribution) UnmarshalJSON(data []byte) error
- type Pdexv3Order
- func (o *Pdexv3Order) Clone() *Pdexv3Order
- func (o *Pdexv3Order) Id() string
- func (o *Pdexv3Order) MarshalJSON() ([]byte, error)
- func (o *Pdexv3Order) NftID() common.Hash
- func (o *Pdexv3Order) SetToken0Balance(b uint64)
- func (o *Pdexv3Order) SetToken1Balance(b uint64)
- func (o *Pdexv3Order) Token0Balance() uint64
- func (o *Pdexv3Order) Token0Rate() uint64
- func (o *Pdexv3Order) Token0Receiver() string
- func (o *Pdexv3Order) Token1Balance() uint64
- func (o *Pdexv3Order) Token1Rate() uint64
- func (o *Pdexv3Order) Token1Receiver() string
- func (o *Pdexv3Order) TradeDirection() byte
- func (o *Pdexv3Order) UnmarshalJSON(data []byte) error
- type Pdexv3PoolPair
- func (pp *Pdexv3PoolPair) Amplifier() uint
- func (pp *Pdexv3PoolPair) Clone() *Pdexv3PoolPair
- func (pp *Pdexv3PoolPair) LmLockedShareAmount() uint64
- func (pp *Pdexv3PoolPair) MarshalJSON() ([]byte, error)
- func (pp *Pdexv3PoolPair) SetLmLockedShareAmount(lmLockedShareAmount uint64)
- func (pp *Pdexv3PoolPair) SetShareAmount(shareAmount uint64)
- func (pp *Pdexv3PoolPair) SetToken0RealAmount(amount uint64)
- func (pp *Pdexv3PoolPair) SetToken0VirtualAmount(amount *big.Int)
- func (pp *Pdexv3PoolPair) SetToken1RealAmount(amount uint64)
- func (pp *Pdexv3PoolPair) SetToken1VirtualAmount(amount *big.Int)
- func (pp *Pdexv3PoolPair) ShareAmount() uint64
- func (pp *Pdexv3PoolPair) Token0ID() common.Hash
- func (pp *Pdexv3PoolPair) Token0RealAmount() uint64
- func (pp *Pdexv3PoolPair) Token0VirtualAmount() *big.Int
- func (pp *Pdexv3PoolPair) Token1ID() common.Hash
- func (pp *Pdexv3PoolPair) Token1RealAmount() uint64
- func (pp *Pdexv3PoolPair) Token1VirtualAmount() *big.Int
- func (pp *Pdexv3PoolPair) UnmarshalJSON(data []byte) error
- type RawdbError
Constants ¶
const ( // Beacon StoreBeaconBlockError = iota StoreBeaconBlockWithViewError UpdateBeaconBlockViewError GetBeaconBlockByViewError DeleteBeaconBlockByViewError StoreBeaconBlockIndexError GetIndexOfBeaconBlockError HasBeaconBlockError GetBeaconBlockByHashError GetBeaconBlockByIndexError DeleteBeaconBlockError StoreBeaconBestStateError GetBeaconBestStateError FinalizedBeaconBlockError GetFinalizedBeaconBlockError StoreBeaconConsensusRootHashError GetBeaconConsensusRootHashError StoreBeaconRewardRootHashError GetBeaconRewardRootHashError StoreBeaconFeatureRootHashError GetBeaconFeatureRootHashError StoreBeaconSlashRootHashError GetBeaconSlashRootHashError StoreShardCommitteeRewardRootHashError GetShardCommitteeRewardRootHashError DeleteShardCommitteeRewardRootHashError StoreShardConsensusRootHashError GetShardConsensusRootHashError DeleteShardConsensusRootHashError StoreShardTransactionRootHashError GetShardTransactionRootHashError DeleteShardTransactionRootHashError StoreShardFeatureRootHashError GetShardFeatureRootHashError DeleteShardFeatureRootHashError StoreShardSlashRootHashError GetShardSlashRootHashError DeleteShardSlashRootHashError StorePreviousBeaconBestStateError GetPreviousBeaconBestStateError CleanUpPreviousBeaconBestStateError StoreBeaconPreCommitteeError StoreBeaconPreCommitteeInfoError GetBeaconPreCommitteeInfoError GetShardPendingValidatorsError // Shard StoreShardBlockError StoreShardBlockWithViewError UpdateShardBlockViewError GetShardBlockByViewError DeleteShardBlockByViewError FinalizedShardBlockError GetFinalizedShardBlockError StoreShardBlockIndexError HasShardBlockError GetShardBlockByHashError GetShardBlockByIndexError DeleteShardBlockError StoreCrossShardNextHeightError FetchCrossShardNextHeightError GetIndexOfBlockError StoreShardBestStateError StoreFeeEstimatorError GetFeeEstimatorError StorePreviousShardBestStateError GetPreviousShardBestStateError CleanUpPreviousShardBestStateError RestoreCrossShardNextHeightsError StoreShardPreCommitteeError // tx StoreTransactionIndexError GetTransactionByHashError DeleteTransactionByHashError StoreTxByPublicKeyError GetTxByPublicKeyError // relaying - portal StoreRelayingBNBHeaderError GetRelayingBNBHeaderError GetBNBDataHashError // output coins by OTA key StoreOutcoinByOTAKeyError GetOutcoinByOTAKeyError StoreOTAKeyError DeleteOTAKeyError GetOTAKeyError StoreCoinHashError GetCoinHashError //Tx by input or output StoreTxByCoinIndexError GetTxByCoinIndexError StoreTxBySerialNumberError GetTxBySerialNumberError // state prune StoreShardPruneStatusError //cache committee from block hash StoreCommmitteeFromBlockCacheError GetCommmitteeFromBlockCacheError StoreFFIndexError GetFFIndexError StoreShardStakingTx GetShardStakingTx )
Variables ¶
var ( // PDE WaitingPDEContributionPrefix = []byte("waitingpdecontribution-") PDEPoolPrefix = []byte("pdepool-") PDETradingFeePrefix = []byte("pdetradingfee-") PDETradeFeePrefix = []byte("pdetradefee-") PDEContributionStatusPrefix = []byte("pdecontributionstatus-") PDETradeStatusPrefix = []byte("pdetradestatus-") PDEWithdrawalStatusPrefix = []byte("pdewithdrawalstatus-") PDEFeeWithdrawalStatusPrefix = []byte("pdefeewithdrawalstatus-") )
key prefix
var ErrCodeMessage = map[int]struct { Code int message string }{ HasBeaconBlockError: {-1000, "Has Beacon Block Error"}, GetBeaconBlockByHashError: {-1001, "Get Beacon Block By Hash Error"}, GetBeaconBlockByIndexError: {-1002, "Get Beacon Block By Index Error"}, DeleteBeaconBlockError: {-1003, "Delete Beacon Block Error"}, StoreBeaconBlockIndexError: {-1004, "Store Beacon Block Index Error"}, GetIndexOfBeaconBlockError: {-1005, "Get Index Of Beacon Block Error"}, StoreBeaconBestStateError: {-1006, "Store Beacon Best State Error"}, GetBeaconBestStateError: {-1007, "Fetch Beacon Best State Error"}, StoreBeaconBlockWithViewError: {-1008, "Store Beacon Block With View Error"}, UpdateBeaconBlockViewError: {-1009, "Update Beacon Block View Error"}, GetBeaconBlockByViewError: {-1010, "Get Beacon Block By View Error"}, DeleteBeaconBlockByViewError: {-1011, "Delete Beacon Block By View"}, FinalizedBeaconBlockError: {-2016, "Finalized Beacon Block Error "}, GetFinalizedBeaconBlockError: {-2017, "Get Finalized Beacon Block Error"}, StoreShardBlockError: {-2000, "Store Shard Block Error"}, HasShardBlockError: {-2001, "Has Shard Block Error"}, GetShardBlockByHashError: {-2002, "Get Shard Block By Hash Error"}, GetShardBlockByIndexError: {-2003, "Get Shard Block By Index Error"}, DeleteShardBlockError: {-2004, "Delete Shard Block Error"}, StoreCrossShardNextHeightError: {-2005, "Store Cross Shard Next Height Error"}, FetchCrossShardNextHeightError: {-2006, "Fetch Cross Shard Next Height Error"}, StoreShardBlockIndexError: {-2007, "Store Shard Block Index Error"}, GetIndexOfBlockError: {-2008, "Get GetIndex Of Shard Block Error"}, StoreShardBestStateError: {-2009, "Store Shard Best State Error"}, StoreFeeEstimatorError: {-2010, "Store Fee Estimator Error"}, GetFeeEstimatorError: {-2011, "Get Fee Estimator Error"}, StoreShardBlockWithViewError: {-2012, "Store Shard Block With View Error"}, UpdateShardBlockViewError: {-2013, "Update Shard Block View Error"}, GetShardBlockByViewError: {-2014, "Get Shard Block By View Error"}, DeleteShardBlockByViewError: {-2015, "Delete Shard Block By View"}, FinalizedShardBlockError: {-2016, "Finalized Shard Block Error "}, GetFinalizedShardBlockError: {-2017, "Get Finalized Shard Block Error"}, StoreTransactionIndexError: {-3000, "Store Transaction Index Error"}, GetTransactionByHashError: {-3001, "Get Transaction By Hash Error"}, StoreTxByPublicKeyError: {-3002, "Store Tx By PublicKey Error"}, GetTxByPublicKeyError: {-3003, "Get Tx By Public Key Error"}, DeleteTransactionByHashError: {-3004, "Delete Transaction By Hash Error"}, StoreBeaconConsensusRootHashError: {-4000, "Store Beacon Consensus Root Hash Error"}, GetBeaconConsensusRootHashError: {-4001, "Get Beacon Consensus Root Hash Error"}, StoreBeaconRewardRootHashError: {-4002, "Store Beacon Reward Root Hash Error"}, GetBeaconRewardRootHashError: {-4003, "Get Beacon Reward Root Hash Error"}, StoreBeaconFeatureRootHashError: {-4004, "Store Beacon Feature Root Hash Error"}, GetBeaconFeatureRootHashError: {-4005, "Get Beacon Feature Root Hash Error"}, StoreBeaconSlashRootHashError: {-4006, "Store Beacon Slash Root Hash Error"}, GetBeaconSlashRootHashError: {-4007, "Get Beacon Slash Root Hash Error"}, StoreShardCommitteeRewardRootHashError: {-4008, "Store Shard Committee Reward Root Hash Error"}, GetShardCommitteeRewardRootHashError: {-4009, "Get Shard Committee Reward Root Hash Error"}, StoreShardConsensusRootHashError: {-4010, "Store Shard Consensus Root Hash Error"}, GetShardConsensusRootHashError: {-4011, "Get Shard Consensus Root Hash Error"}, StoreShardTransactionRootHashError: {-4012, "Store Shard Transaction Root Hash Error"}, GetShardTransactionRootHashError: {-4013, "Get Shard Transaction Root Hash Error"}, StoreShardFeatureRootHashError: {-4014, "Store Shard Feature Root Hash Error"}, GetShardFeatureRootHashError: {-4015, "Get Shard Feature Root Hash Error"}, StoreShardSlashRootHashError: {-4016, "Store Shard Slash Root Hash Error"}, GetShardSlashRootHashError: {-4017, "Get Shard Slash Root Hash Error"}, StorePreviousBeaconBestStateError: {-4018, "Store Previous Beacon Best State Error"}, GetPreviousBeaconBestStateError: {-4019, "Get Previous Beacon Best State Error"}, CleanUpPreviousBeaconBestStateError: {-4020, "Clean Previous Beacon Best State Error"}, StorePreviousShardBestStateError: {-4021, "Store Previous Shard Best State Error"}, GetPreviousShardBestStateError: {-4022, "Get Previous Shard Best State Error"}, CleanUpPreviousShardBestStateError: {-4023, "Clean Previous Shard Best State Error"}, DeleteShardCommitteeRewardRootHashError: {-4024, "Delete Shard Committee Reward Root Hash Error"}, DeleteShardConsensusRootHashError: {-4025, "Delete Shard Consensus Root Hash Error"}, DeleteShardTransactionRootHashError: {-4026, "Delete Shard Transaction Root Hash Error"}, DeleteShardFeatureRootHashError: {-4027, "Delete Shard Feature Root Hash Error"}, DeleteShardSlashRootHashError: {-4028, "Delete Shard Slash Root Hash Error"}, RestoreCrossShardNextHeightsError: {-4029, "Restore Cross Shard Next Heights Error"}, StoreBeaconPreCommitteeError: {-4030, "Store Beacon Pre Committee Error"}, StoreBeaconPreCommitteeInfoError: {-4031, "Store Beacon Pre Committee Info Error"}, GetBeaconPreCommitteeInfoError: {-4032, "Get Beacon Pre Committee Info Error"}, GetShardPendingValidatorsError: {-4033, "Get Shard Pending Validators Error"}, StoreRelayingBNBHeaderError: {-5001, "Store relaying header bnb error"}, GetRelayingBNBHeaderError: {-5002, "Get relaying header bnb error"}, GetBNBDataHashError: {-5003, "Get bnb data hash by block height error"}, StoreOutcoinByOTAKeyError: {-6001, "Store output coin by OTA key error"}, GetOutcoinByOTAKeyError: {-6002, "Get output coin by OTA key error"}, StoreOTAKeyError: {-6003, "Store OTA key error"}, GetOTAKeyError: {-6004, "Get OTA keys error"}, DeleteOTAKeyError: {-6005, "Delete OTA keys error"}, StoreCoinHashError: {-6006, "Store coin hash error"}, GetCoinHashError: {-6007, "Get coin hash error"}, StoreShardPruneStatusError: {-7001, "Store shard prune status error"}, StoreCommmitteeFromBlockCacheError: {-7002, "Store shard prune status error"}, GetCommmitteeFromBlockCacheError: {-7003, "Get shard prune status error"}, StoreFFIndexError: {-7004, "Store FF Index error"}, GetFFIndexError: {-7005, "Get FF Index error"}, StoreShardStakingTx: {-7006, "Store shard stakign error"}, GetShardStakingTx: {-7007, "Get shard staking error"}, }
Functions ¶
func BuildPDEPoolForPairKey ¶
func BuildPDESharesKey ¶
func BuildPDESharesKeyV2 ¶
func BuildPDETradeFeesKey ¶
func BuildPDETradingFeeKey ¶
func DeleteTransactionIndex ¶
func GetAllCacheCommitteeFromBlock ¶
func GetAllCacheCommitteeFromBlock(db incdb.Database) (map[int]map[common.Hash][]incognitokey.CommitteePublicKey, error)
func GetBeaconBlockByHash ¶
func GetBeaconHashToBlockKey ¶
============================= BEACON =======================================
func GetBeaconRootsHash ¶
func GetBeaconRootsHashKey ¶
func GetBeaconViews ¶
func GetBeaconViews(db incdb.KeyValueReader) ([]byte, error)
func GetBeaconViewsKey ¶
func GetBeaconViewsKey() []byte
func GetCacheCommitteeFromBlock ¶
func GetCacheCommitteeFromBlock(db incdb.Database, hash common.Hash, cid int) ([]incognitokey.CommitteePublicKey, error)
func GetCrossShardNextHeight ¶
func GetCrossShardNextHeightKey ¶
============================= Cross Shard =======================================
func GetFeeEstimator ¶
func GetFeeEstimator(db incdb.KeyValueReader, shardID byte) ([]byte, error)
GetFeeEstimator - Get data for FeeEstimator object as a json in byte format
func GetFeeEstimatorPrefix ¶
func GetLastBeaconBlockKey ¶
func GetLastBeaconBlockKey() []byte
func GetLastBeaconHeightConfirmCrossShardKey ¶
func GetLastBeaconHeightConfirmCrossShardKey() []byte
func GetLastShardBlockKey ¶
func GetPreviousBestStateKey ¶
func GetPruneStatus ¶
func GetPruneStatus(db incdb.KeyValueReader) ([]byte, error)
func GetPruneStatusKey ¶
func GetPruneStatusKey() []byte
func GetRootHashPrefix ¶
func GetRootHashPrefix() []byte
============================= State Root =======================================
func GetShardBestState ¶
func GetShardBestState(db incdb.KeyValueReader, shardID byte) ([]byte, error)
func GetShardBestStateKey ¶
func GetShardBlockByHash ¶
func GetShardHashToBlockKey ¶
============================= Shard =======================================
func GetShardRootsHash ¶
func GetShardRootsHashPrefix ¶
func GetStakingTx ¶
func GetStoreTxByPublicKey ¶
func GetTransactionByHash ¶
func GetTransactionHashKey ¶
============================= Transaction =======================================
func GetTxByCoinIndex ¶
func GetTxByPublicKey ¶
GetTxByPublicKey - from public key, use this function to get list all txID which someone send use by txID from any shardID
func GetTxByPublicKeyV2 ¶
func GetTxByPublicKeyV2( db incdb.Database, publicKey []byte, skip, limit uint, ) (map[byte][]common.Hash, uint, uint, error)
GetTxByPublicKeyV2 returns list of all tx IDs in paging fashion for a given public key
func GetTxBySerialNumber ¶
func GetViewPrefixWithValue ¶
============================= View =======================================
func HasBeaconBlock ¶
func HasShardBlock ¶
func StoreBeaconBlockByHash ¶
func StoreBeaconBlockByHash(db incdb.KeyValueWriter, hash common.Hash, v interface{}) error
StoreBeaconBlock store block hash => block value
func StoreBeaconRootsHash ¶
func StoreBeaconRootsHash(db incdb.KeyValueWriter, hash common.Hash, rootsHash interface{}) error
func StoreBeaconViews ¶
func StoreBeaconViews(db incdb.KeyValueWriter, val []byte) error
func StoreCacheCommitteeFromBlock ¶
func StoreCacheCommitteeFromBlock(db incdb.KeyValueWriter, hash common.Hash, cid int, cpks []incognitokey.CommitteePublicKey) error
func StoreFeeEstimator ¶
func StoreFeeEstimator(db incdb.KeyValueWriter, val []byte, shardID byte) error
StoreFeeEstimator - Store data for FeeEstimator object
func StoreFlatFileIndexByBlockHash ¶
store block hash => block value
func StoreIndexedOTAKey ¶
func StoreIndexedOutCoins ¶
func StorePruneStatus ¶
func StorePruneStatus(db incdb.KeyValueWriter, v []byte) error
func StoreShardBestState ¶
func StoreShardBestState(db incdb.KeyValueWriter, shardID byte, v interface{}) error
func StoreShardBlock ¶
func StoreShardBlock(db incdb.KeyValueWriter, hash common.Hash, v interface{}) error
StoreShardBlock store block hash => block value and block index => block hash record1: prefix-shardid-index-hash => empty record2: prefix-hash => block value
func StoreShardRootsHash ¶
func StoreStakingTx ¶
func StoreTransactionIndex ¶
func StoreTxByCoinIndex ¶
func StoreTxByCoinIndex(db incdb.Database, index []byte, tokenID common.Hash, shardID byte, txID common.Hash) error
These functions are used for storing and getting a transaction by an output coin index TODO: refactor these functions for more efficient read/write
func StoreTxByPublicKey ¶
StoreTxByPublicKey - store txID by public key of receiver, use this data to get tx which send to receiver key format: 1st 33b bytes for pubkey 2nd 32 bytes fir txID which receiver get from 3nd 1 byte for shardID where sender send to receiver
func StoreTxBySerialNumber ¶
func StoreTxBySerialNumber(db incdb.Database, serialNumber []byte, tokenID common.Hash, shardID byte, txID common.Hash) error
These functions are used for storing/retrieving a transaction by an input coin serial number TODO: refactor these functions for more efficient read/write
func StoreValidationDataByBlockHash ¶
store block hash => validation data
Types ¶
type BridgeTokenInfo ¶
type BridgeTokenInfo struct { TokenID *common.Hash `json:"tokenId"` Amount uint64 `json:"amount"` ExternalTokenID []byte `json:"externalTokenId"` Network string `json:"network"` IsCentralized bool `json:"isCentralized"` }
TODO - change json to CamelCase
func NewBridgeTokenInfo ¶
type PDEContribution ¶
type PDEContribution struct { ContributorAddressStr string TokenIDStr string Amount uint64 TxReqID common.Hash }
func NewPDEContribution ¶
type PDEPoolForPair ¶
type PDEPoolForPair struct { Token1IDStr string Token1PoolValue uint64 Token2IDStr string Token2PoolValue uint64 }
func NewPDEPoolForPair ¶
func NewPDEPoolForPair(token1IDStr string, token1PoolValue uint64, token2IDStr string, token2PoolValue uint64) *PDEPoolForPair
type Pdexv3Contribution ¶
type Pdexv3Contribution struct {
// contains filtered or unexported fields
}
Pdexv3Contribution Real data store to statedb
func NewPdexv3Contribution ¶
func NewPdexv3Contribution() *Pdexv3Contribution
func (*Pdexv3Contribution) Amount ¶
func (contribution *Pdexv3Contribution) Amount() uint64
func (*Pdexv3Contribution) Amplifier ¶
func (contribution *Pdexv3Contribution) Amplifier() uint
func (*Pdexv3Contribution) Clone ¶
func (contribution *Pdexv3Contribution) Clone() *Pdexv3Contribution
func (*Pdexv3Contribution) MarshalJSON ¶
func (contribution *Pdexv3Contribution) MarshalJSON() ([]byte, error)
func (*Pdexv3Contribution) NftID ¶
func (contribution *Pdexv3Contribution) NftID() common.Hash
func (*Pdexv3Contribution) OtaReceiver ¶
func (contribution *Pdexv3Contribution) OtaReceiver() string
func (*Pdexv3Contribution) PoolPairID ¶
func (contribution *Pdexv3Contribution) PoolPairID() string
func (*Pdexv3Contribution) SetAmount ¶
func (contribution *Pdexv3Contribution) SetAmount(amount uint64)
func (*Pdexv3Contribution) ShardID ¶
func (contribution *Pdexv3Contribution) ShardID() byte
func (*Pdexv3Contribution) TokenID ¶
func (contribution *Pdexv3Contribution) TokenID() common.Hash
func (*Pdexv3Contribution) TxReqID ¶
func (contribution *Pdexv3Contribution) TxReqID() common.Hash
func (*Pdexv3Contribution) UnmarshalJSON ¶
func (contribution *Pdexv3Contribution) UnmarshalJSON(data []byte) error
type Pdexv3Order ¶
type Pdexv3Order struct {
// contains filtered or unexported fields
}
func NewPdexv3OrderWithValue ¶
func (*Pdexv3Order) Clone ¶
func (o *Pdexv3Order) Clone() *Pdexv3Order
func (*Pdexv3Order) Id ¶
func (o *Pdexv3Order) Id() string
func (*Pdexv3Order) MarshalJSON ¶
func (o *Pdexv3Order) MarshalJSON() ([]byte, error)
func (*Pdexv3Order) NftID ¶
func (o *Pdexv3Order) NftID() common.Hash
func (*Pdexv3Order) SetToken0Balance ¶
func (o *Pdexv3Order) SetToken0Balance(b uint64)
SetToken0Balance() changes the token0 balance of this order. Only balances can be updated, while rates, id & trade direction cannot
func (*Pdexv3Order) SetToken1Balance ¶
func (o *Pdexv3Order) SetToken1Balance(b uint64)
func (*Pdexv3Order) Token0Balance ¶
func (o *Pdexv3Order) Token0Balance() uint64
func (*Pdexv3Order) Token0Rate ¶
func (o *Pdexv3Order) Token0Rate() uint64
func (*Pdexv3Order) Token0Receiver ¶
func (o *Pdexv3Order) Token0Receiver() string
func (*Pdexv3Order) Token1Balance ¶
func (o *Pdexv3Order) Token1Balance() uint64
func (*Pdexv3Order) Token1Rate ¶
func (o *Pdexv3Order) Token1Rate() uint64
func (*Pdexv3Order) Token1Receiver ¶
func (o *Pdexv3Order) Token1Receiver() string
func (*Pdexv3Order) TradeDirection ¶
func (o *Pdexv3Order) TradeDirection() byte
func (*Pdexv3Order) UnmarshalJSON ¶
func (o *Pdexv3Order) UnmarshalJSON(data []byte) error
type Pdexv3PoolPair ¶
type Pdexv3PoolPair struct {
// contains filtered or unexported fields
}
func NewPdexv3PoolPair ¶
func NewPdexv3PoolPair() *Pdexv3PoolPair
func (*Pdexv3PoolPair) Amplifier ¶
func (pp *Pdexv3PoolPair) Amplifier() uint
func (*Pdexv3PoolPair) Clone ¶
func (pp *Pdexv3PoolPair) Clone() *Pdexv3PoolPair
func (*Pdexv3PoolPair) LmLockedShareAmount ¶
func (pp *Pdexv3PoolPair) LmLockedShareAmount() uint64
func (*Pdexv3PoolPair) MarshalJSON ¶
func (pp *Pdexv3PoolPair) MarshalJSON() ([]byte, error)
func (*Pdexv3PoolPair) SetLmLockedShareAmount ¶
func (pp *Pdexv3PoolPair) SetLmLockedShareAmount(lmLockedShareAmount uint64)
func (*Pdexv3PoolPair) SetShareAmount ¶
func (pp *Pdexv3PoolPair) SetShareAmount(shareAmount uint64)
func (*Pdexv3PoolPair) SetToken0RealAmount ¶
func (pp *Pdexv3PoolPair) SetToken0RealAmount(amount uint64)
func (*Pdexv3PoolPair) SetToken0VirtualAmount ¶
func (pp *Pdexv3PoolPair) SetToken0VirtualAmount(amount *big.Int)
func (*Pdexv3PoolPair) SetToken1RealAmount ¶
func (pp *Pdexv3PoolPair) SetToken1RealAmount(amount uint64)
func (*Pdexv3PoolPair) SetToken1VirtualAmount ¶
func (pp *Pdexv3PoolPair) SetToken1VirtualAmount(amount *big.Int)
func (*Pdexv3PoolPair) ShareAmount ¶
func (pp *Pdexv3PoolPair) ShareAmount() uint64
func (*Pdexv3PoolPair) Token0ID ¶
func (pp *Pdexv3PoolPair) Token0ID() common.Hash
func (*Pdexv3PoolPair) Token0RealAmount ¶
func (pp *Pdexv3PoolPair) Token0RealAmount() uint64
func (*Pdexv3PoolPair) Token0VirtualAmount ¶
func (pp *Pdexv3PoolPair) Token0VirtualAmount() *big.Int
func (*Pdexv3PoolPair) Token1ID ¶
func (pp *Pdexv3PoolPair) Token1ID() common.Hash
func (*Pdexv3PoolPair) Token1RealAmount ¶
func (pp *Pdexv3PoolPair) Token1RealAmount() uint64
func (*Pdexv3PoolPair) Token1VirtualAmount ¶
func (pp *Pdexv3PoolPair) Token1VirtualAmount() *big.Int
func (*Pdexv3PoolPair) UnmarshalJSON ¶
func (pp *Pdexv3PoolPair) UnmarshalJSON(data []byte) error
type RawdbError ¶
func NewRawdbError ¶
func NewRawdbError(key int, err error, params ...interface{}) *RawdbError
func (RawdbError) Error ¶
func (e RawdbError) Error() string
func (RawdbError) GetError ¶
func (e RawdbError) GetError() error
func (RawdbError) GetErrorCode ¶
func (e RawdbError) GetErrorCode() int
func (RawdbError) GetMessage ¶
func (e RawdbError) GetMessage() string