Documentation
¶
Index ¶
- Constants
- Variables
- func ComplianceConfigTest() config.ComplianceConfig
- func FileNameBTCIntx(chainID int64, intxHash string, donation bool) string
- func FileNameBTCMsgTx(chainID int64, txHash string) string
- func FileNameBTCOuttx(chainID int64, nonce uint64) string
- func FileNameBTCTxByType(chainID int64, txType string, txHash string) string
- func FileNameEVMBlock(chainID int64, blockNumber uint64, trimmed bool) string
- func FileNameEVMIntx(chainID int64, intxHash string, coinType coin.CoinType, donation bool) string
- func FileNameEVMIntxReceipt(chainID int64, intxHash string, coinType coin.CoinType, donation bool) string
- func FileNameEVMOuttx(chainID int64, txHash string, coinType coin.CoinType) string
- func FileNameEVMOuttxReceipt(chainID int64, txHash string, coinType coin.CoinType, eventName string) string
- func FileNameXmsgByIntx(chainID int64, intxHash string, coinType coin.CoinType) string
- func FileNameXmsgByNonce(chainID int64, nonce uint64) string
- func Get(ctx context.Context, path string, v interface{}) error
- func LoadBTCIntxRawResult(t *testing.T, dir string, chainID int64, txHash string, donation bool) *btcjson.TxRawResult
- func LoadBTCTxRawResultNXmsg(t *testing.T, dir string, chainID int64, nonce uint64) (*btcjson.TxRawResult, *xmsgtypes.Xmsg)
- func LoadEVMBlock(t *testing.T, dir string, chainID int64, blockNumber uint64, trimmed bool) *ethrpc.Block
- func LoadEVMIntx(t *testing.T, dir string, chainID int64, intxHash string, ...) *ethrpc.Transaction
- func LoadEVMIntxDonation(t *testing.T, dir string, chainID int64, intxHash string, ...) *ethrpc.Transaction
- func LoadEVMIntxNReceipt(t *testing.T, dir string, chainID int64, intxHash string, ...) (*ethrpc.Transaction, *ethtypes.Receipt)
- func LoadEVMIntxNReceiptDonation(t *testing.T, dir string, chainID int64, intxHash string, ...) (*ethrpc.Transaction, *ethtypes.Receipt)
- func LoadEVMIntxNReceiptNXmsg(t *testing.T, dir string, chainID int64, intxHash string, ...) (*ethrpc.Transaction, *ethtypes.Receipt, *xmsgtypes.Xmsg)
- func LoadEVMIntxReceipt(t *testing.T, dir string, chainID int64, intxHash string, ...) *ethtypes.Receipt
- func LoadEVMIntxReceiptDonation(t *testing.T, dir string, chainID int64, intxHash string, ...) *ethtypes.Receipt
- func LoadEVMOuttx(t *testing.T, dir string, chainID int64, txHash string, coinType coin.CoinType) *ethtypes.Transaction
- func LoadEVMOuttxNReceipt(t *testing.T, dir string, chainID int64, txHash string, coinType coin.CoinType) (*ethtypes.Transaction, *ethtypes.Receipt)
- func LoadEVMOuttxReceipt(t *testing.T, dir string, chainID int64, txHash string, coinType coin.CoinType, ...) *ethtypes.Receipt
- func LoadEVMXmsgNOuttxNReceipt(t *testing.T, dir string, chainID int64, nonce uint64, eventName string) (*xmsgtypes.Xmsg, *ethtypes.Transaction, *ethtypes.Receipt)
- func LoadObjectFromJSONFile(t *testing.T, obj interface{}, filename string)
- func LoadXmsgByIntx(t *testing.T, chainID int64, coinType coin.CoinType, intxHash string) *xmsgtypes.Xmsg
- func LoadXmsgByNonce(t *testing.T, chainID int64, nonce uint64) *xmsgtypes.Xmsg
- func ParseReceiptERC20Deposited(receipt *ethtypes.Receipt, ...) *delegationmanager.DelegationManagerStakerDelegated
- func ParseReceiptStakerDeposited(receipt *ethtypes.Receipt, strategyManager *strategymanager.StrategyManager) *strategymanager.StrategyManagerDeposit
- func SaveBTCBlockTrimTx(blockVb *btcjson.GetBlockVerboseTxResult, filename string) error
- func SaveEVMBlockTrimTxInput(block *ethrpc.Block, filename string) error
- func SaveObjectToJSONFile(obj interface{}, filename string) error
- type BlockExtra
- type MempoolBlock
- type MempoolTx
- type Vin
- type Vout
Constants ¶
const ( // tss addresses TSSAddressEVMMainnet = "0x70e967acFcC17c3941E87562161406d41676FD83" TSSAddressBTCMainnet = "bc1qm24wp577nk8aacckv8np465z3dvmu7ry45el6y" TssPubkeyEVMMainnet = "pellpub1addwnpepqtadxdyt037h86z60nl98t6zk56mw5zpnm79tsmvspln3hgt5phdc79kvfc" TSSAddressEVMIgnite3 = "0x8531a5aB847ff5B22D855633C25ED1DA3255247e" TSSAddressBTCIgnite3 = "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur" TssPubkeyEVMIgnite3 = "pellpub1addwnpepq28c57cvcs0a2htsem5zxr6qnlvq9mzhmm76z3jncsnzz32rclangr2g35p" // some other addresses OtherAddress1 = "0x21248Decd0B7EcB0F30186297766b8AB6496265b" OtherAddress2 = "0x33A351C90aF486AebC35042Bb0544123cAed26AB" OtherAddress3 = "0x86B77E4fBd07CFdCc486cAe4F2787fB5C5a62cd3" // evm event names for test data naming EventPellSent = "PellSent" )
const ( APIURLBlocks = "https://mempool.space/api/v1/blocks" APIURLBlockTxs = "https://mempool.space/api/block/%s/txs" APIURLBlocksTestnet = "https://mempool.space/testnet/api/v1/blocks" APIURLBlockTxsTestnet = "https://mempool.space/testnet/api/block/%s/txs" )
const ( TestDataPathEVM = "testdata/evm" TestDataPathBTC = "testdata/btc" TestDataPathXmsg = "testdata/xmsg" RestrictedEVMAddressTest = "0x8a81Ba8eCF2c418CAe624be726F505332DF119C6" RestrictedBtcAddressTest = "bcrt1qzp4gt6fc7zkds09kfzaf9ln9c5rvrzxmy6qmpp" )
Variables ¶
var ConnectorAddresses = map[int64]ethcommon.Address{ 1: ethcommon.HexToAddress("0x000007Cf399229b2f5A4D043F20E90C9C98B7C6a"), 56: ethcommon.HexToAddress("0x000063A6e758D9e2f438d430108377564cf4077D"), 5: ethcommon.HexToAddress("0x00005E3125aBA53C5652f9F0CE1a4Cf91D8B15eA"), 97: ethcommon.HexToAddress("0x0000ecb8cdd25a18F12DAA23f6422e07fBf8B9E1"), 11155111: ethcommon.HexToAddress("0x3963341dad121c9CD33046089395D66eBF20Fb03"), 1337: ethcommon.HexToAddress("0xD28D6A0b8189305551a0A8bd247a6ECa9CE781Ca"), }
ConnectorManagerAddresses contains constants ERC20 connector addresses for testing
var DelegationManagerAddresses = map[int64]ethcommon.Address{ 1: ethcommon.HexToAddress("0x0000030Ec64DF25301d8414eE5a29588C4B0dE10"), 56: ethcommon.HexToAddress("0x00000fF8fA992424957F97688015814e707A0115"), 5: ethcommon.HexToAddress("0x000047f11C6E42293F433C82473532E869Ce4Ec5"), 97: ethcommon.HexToAddress("0x0000a7Db254145767262C6A81a7eE1650684258e"), 11155111: ethcommon.HexToAddress("0x84725b70a239d3Faa7C6EF0C6C8E8b6c8e28338b"), }
DelegationManagerAddresses contains constants ERC20 custody addresses for testing
var StrategyManagerAddresses = map[int64]ethcommon.Address{ 1: ethcommon.HexToAddress("0x000007Cf399229b2f5A4D043F20E90C9C98B7C6a"), 56: ethcommon.HexToAddress("0x000063A6e758D9e2f438d430108377564cf4077D"), 5: ethcommon.HexToAddress("0x00005E3125aBA53C5652f9F0CE1a4Cf91D8B15eA"), 97: ethcommon.HexToAddress("0x0000ecb8cdd25a18F12DAA23f6422e07fBf8B9E1"), 11155111: ethcommon.HexToAddress("0x3963341dad121c9CD33046089395D66eBF20Fb03"), 1337: ethcommon.HexToAddress("0xD28D6A0b8189305551a0A8bd247a6ECa9CE781Ca"), }
StrategyManagerAddresses contains constants ERC20 connector addresses for testing
Functions ¶
func ComplianceConfigTest ¶
func ComplianceConfigTest() config.ComplianceConfig
func FileNameBTCIntx ¶
FileNameBTCIntx returns unified archive file name for inbound tx
func FileNameBTCMsgTx ¶
FileNameBTCMsgTx returns unified archive file name for btc MsgTx
func FileNameBTCOuttx ¶
FileNameBTCOuttx returns unified archive file name for outbound tx
func FileNameBTCTxByType ¶
FileNameBTCTxByType returns unified archive file name for tx by type txType: "P2TR", "P2WPKH", "P2WSH", "P2PKH", "P2SH
func FileNameEVMBlock ¶
FileNameEVMBlock returns unified archive file name for block
func FileNameEVMIntx ¶
FileNameEVMIntx returns unified archive file name for inbound tx
func FileNameEVMIntxReceipt ¶
func FileNameEVMIntxReceipt(chainID int64, intxHash string, coinType coin.CoinType, donation bool) string
FileNameEVMIntxReceipt returns unified archive file name for inbound tx receipt
func FileNameEVMOuttx ¶
FileNameEVMOuttx returns unified archive file name for outbound tx
func FileNameEVMOuttxReceipt ¶
func FileNameEVMOuttxReceipt(chainID int64, txHash string, coinType coin.CoinType, eventName string) string
FileNameEVMOuttxReceipt returns unified archive file name for outbound tx receipt
func FileNameXmsgByIntx ¶
FileNameXmsgByIntx returns unified archive xmsg file name by intx
func FileNameXmsgByNonce ¶
FileNameXmsgByNonce returns unified archive xmsg file name by nonce
func LoadBTCIntxRawResult ¶
func LoadBTCIntxRawResult(t *testing.T, dir string, chainID int64, txHash string, donation bool) *btcjson.TxRawResult
LoadBTCIntxRawResult loads archived Bitcoin intx raw result from file
func LoadBTCTxRawResultNXmsg ¶
func LoadBTCTxRawResultNXmsg(t *testing.T, dir string, chainID int64, nonce uint64) (*btcjson.TxRawResult, *xmsgtypes.Xmsg)
LoadBTCTxRawResultNXmsg loads archived Bitcoin outtx raw result and corresponding xmsg
func LoadEVMBlock ¶
func LoadEVMBlock(t *testing.T, dir string, chainID int64, blockNumber uint64, trimmed bool) *ethrpc.Block
LoadEVMBlock loads archived evm block from file
func LoadEVMIntx ¶
func LoadEVMIntx( t *testing.T, dir string, chainID int64, intxHash string, coinType coin.CoinType) *ethrpc.Transaction
LoadEVMIntx loads archived intx from file
func LoadEVMIntxDonation ¶
func LoadEVMIntxDonation( t *testing.T, dir string, chainID int64, intxHash string, coinType coin.CoinType) *ethrpc.Transaction
LoadEVMIntxDonation loads archived donation intx from file
func LoadEVMIntxNReceipt ¶
func LoadEVMIntxNReceipt( t *testing.T, dir string, chainID int64, intxHash string, coinType coin.CoinType) (*ethrpc.Transaction, *ethtypes.Receipt)
LoadEVMIntxNReceipt loads archived intx and receipt from file
func LoadEVMIntxNReceiptDonation ¶
func LoadEVMIntxNReceiptDonation( t *testing.T, dir string, chainID int64, intxHash string, coinType coin.CoinType) (*ethrpc.Transaction, *ethtypes.Receipt)
LoadEVMIntxNReceiptDonation loads archived donation intx and receipt from file
func LoadEVMIntxNReceiptNXmsg ¶
func LoadEVMIntxNReceiptNXmsg( t *testing.T, dir string, chainID int64, intxHash string, coinType coin.CoinType) (*ethrpc.Transaction, *ethtypes.Receipt, *xmsgtypes.Xmsg)
LoadTxNReceiptNXmsg loads archived intx, receipt and corresponding xmsg from file
func LoadEVMIntxReceipt ¶
func LoadEVMIntxReceipt( t *testing.T, dir string, chainID int64, intxHash string, coinType coin.CoinType) *ethtypes.Receipt
LoadEVMIntxReceipt loads archived intx receipt from file
func LoadEVMIntxReceiptDonation ¶
func LoadEVMIntxReceiptDonation( t *testing.T, dir string, chainID int64, intxHash string, coinType coin.CoinType) *ethtypes.Receipt
LoadEVMIntxReceiptDonation loads archived donation intx receipt from file
func LoadEVMOuttx ¶
func LoadEVMOuttx( t *testing.T, dir string, chainID int64, txHash string, coinType coin.CoinType) *ethtypes.Transaction
LoadEVMOuttx loads archived evm outtx from file
func LoadEVMOuttxNReceipt ¶
func LoadEVMOuttxNReceipt( t *testing.T, dir string, chainID int64, txHash string, coinType coin.CoinType) (*ethtypes.Transaction, *ethtypes.Receipt)
LoadEVMOuttxNReceipt loads archived evm outtx and receipt from file
func LoadEVMOuttxReceipt ¶
func LoadEVMOuttxReceipt( t *testing.T, dir string, chainID int64, txHash string, coinType coin.CoinType, eventName string) *ethtypes.Receipt
LoadEVMOuttxReceipt loads archived evm outtx receipt from file
func LoadEVMXmsgNOuttxNReceipt ¶
func LoadEVMXmsgNOuttxNReceipt( t *testing.T, dir string, chainID int64, nonce uint64, eventName string) (*xmsgtypes.Xmsg, *ethtypes.Transaction, *ethtypes.Receipt)
LoadEVMOuttxNReceiptNEvent loads archived xmsg, outtx and receipt from file
func LoadObjectFromJSONFile ¶
LoadObjectFromJSONFile loads an object from a file in JSON format
func LoadXmsgByIntx ¶
func LoadXmsgByIntx( t *testing.T, chainID int64, coinType coin.CoinType, intxHash string, ) *xmsgtypes.Xmsg
LoadXmsgByIntx loads archived xmsg by intx
func LoadXmsgByNonce ¶
LoadXmsgByNonce loads archived xmsg by nonce
func ParseReceiptERC20Deposited ¶
func ParseReceiptERC20Deposited(receipt *ethtypes.Receipt, delegationManager *delegationmanager.DelegationManager) *delegationmanager.DelegationManagerStakerDelegated
ParseReceipt parses an Delegate event from a receipt
func ParseReceiptStakerDeposited ¶
func ParseReceiptStakerDeposited(receipt *ethtypes.Receipt, strategyManager *strategymanager.StrategyManager) *strategymanager.StrategyManagerDeposit
ParseReceipt parses a Deposit event from a receipt
func SaveBTCBlockTrimTx ¶
func SaveBTCBlockTrimTx(blockVb *btcjson.GetBlockVerboseTxResult, filename string) error
SaveTrimedBTCBlockTrimTx trims tx data from a block and saves it to a file
func SaveEVMBlockTrimTxInput ¶
SaveTrimedEVMBlockTrimTxInput trims tx input data from a block and saves it to a file
func SaveObjectToJSONFile ¶
SaveObjectToJSONFile saves an object to a file in JSON format
Types ¶
type BlockExtra ¶
type BlockExtra struct {
TotalFees int `json:"totalFees"`
MedianFee float64 `json:"medianFee"`
FeeRange []float64 `json:"feeRange"`
Reward int `json:"reward"`
Pool struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
} `json:"pool"`
AvgFee int `json:"avgFee"`
AvgFeeRate int `json:"avgFeeRate"`
CoinbaseRaw string `json:"coinbaseRaw"`
CoinbaseAddress string `json:"coinbaseAddress"`
CoinbaseSignature string `json:"coinbaseSignature"`
CoinbaseSignatureASCII string `json:"coinbaseSignatureAscii"`
AvgTxSize float64 `json:"avgTxSize"`
TotalInputs int `json:"totalInputs"`
TotalOutputs int `json:"totalOutputs"`
TotalOutputAmt int `json:"totalOutputAmt"`
MedianFeeAmt int `json:"medianFeeAmt"`
FeePercentiles []int `json:"feePercentiles"`
SegwitTotalTxs int `json:"segwitTotalTxs"`
SegwitTotalSize int `json:"segwitTotalSize"`
SegwitTotalWeight int `json:"segwitTotalWeight"`
Header string `json:"header"`
UTXOSetChange int `json:"utxoSetChange"`
UTXOSetSize int `json:"utxoSetSize"`
TotalInputAmt int `json:"totalInputAmt"`
VirtualSize float64 `json:"virtualSize"`
Orphans []struct {
Height int `json:"height"`
Hash string `json:"hash"`
Status string `json:"status"`
} `json:"orphans"`
MatchRate float64 `json:"matchRate"`
EXpectedFees big.Int `json:"expectedFees"`
ExpectedWeight int `json:"expectedWeight"`
}
type MempoolBlock ¶
type MempoolBlock struct {
ID string `json:"id"`
Height int `json:"height"`
Version int `json:"version"`
Time int `json:"timestamp"`
Bits int `json:"bits"`
Nonce int `json:"nonce"`
Difficulty float64 `json:"difficulty"`
MerkleRoot string `json:"merkle_root"`
TxCount int `json:"tx_count"`
Size int `json:"size"`
Weight int `json:"weight"`
PreviousBlockHash string `json:"previousblockhash"`
MedianTime int `json:"mediantime"`
Extras BlockExtra `json:"extras"`
}
type MempoolTx ¶
type Vin ¶
type Vin struct {
TxID string `json:"txid"`
Vout uint32 `json:"vout"`
Prevout struct {
Scriptpubkey string `json:"scriptpubkey"`
ScriptpubkeyAsm string `json:"scriptpubkey_asm"`
ScriptpubkeyType string `json:"scriptpubkey_type"`
ScriptpubkeyAddress string `json:"scriptpubkey_address"`
Value int64 `json:"value"`
} `json:"prevout"`
Scriptsig string `json:"scriptsig"`
IsCoinbase bool `json:"is_coinbase"`
Sequence uint32 `json:"sequence"`
}