status-go/services/wallet/routeexecution/route_db_data_test.go

96 lines
32 KiB
Go
Raw Normal View History

package routeexecution_test
import (
"encoding/json"
"github.com/status-im/status-go/services/wallet/requests"
"github.com/status-im/status-go/services/wallet/transfer"
)
type dbParams struct {
routeInputParams requests.RouteInputParams
buildInputParams *requests.RouterBuildTransactionsParams
transactionDetails []*transfer.RouterTransactionDetails
}
type dbTestData struct {
name string
insertedParams dbParams
expectedParams dbParams
}
func createDBParams(routeInputParamsJSON string, buildInputParamsJSON string, transactionDetailsJSON string) dbParams {
var err error
routeInputParams := requests.RouteInputParams{}
err = json.Unmarshal([]byte(routeInputParamsJSON), &routeInputParams)
if err != nil {
panic(err)
}
buildInputParams := &requests.RouterBuildTransactionsParams{}
err = json.Unmarshal([]byte(buildInputParamsJSON), buildInputParams)
if err != nil {
panic(err)
}
transactionDetails := make([]*transfer.RouterTransactionDetails, 0)
err = json.Unmarshal([]byte(transactionDetailsJSON), &transactionDetails)
if err != nil {
panic(err)
}
return dbParams{
routeInputParams: routeInputParams,
buildInputParams: buildInputParams,
transactionDetails: transactionDetails,
}
}
func createDBTestData(name string, inserted dbParams, expected dbParams) dbTestData {
return dbTestData{
name: name,
insertedParams: inserted,
expectedParams: expected,
}
}
func getUSDTSwapApproveDBTestData() dbParams {
const routeInputParamsJSON = `{"uuid":"m2j0rth4gjvbr","sendType":8,"addrFrom":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","addrTo":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","amountIn":"0xc350","amountOut":"0x0","tokenID":"USDT","tokenIDIsOwnerToken":false,"toTokenID":"DAI","disabledFromChainIDs":[1,42161],"disabledToChainIDs":[1,42161],"gasFeeMode":1,"fromLockedAmount":{},"TestnetMode":false,"username":"","publicKey":"","packID":null,"TestsMode":false,"TestParams":null}`
const buildInputParamsJSON = `{"uuid":"m2j0rth4gjvbr","slippagePercentage":0.0}`
const transactionDetailsJSON = `[{"RouterPath":{"ProcessorName":"Paraswap","FromChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalRpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","fallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalFallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","blockExplorerUrl":"https://optimistic.etherscan.io","iconUrl":"network/Network=Optimism","nativeCurrencyName":"Ether","nativeCurrencySymbol":"ETH","nativeCurrencyDecimals":18,"isTest":false,"layer":2,"enabled":true,"chainColor":"#E90101","shortName":"oeth","tokenOverrides":null,"relatedChainId":420},"ToChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalRpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","fallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalFallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","blockExplorerUrl":"https://optimistic.etherscan.io","iconUrl":"network/Network=Optimism","nativeCurrencyName":"Ether","nativeCurrencySymbol":"ETH","nativeCurrencyDecimals":18,"isTest":false,"layer":2,"enabled":true,"chainColor":"#E90101","shortName":"oeth","tokenOverrides":null,"relatedChainId":420},"FromToken":{"address":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","name":"Tether USD","symbol":"USDT","decimals":6,"chainId":10,"pegSymbol":"","verified":true,"tokenListId":"uniswap"},"ToToken":{"address":"0xda10009cbd5d07dd0cecc66161fc93d7c9000da1","name":"Dai Stablecoin","symbol":"DAI","decimals":18,"chainId":10,"pegSymbol":"","verified":true,"tokenListId":"uniswap"},"AmountIn":"0xc350","AmountInLocked":false,"AmountOut":"0xb05244c6f80a5d","SuggestedLevelsForMaxFeesPerGas":{"low":"0xf7bb4","medium":"0xfb528","high":"0xfee9c"},"MaxFeesPerGas":"0xfb528","TxBaseFee":"0x3974","TxPriorityFee":"0xf4240","TxGasAmount":130200,"TxBonderFees":"0x0","TxTokenFees":"0x0","TxFee":"0x1f34ceefc0","TxL1Fee":"0x0","ApprovalRequired":true,"ApprovalAmountRequired":"0xc350","ApprovalContractAddress":"0x6a000f20005980200259b80c5102003040001068","ApprovalBaseFee":"0x3974","ApprovalPriorityFee":"0xf4240","ApprovalGasAmount":46692,"ApprovalFee":"0xb30ed33a0","ApprovalL1Fee":"0x152b221b6e000","TxTotalFee":"0x152dc87730360","EstimatedTime":2,"RequiredTokenBalance":50000,"RequiredNativeBalance":372582095455072,"SubtractFees":false},"TxArgs":null,"Tx":null,"TxHashToSign":"0x0000000000000000000000000000000000000000000000000000000000000000","TxSignature":null,"TxSentHash":"0x0000000000000000000000000000000000000000000000000000000000000000","ApprovalTxArgs":{"version":1,"from":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","gas":"0xb664","gasPrice":null,"value":"0x0","nonce":null,"maxFeePerGas":"0xfb528","maxPriorityFeePerGas":"0xf4240","input":"0x","data":"0x095ea7b30000000000000000000000006a000f20005980200259b80c5102003040001068000000000000000000000000000000000000000000000000000000000000c350","multiTransactionID":0},"ApprovalTx":{"type":"0x2","nonce":"0x73","gasPrice":"0x0","maxPriorityFeePerGas":"0xf4240","maxFeePerGas":"0xfb528","gas":"0xb664","value":"0x0","input":"0x095ea7b30000000000000000000000006a000f20005980200259b80c5102003040001068000000000000000000000000000000000000000000000000000000000000c350","v":"0x0","r":"0x0","s":"0x0","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","chainId":"0x0","accessList":[],"hash":"0xaeac1fd8ef3517e8d42f2ab33680a6c61e2f170060529b21cdadd7201c36a974"},"ApprovalHashToSign":"0x210539bb33c1e2307eed92e1ec56b1e2a94edc4bb091bc8363391166d83577e3","ApprovalSignature":"MRGSrtVUixPRcdpDRvszuZOL+ZjB8dPZVOZDa1EHLHEQvEc+2irHFbwZ4SqHJCjulsT0fPiPUFPS5H16Aah4zAE=","ApprovalTxSentHash":"0xdfdc585b2bb187a715925d3375707b4a2e76ce9d02d074566a480410cd87400f"}]`
return createDBParams(routeInputParamsJSON, buildInputParamsJSON, transactionDetailsJSON)
}
func getUSDTSwapTxDBTestData() dbParams {
const routeInputParamsJSON = `{"uuid":"m2j0rth4gjvbr","sendType":8,"addrFrom":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","addrTo":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","amountIn":"0xc350","amountOut":"0x0","tokenID":"USDT","tokenIDIsOwnerToken":false,"toTokenID":"DAI","disabledFromChainIDs":[1,42161],"disabledToChainIDs":[1,42161],"gasFeeMode":1,"fromLockedAmount":{},"TestnetMode":false,"username":"","publicKey":"","packID":null,"TestsMode":false,"TestParams":null}`
const buildInputParamsJSON = `{"uuid":"m2j0rth4gjvbr","slippagePercentage":0.5}`
const transactionDetailsJSON = `[{"RouterPath":{"ProcessorName":"Paraswap","FromChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalRpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","fallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalFallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","blockExplorerUrl":"https://optimistic.etherscan.io","iconUrl":"network/Network=Optimism","nativeCurrencyName":"Ether","nativeCurrencySymbol":"ETH","nativeCurrencyDecimals":18,"isTest":false,"layer":2,"enabled":true,"chainColor":"#E90101","shortName":"oeth","tokenOverrides":null,"relatedChainId":420},"ToChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalRpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","fallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalFallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","blockExplorerUrl":"https://optimistic.etherscan.io","iconUrl":"network/Network=Optimism","nativeCurrencyName":"Ether","nativeCurrencySymbol":"ETH","nativeCurrencyDecimals":18,"isTest":false,"layer":2,"enabled":true,"chainColor":"#E90101","shortName":"oeth","tokenOverrides":null,"relatedChainId":420},"FromToken":{"address":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","name":"Tether USD","symbol":"USDT","decimals":6,"chainId":10,"pegSymbol":"","verified":true,"tokenListId":"uniswap"},"ToToken":{"address":"0xda10009cbd5d07dd0cecc66161fc93d7c9000da1","name":"Dai Stablecoin","symbol":"DAI","decimals":18,"chainId":10,"pegSymbol":"","verified":true,"tokenListId":"uniswap"},"AmountIn":"0xc350","AmountInLocked":false,"AmountOut":"0xb05244c6f80a5d","SuggestedLevelsForMaxFeesPerGas":{"low":"0xf7bb4","medium":"0xfb528","high":"0xfee9c"},"MaxFeesPerGas":"0xfb528","TxBaseFee":"0x3974","TxPriorityFee":"0xf4240","TxGasAmount":130200,"TxBonderFees":"0x0","TxTokenFees":"0x0","TxFee":"0x1f34ceefc0","TxL1Fee":"0x0","ApprovalRequired":true,"ApprovalAmountRequired":"0xc350","ApprovalContractAddress":"0x6a000f20005980200259b80c5102003040001068","ApprovalBaseFee":"0x3974","ApprovalPriorityFee":"0xf4240","ApprovalGasAmount":46692,"ApprovalFee":"0xb30ed33a0","ApprovalL1Fee":"0x152b221b6e000","TxTotalFee":"0x152dc87730360","EstimatedTime":2,"RequiredTokenBalance":50000,"RequiredNativeBalance":372582095455072,"SubtractFees":false},"TxArgs":null,"Tx":null,"TxHashToSign":"0x0000000000000000000000000000000000000000000000000000000000000000","TxSignature":null,"TxSentHash":"0x0000000000000000000000000000000000000000000000000000000000000000","ApprovalTxArgs":{"version":1,"from":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","gas":"0xb664","gasPrice":null,"value":"0x0","nonce":null,"maxFeePerGas":"0xfb528","maxPriorityFeePerGas":"0xf4240","input":"0x","data":"0x095ea7b30000000000000000000000006a000f20005980200259b80c5102003040001068000000000000000000000000000000000000000000000000000000000000c350","multiTransactionID":0},"ApprovalTx":{"type":"0x2","nonce":"0x73","gasPrice":"0x0","maxPriorityFeePerGas":"0xf4240","maxFeePerGas":"0xfb528","gas":"0xb664","value":"0x0","input":"0x095ea7b30000000000000000000000006a000f20005980200259b80c5102003040001068000000000000000000000000000000000000000000000000000000000000c350","v":"0x0","r":"0x0","s":"0x0","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","chainId":"0x0","accessList":[],"hash":"0xaeac1fd8ef3517e8d42f2ab33680a6c61e2f170060529b21cdadd7201c36a974"},"ApprovalHashToSign":"0x210539bb33c1e2307eed92e1ec56b1e2a94edc4bb091bc8363391166d83577e3","ApprovalSignature":"MRGSrtVUixPRcdpDRvszuZOL+ZjB8dPZVOZDa1EHLHEQvEc+2irHFbwZ4SqHJCjulsT0fPiPUFPS5H16Aah4zAE=","ApprovalTxSentHash":"0xdfdc585b2bb187a715925d3375707b4a2e76ce9d02d074566a480410cd87400f"},{"R
return createDBParams(routeInputParamsJSON, buildInputParamsJSON, transactionDetailsJSON)
}
func getETHSwapTxDBTestData() dbParams {
const routeInputParamsJSON = `{"uuid":"m2j0uqdb367ty","sendType":8,"addrFrom":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","addrTo":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","amountIn":"0x5af3107a4000","amountOut":"0x0","tokenID":"ETH","tokenIDIsOwnerToken":false,"toTokenID":"DAI","disabledFromChainIDs":[1,10],"disabledToChainIDs":[1,10],"gasFeeMode":1,"fromLockedAmount":{},"TestnetMode":false,"username":"","publicKey":"","packID":null,"TestsMode":false,"TestParams":null}`
const buildInputParamsJSON = `{"uuid":"m2j0uqdb367ty","slippagePercentage":0.5}`
const transactionDetailsJSON = `[{"RouterPath":{"ProcessorName":"Paraswap","FromChain":{"chainId":42161,"chainName":"Arbitrum","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","originalRpcUrl":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","fallbackURL":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalFallbackURL":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","blockExplorerUrl":"https://arbiscan.io/","iconUrl":"network/Network=Arbitrum","nativeCurrencyName":"Ether","nativeCurrencySymbol":"ETH","nativeCurrencyDecimals":18,"isTest":false,"layer":2,"enabled":true,"chainColor":"#51D0F0","shortName":"arb1","tokenOverrides":null,"relatedChainId":421613},"ToChain":{"chainId":42161,"chainName":"Arbitrum","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","originalRpcUrl":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","fallbackURL":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalFallbackURL":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","blockExplorerUrl":"https://arbiscan.io/","iconUrl":"network/Network=Arbitrum","nativeCurrencyName":"Ether","nativeCurrencySymbol":"ETH","nativeCurrencyDecimals":18,"isTest":false,"layer":2,"enabled":true,"chainColor":"#51D0F0","shortName":"arb1","tokenOverrides":null,"relatedChainId":421613},"FromToken":{"address":"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","name":"Ether","symbol":"ETH","decimals":18,"chainId":42161,"pegSymbol":"","verified":true,"tokenListId":""},"ToToken":{"address":"0xda10009cbd5d07dd0cecc66161fc93d7c9000da1","name":"DAI Stablecoin","symbol":"DAI","decimals":18,"chainId":42161,"pegSymbol":"","verified":true,"tokenListId":"status"},"AmountIn":"0x5af3107a4000","AmountInLocked":false,"AmountOut":"0x3bb9301e1ee5f34","SuggestedLevelsForMaxFeesPerGas":{"low":"0x8583b1","medium":"0x10b0762","high":"0x1908b13"},"MaxFeesPerGas":"0x10b0762","TxBaseFee":"0x8583b1","TxPriorityFee":"0x0","TxGasAmount":118470,"TxBonderFees":"0x0","TxTokenFees":"0x0","TxFee":"0x1e2b5da91cc","TxL1Fee":"0x0","ApprovalRequired":false,"ApprovalAmountRequired":null,"ApprovalContractAddress":"0x6a000f20005980200259b80c5102003040001068","ApprovalBaseFee":"0x8583b1","ApprovalPriorityFee":"0x0","ApprovalGasAmount":0,"ApprovalFee":"0x0","ApprovalL1Fee":"0x0","TxTotalFee":"0x1e2b5da91cc","EstimatedTime":1,"RequiredTokenBalance":0,"RequiredNativeBalance":102073225236940,"SubtractFees":false},"TxArgs":{"version":1,"from":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","to":"0x6a000f20005980200259b80c5102003040001068","gas":"0x5cc06","gasPrice":"0x6acfc00","value":"0x5af3107a4000","nonce":null,"maxFeePerGas":"0x10b0762","maxPriorityFeePerGas":"0x0","input":"0x","data":"0xe8bb3b6c00000000000000000000000000000000000000000000000000000000000000609a8278e856c0b191b9daa2d7dd1f7b28268e4da210000000000000000000004600000000000000000000000000000000000000000000000000000000000001c0000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000da10009cbd5d07dd0cecc66161fc93d7c9000da100000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000003bd7fb5d57ef6fc00000000000000000000000000000000000000000000000003c24f77b668726fcb25403cb7ad4e42999a1446a005fab30000000000000000000000000fdced2d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000004082af49447d8a07e3bd95bd0d56f35241523fbab1da10009cbd5d07dd0cecc66161fc93d7c9000da10000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000","multiTransactionID":0},"Tx":{"type":"0x2","nonce":"0x11","gasPrice":"0x0","maxPriorityFeePerGas":"0x0","maxFeePerGas":"0x10b0762","gas":"0x5cc06","value":"0x5af3107a4000","input":"0xe8bb3b6c0000000000000000000000000000000000000
return createDBParams(routeInputParamsJSON, buildInputParamsJSON, transactionDetailsJSON)
}
func getETHBridgeTxDBTestData() dbParams {
const routeInputParamsJSON = `{"uuid":"m2j0w28oxvxth","sendType":5,"addrFrom":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","addrTo":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","amountIn":"0x5af3107a4000","amountOut":"0x0","tokenID":"ETH","tokenIDIsOwnerToken":false,"toTokenID":"","disabledFromChainIDs":[],"disabledToChainIDs":[1,42161],"gasFeeMode":1,"fromLockedAmount":{},"TestnetMode":false,"username":"","publicKey":"","packID":null,"TestsMode":false,"TestParams":null}`
const buildInputParamsJSON = `{"uuid":"m2j0w28oxvxth","slippagePercentage":0}`
const transactionDetailsJSON = `[{"RouterPath":{"ProcessorName":"Hop","FromChain":{"chainId":42161,"chainName":"Arbitrum","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","originalRpcUrl":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","fallbackURL":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalFallbackURL":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","blockExplorerUrl":"https://arbiscan.io/","iconUrl":"network/Network=Arbitrum","nativeCurrencyName":"Ether","nativeCurrencySymbol":"ETH","nativeCurrencyDecimals":18,"isTest":false,"layer":2,"enabled":true,"chainColor":"#51D0F0","shortName":"arb1","tokenOverrides":null,"relatedChainId":421613},"ToChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalRpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","fallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalFallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","blockExplorerUrl":"https://optimistic.etherscan.io","iconUrl":"network/Network=Optimism","nativeCurrencyName":"Ether","nativeCurrencySymbol":"ETH","nativeCurrencyDecimals":18,"isTest":false,"layer":2,"enabled":true,"chainColor":"#E90101","shortName":"oeth","tokenOverrides":null,"relatedChainId":420},"FromToken":{"address":"0x0000000000000000000000000000000000000000","name":"Ether","symbol":"ETH","decimals":18,"chainId":42161,"pegSymbol":"","verified":true,"tokenListId":""},"ToToken":null,"AmountIn":"0x5af3107a4000","AmountInLocked":false,"AmountOut":"0x5a6b7ed63256","SuggestedLevelsForMaxFeesPerGas":{"low":"0x8583b1","medium":"0x10b0762","high":"0x1908b13"},"MaxFeesPerGas":"0x10b0762","TxBaseFee":"0x8583b1","TxPriorityFee":"0x0","TxGasAmount":444980,"TxBonderFees":"0x550e95ee4238","TxTokenFees":"0x552c82d806ad","TxFee":"0x715165cd3e8","TxL1Fee":"0x0","ApprovalRequired":false,"ApprovalAmountRequired":null,"ApprovalContractAddress":"0x33ceb27b39d2bb7d2e61f7564d3df29344020417","ApprovalBaseFee":"0x8583b1","ApprovalPriorityFee":"0x0","ApprovalGasAmount":0,"ApprovalFee":"0x0","ApprovalL1Fee":"0x0","TxTotalFee":"0x715165cd3e8","EstimatedTime":1,"RequiredTokenBalance":0,"RequiredNativeBalance":107787150889960,"SubtractFees":false},"TxArgs":{"version":1,"from":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","to":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","gas":"0x6ca34","gasPrice":null,"value":"0x5af3107a4000","nonce":"0x12","maxFeePerGas":"0x10b0762","maxPriorityFeePerGas":"0x0","input":"0x","data":"0xeea0d7b2000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000a1e277ea6b97effc5b61b3bf5de03f438981247e00000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000000000550e95ee423800000000000000000000000000000000000000000000000000005a6b7ed6325600000000000000000000000000000000000000000000000000000000671f8a99000000000000000000000000000000000000000000000000000005bf2915e48e00000000000000000000000000000000000000000000000000000000671f8a99","multiTransactionID":0},"Tx":{"type":"0x2","nonce":"0x12","gasPrice":"0x0","maxPriorityFeePerGas":"0x0","maxFeePerGas":"0x10b0762","gas":"0x6ca34","value":"0x5af3107a4000","input":"0xeea0d7b2000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000a1e277ea6b97effc5b61b3bf5de03f438981247e00000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000000000550e95ee423800000000000000000000000000000000000000000000000000005a6b7ed6325600000000000000000000000000000000000000000000000000000000671f8a99000000000000000000000000000000000000000000000000000005bf2915e48e00000000000000000000000000000000000000000000000000000000671f8a99","v":"0x0","r":"0x0","s":"0x0","to":"0x33ceb27b39d2bb7d2e61f7564d3df29344020417","chainId":"0x0","accessList":[],"hash":"0x
return createDBParams(routeInputParamsJSON, buildInputParamsJSON, transactionDetailsJSON)
}
func getUSDTSendTxDBTestData() dbParams {
const routeInputParamsJSON = `{"uuid":"m2f4gdaecu078","sendType":0,"addrFrom":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","addrTo":"0x0adb6caa256a5375c638c00e2ff80a9ac1b2d3a7","amountIn":"0xc350","amountOut":"0x0","tokenID":"USDT","tokenIDIsOwnerToken":false,"toTokenID":"","disabledFromChainIDs":[1,42161],"disabledToChainIDs":[1,42161],"gasFeeMode":1,"fromLockedAmount":{},"TestnetMode":false,"username":"","publicKey":"","packID":null,"TestsMode":false,"TestParams":null}`
const buildInputParamsJSON = `{"uuid":"m2f4gdaecu078","slippagePercentage":0}`
const transactionDetailsJSON = `[{"RouterPath":{"ProcessorName":"Transfer","FromChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalRpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","fallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalFallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","blockExplorerUrl":"https://optimistic.etherscan.io","iconUrl":"network/Network=Optimism","nativeCurrencyName":"Ether","nativeCurrencySymbol":"ETH","nativeCurrencyDecimals":18,"isTest":false,"layer":2,"enabled":true,"chainColor":"#E90101","shortName":"oeth","tokenOverrides":null,"relatedChainId":420},"ToChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalRpcUrl":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","fallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalFallbackURL":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","blockExplorerUrl":"https://optimistic.etherscan.io","iconUrl":"network/Network=Optimism","nativeCurrencyName":"Ether","nativeCurrencySymbol":"ETH","nativeCurrencyDecimals":18,"isTest":false,"layer":2,"enabled":true,"chainColor":"#E90101","shortName":"oeth","tokenOverrides":null,"relatedChainId":420},"FromToken":{"address":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","name":"Tether USD","symbol":"USDT","decimals":6,"chainId":10,"pegSymbol":"","verified":true,"tokenListId":"uniswap"},"ToToken":null,"AmountIn":"0xc350","AmountInLocked":false,"AmountOut":"0xc350","SuggestedLevelsForMaxFeesPerGas":{"low":"0xb5d34a","medium":"0x15c6454","high":"0x202f55e"},"MaxFeesPerGas":"0x15c6454","TxBaseFee":"0xa6910a","TxPriorityFee":"0xf4240","TxGasAmount":57442,"TxBonderFees":"0x0","TxTokenFees":"0x0","TxFee":"0x1315d27e828","TxL1Fee":"0x0","ApprovalRequired":false,"ApprovalAmountRequired":null,"ApprovalContractAddress":"0x0000000000000000000000000000000000000000","ApprovalBaseFee":"0xa6910a","ApprovalPriorityFee":"0xf4240","ApprovalGasAmount":0,"ApprovalFee":"0x0","ApprovalL1Fee":"0x0","TxTotalFee":"0x1315d27e828","EstimatedTime":1,"RequiredTokenBalance":50000,"RequiredNativeBalance":1311527921704,"SubtractFees":false},"TransactionsData":[{"ChainID":10,"TxHash":"0x1094c3431413f664b756ec87917250f8e3ec0913117003d0a3881236b1e7ec4a","IsApproval":false,"TxArgs":{"version":1,"from":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","gas":"0xe062","gasPrice":null,"value":"0x0","nonce":null,"maxFeePerGas":"0x15c6454","maxPriorityFeePerGas":"0xf4240","input":"0x","data":"0xa9059cbb0000000000000000000000000adb6caa256a5375c638c00e2ff80a9ac1b2d3a7000000000000000000000000000000000000000000000000000000000000c350","multiTransactionID":0},"Tx":{"type":"0x2","nonce":"0x6d","gasPrice":"0x0","maxPriorityFeePerGas":"0xf4240","maxFeePerGas":"0x15c6454","gas":"0xe062","value":"0x0","input":"0xa9059cbb0000000000000000000000000adb6caa256a5375c638c00e2ff80a9ac1b2d3a7000000000000000000000000000000000000000000000000000000000000c350","v":"0x0","r":"0x0","s":"0x0","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","chainId":"0x0","accessList":[],"hash":"0x0bedf47185c33665be64cbccb7b9fe2a6665f1335e4015f5344015a8d59ca4ef"}}]}]`
return createDBParams(routeInputParamsJSON, buildInputParamsJSON, transactionDetailsJSON)
}