96 lines
31 KiB
Go
96 lines
31 KiB
Go
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":"m37x37mu55w2o","sendType":8,"addrFrom":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","addrTo":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","amountIn":"0x186a0","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":"m37x37mu55w2o","slippagePercentage":0}`
|
|
const transactionDetailsJSON = `[{"RouterPath":{"ProcessorName":"Paraswap","FromChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalRpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","fallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalFallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","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":11155420},"ToChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalRpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","fallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalFallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","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":11155420},"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":"0x186a0","AmountInLocked":false,"AmountOut":"0x160eb31673c012e","SuggestedLevelsForMaxFeesPerGas":{"low":"0xf43e2","medium":"0xf4584","high":"0xf4726"},"MaxFeesPerGas":"0xf4584","TxBaseFee":"0x1a2","TxPriorityFee":"0xf4240","TxGasAmount":130200,"TxBonderFees":"0x0","TxTokenFees":"0x0","TxFee":"0x1e57033660","TxL1Fee":"0x0","ApprovalRequired":true,"ApprovalAmountRequired":"0x186a0","ApprovalContractAddress":"0x6a000f20005980200259b80c5102003040001068","ApprovalBaseFee":"0x1a2","ApprovalPriorityFee":"0xf4240","ApprovalGasAmount":46704,"ApprovalFee":"0xae21a41c0","ApprovalL1Fee":"0x153c98749c000","TxTotalFee":"0x153f2c0673820","EstimatedTime":2,"RequiredTokenBalance":100000,"RequiredNativeBalance":373777051891744,"SubtractFees":false},"TxData":null,"ApprovalTxData":{"TxArgs":{"version":1,"from":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","gas":"0xb670","gasPrice":null,"value":"0x0","nonce":null,"maxFeePerGas":"0xf4584","maxPriorityFeePerGas":"0xf4240","input":"0x","data":"0x095ea7b30000000000000000000000006a000f20005980200259b80c510200304000106800000000000000000000000000000000000000000000000000000000000186a0","multiTransactionID":0},"Tx":{"type":"0x2","nonce":"0x9f","gasPrice":"0x0","maxPriorityFeePerGas":"0xf4240","maxFeePerGas":"0xf4584","gas":"0xb670","value":"0x0","input":"0x095ea7b30000000000000000000000006a000f20005980200259b80c510200304000106800000000000000000000000000000000000000000000000000000000000186a0","v":"0x1","r":"0xe880fae6cece38b02397c5d12ea4b0552c893efa4cbe86231436d49d6ad07837","s":"0x787d9545bf4ae3a822245cdcb31ecb45cd6a944aef7b4e1efe007abac14c4fa5","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","chainId":"0xa","accessList":[],"hash":"0xa66752f1e621563725b995ab2275fbe62b1252bdbe054f11ad7708c749248207"},"HashToSign":"0x04db0b66d2ebe1d7a1bd3cbe9430653b64e94e5bfd240ddaca2bcebe397ba2d3","Signature":"6ID65s7OOLAjl8XRLqSwVSyJPvpMvoYjFDbUnWrQeDd4fZVFv0rjqCIkXNyzHstFzWqUSu97Th7+AHq6wUxPpQE=","SentHash":"0xa66752f1e621563725b995ab2275fbe62b1252bdbe054f11ad7708c749248207"}}]`
|
|
|
|
return createDBParams(routeInputParamsJSON, buildInputParamsJSON, transactionDetailsJSON)
|
|
}
|
|
|
|
func getUSDTSwapTxDBTestData() dbParams {
|
|
const routeInputParamsJSON = `{"uuid":"m37x37mu55w2o","sendType":8,"addrFrom":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","addrTo":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","amountIn":"0x186a0","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":"m37x37mu55w2o","slippagePercentage":0.5}`
|
|
const transactionDetailsJSON = `[{"RouterPath":{"ProcessorName":"Paraswap","FromChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalRpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","fallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalFallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","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":11155420},"ToChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalRpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","fallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalFallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","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":11155420},"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":"0x186a0","AmountInLocked":false,"AmountOut":"0x160eb31673c012e","SuggestedLevelsForMaxFeesPerGas":{"low":"0xf43e2","medium":"0xf4584","high":"0xf4726"},"MaxFeesPerGas":"0xf4584","TxBaseFee":"0x1a2","TxPriorityFee":"0xf4240","TxGasAmount":130200,"TxBonderFees":"0x0","TxTokenFees":"0x0","TxFee":"0x1e57033660","TxL1Fee":"0x0","ApprovalRequired":true,"ApprovalAmountRequired":"0x186a0","ApprovalContractAddress":"0x6a000f20005980200259b80c5102003040001068","ApprovalBaseFee":"0x1a2","ApprovalPriorityFee":"0xf4240","ApprovalGasAmount":46704,"ApprovalFee":"0xae21a41c0","ApprovalL1Fee":"0x153c98749c000","TxTotalFee":"0x153f2c0673820","EstimatedTime":2,"RequiredTokenBalance":100000,"RequiredNativeBalance":373777051891744,"SubtractFees":false},"TxData":{"TxArgs":{"version":1,"from":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","to":"0x6a000f20005980200259b80c5102003040001068","gas":"0x2e0ed","gasPrice":"0x10cacd","value":"0x0","nonce":null,"maxFeePerGas":"0xf456c","maxPriorityFeePerGas":"0xf4240","input":"0x","data":"0x876a02f60000000000000000000000000000000000000000000000000000000000000060e9b59dc0b30cd4646430c25de0111d651c39577510000000000000000000004600000000000000000000000000000000000000000000000000000000000001e000000000000000000000000094b008aa00579c1307b0ef2c499ad98a8ce58e58000000000000000000000000da10009cbd5d07dd0cecc66161fc93d7c9000da100000000000000000000000000000000000000000000000000000000000186a00000000000000000000000000000000000000000000000000161a12940c5890c00000000000000000000000000000000000000000000000001636814e09d5cb580087b50afc1419798afcd5ee5e03113000000000000000000000000079cb72300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000006080000000000000000000000094b008aa00579c1307b0ef2c499ad98a8ce58e58000000000000000000000000da10009cbd5d07dd0cecc66161fc93d7c9000da100000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000","multiTransactionID":0},"Tx":{"type":"0x2","nonce":"0xa0","gasPrice":"0x0","maxPriorityFeePerGas":"0xf4240","maxFeePerGas":"0xf456c","gas":"0x2e0ed","value":"0x0","input":"0x876a02f60000000000000000000000000000000000000000000000000000000000000060e9b59dc0b30cd4646430c25de0111d651c39577510000000000000000000004600000000000000000000000000000000000000000000000000000000000001e000000000000000000000000094b008aa00579c1307b0ef2c499ad98a8ce58e58000000000000000000000000da10009cbd5d07dd0cecc66161fc93d7c9000da100000000000000000000000000000000000000000000000000000000000186a00000000000000000000000000000000000000000000000000161a12940c5890c00000000000000000000000000000000000000000000000001636814e09d5cb580087b50afc1419798afcd5ee5e03113000000000000000000000000079cb72300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000006080000000000000000000000094b008aa00579c1307b0ef2c499ad98a8ce58e58000000000000000000000000da10009cbd5d07dd0cecc66161fc93d7c9000da100000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000000","v":"0x0","r":"0x10302284777f60ba6496f8c8b566d5ab8b1b50c007e9d55b2eadbfaf1359812a","s":"0x3e9b59462ef8898755918ecbad67a4a9274ce2539cf670a542ef7f7987a57dae","to":"0x6a000f20005980200259b80c5102003040001068","chainId":"0xa","accessList":[],"hash":"0x4c2897ef7b43c2f1e9c33239309a809115dd10dfeb669393689107dff4a1ea6d"},"HashToSign":"0xf2d783da3ba15ee9309fc34e44dcecc20473414590c149b3d66886d9fde90641","Signature":"EDAihHd/YLpklvjItWbVq4sbUMAH6dVbLq2/rxNZgSo+m1lGLviJh1WRjsutZ6SpJ0ziU5z2cKVC7395h6V9rgA=","SentHash":"0x4c2897ef7b43c2f1e9c33239309a809115dd10dfeb669393689107dff4a1ea6d"},"ApprovalTxData":{"TxArgs":{"version":1,"from":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","gas":"0xb670","gasPrice":null,"value":"0x0","nonce":null,"maxFeePerGas":"0xf4584","maxPriorityFeePerGas":"0xf4240","input":"0x","data":"0x095ea7b30000000000000000000000006a000f20005980200259b80c510200304000106800000000000000000000000000000000000000000000000000000000000186a0","multiTransactionID":0},"Tx":{"type":"0x2","nonce":"0x9f","gasPrice":"0x0","maxPriorityFeePerGas":"0xf4240","maxFeePerGas":"0xf4584","gas":"0xb670","value":"0x0","input":"0x095ea7b30000000000000000000000006a000f20005980200259b80c510200304000106800000000000000000000000000000000000000000000000000000000000186a0","v":"0x1","r":"0xe880fae6cece38b02397c5d12ea4b0552c893efa4cbe86231436d49d6ad07837","s":"0x787d9545bf4ae3a822245cdcb31ecb45cd6a944aef7b4e1efe007abac14c4fa5","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","chainId":"0xa","accessList":[],"hash":"0xa66752f1e621563725b995ab2275fbe62b1252bdbe054f11ad7708c749248207"},"HashToSign":"0x04db0b66d2ebe1d7a1bd3cbe9430653b64e94e5bfd240ddaca2bcebe397ba2d3","Signature":"6ID65s7OOLAjl8XRLqSwVSyJPvpMvoYjFDbUnWrQeDd4fZVFv0rjqCIkXNyzHstFzWqUSu97Th7+AHq6wUxPpQE=","SentHash":"0xa66752f1e621563725b995ab2275fbe62b1252bdbe054f11ad7708c749248207"}}]`
|
|
|
|
return createDBParams(routeInputParamsJSON, buildInputParamsJSON, transactionDetailsJSON)
|
|
}
|
|
|
|
func getETHSwapTxDBTestData() dbParams {
|
|
const routeInputParamsJSON = `{"uuid":"m37wx325cqari","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":"m37wx325cqari","slippagePercentage":0.5}`
|
|
const transactionDetailsJSON = `[{"RouterPath":{"ProcessorName":"Paraswap","FromChain":{"chainId":42161,"chainName":"Arbitrum","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalRpcUrl":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","fallbackURL":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","originalFallbackURL":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","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":421614},"ToChain":{"chainId":42161,"chainName":"Arbitrum","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalRpcUrl":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","fallbackURL":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","originalFallbackURL":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","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":421614},"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":"uniswap"},"AmountIn":"0x5af3107a4000","AmountInLocked":false,"AmountOut":"0x3f462eb655bf90c","SuggestedLevelsForMaxFeesPerGas":{"low":"0x90b3f3","medium":"0x12167e6","high":"0x1b21bd9"},"MaxFeesPerGas":"0x12167e6","TxBaseFee":"0x90b3f3","TxPriorityFee":"0x0","TxGasAmount":128470,"TxBonderFees":"0x0","TxTokenFees":"0x0","TxFee":"0x2375241f844","TxL1Fee":"0x0","ApprovalRequired":false,"ApprovalAmountRequired":null,"ApprovalContractAddress":"0x6a000f20005980200259b80c5102003040001068","ApprovalBaseFee":"0x90b3f3","ApprovalPriorityFee":"0x0","ApprovalGasAmount":0,"ApprovalFee":"0x0","ApprovalL1Fee":"0x0","TxTotalFee":"0x2375241f844","EstimatedTime":1,"RequiredTokenBalance":0,"RequiredNativeBalance":102436626511940,"SubtractFees":false},"TxData":{"TxArgs":{"version":1,"from":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","to":"0x6a000f20005980200259b80c5102003040001068","gas":"0x1abf8c","gasPrice":"0x6bc66e0","value":"0x5af3107a4000","nonce":null,"maxFeePerGas":"0x12167e6","maxPriorityFeePerGas":"0x0","input":"0x","data":"0xe3ead59e000000000000000000000000000010036c0190e009a000d0fc3541100a07380a000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000da10009cbd5d07dd0cecc66161fc93d7c9000da100000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000003f66cea52be61b400000000000000000000000000000000000000000000000003fb85e7a4346756b2784578d63a44999a530ccbf6c56f9a00000000000000000000000010384e4100000000000000000000000000000000000000000000000000000000000000009a8278e856c0b191b9daa2d7dd1f7b28268e4da210000000000000000000004600000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001a082af49447d8a07e3bd95bd0d56f35241523fbab10000002000040000ff00000900000000000000000000000000000000000000000000000000000000d0e30db082af49447d8a07e3bd95bd0d56f35241523fbab10000006000240000ff00000300000000000000000000000000000000000000000000000000000000a9059cbb000000000000000000000000692a0b300366d1042679397e40f3d2cb4b8f7d3000000000000000000000000000000000000000000000000000005af3107a40006a000f20005980200259b80c51020030400010680000008000240000ff0600030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000005af3107a4000000000000000000000004de4692a0b300366d1042679397e40f3d2cb4b8f7d30","multiTransactionID":0},"Tx":{"type":"0x2","nonce":"0x1c","gasPrice":"0x0","maxPriorityFeePerGas":"0x0","maxFeePerGas":"0x12167e6","gas":"0x1abf8c","value":"0x5af3107a4000","input":"0xe3ead59e000000000000000000000000000010036c0190e009a000d0fc3541100a07380a000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000da10009cbd5d07dd0cecc66161fc93d7c9000da100000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000003f66cea52be61b400000000000000000000000000000000000000000000000003fb85e7a4346756b2784578d63a44999a530ccbf6c56f9a00000000000000000000000010384e4100000000000000000000000000000000000000000000000000000000000000009a8278e856c0b191b9daa2d7dd1f7b28268e4da210000000000000000000004600000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001a082af49447d8a07e3bd95bd0d56f35241523fbab10000002000040000ff00000900000000000000000000000000000000000000000000000000000000d0e30db082af49447d8a07e3bd95bd0d56f35241523fbab10000006000240000ff00000300000000000000000000000000000000000000000000000000000000a9059cbb000000000000000000000000692a0b300366d1042679397e40f3d2cb4b8f7d3000000000000000000000000000000000000000000000000000005af3107a40006a000f20005980200259b80c51020030400010680000008000240000ff0600030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000005af3107a4000000000000000000000004de4692a0b300366d1042679397e40f3d2cb4b8f7d30","v":"0x0","r":"0x70bc614d6ff33cf5085d9630843c40f9eb1adc225d4761dc347f78cb79fdcf35","s":"0x3d7b14fd37f31f4d1644d9e466938f345da4333c71235b97b363a4806822181a","to":"0x6a000f20005980200259b80c5102003040001068","chainId":"0xa4b1","accessList":[],"hash":"0x1017c92e6d365865aa8e20599acef5ac3201b60534d38e47b0b33a725fe83f7d"},"HashToSign":"0x9349afe36a0dc2678688703e767727db5c7755c593a684f6885c561e4bb94e22","Signature":"cLxhTW/zPPUIXZYwhDxA+esa3CJdR2HcNH94y3n9zzU9exT9N/MfTRZE2eRmk480XaQzPHEjW5ezY6SAaCIYGgA=","SentHash":"0x1017c92e6d365865aa8e20599acef5ac3201b60534d38e47b0b33a725fe83f7d"},"ApprovalTxData":null}]`
|
|
|
|
return createDBParams(routeInputParamsJSON, buildInputParamsJSON, transactionDetailsJSON)
|
|
}
|
|
|
|
func getETHBridgeTxDBTestData() dbParams {
|
|
const routeInputParamsJSON = `{"uuid":"m37wv9zf44awi","sendType":5,"addrFrom":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","addrTo":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","amountIn":"0x5af3107a4000","amountOut":"0x0","tokenID":"ETH","tokenIDIsOwnerToken":false,"toTokenID":"","disabledFromChainIDs":[],"disabledToChainIDs":[1,10],"gasFeeMode":1,"fromLockedAmount":{},"TestnetMode":false,"username":"","publicKey":"","packID":null,"TestsMode":false,"TestParams":null}`
|
|
const buildInputParamsJSON = `{"uuid":"m37wv9zf44awi","slippagePercentage":0}`
|
|
const transactionDetailsJSON = `[{"RouterPath":{"ProcessorName":"Hop","FromChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalRpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","fallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalFallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","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":11155420},"ToChain":{"chainId":42161,"chainName":"Arbitrum","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalRpcUrl":"https://arbitrum-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","fallbackURL":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","originalFallbackURL":"https://arbitrum-one.rpc.grove.city/v1/39d9bfd5","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":421614},"FromToken":{"address":"0x0000000000000000000000000000000000000000","name":"Ether","symbol":"ETH","decimals":18,"chainId":10,"pegSymbol":"","verified":true,"tokenListId":""},"ToToken":null,"AmountIn":"0x5af3107a4000","AmountInLocked":false,"AmountOut":"0x5a6a35bbb41b","SuggestedLevelsForMaxFeesPerGas":{"low":"0xf43c7","medium":"0xf454e","high":"0xf46d5"},"MaxFeesPerGas":"0xf454e","TxBaseFee":"0x187","TxPriorityFee":"0xf4240","TxGasAmount":334934,"TxBonderFees":"0x5a49f9b2ee21","TxTokenFees":"0x5a52b58704e4","TxFee":"0x4e0b3bd034","TxL1Fee":"0x0","ApprovalRequired":false,"ApprovalAmountRequired":null,"ApprovalContractAddress":"0x86ca30bef97fb651b8d866d45503684b90cb3312","ApprovalBaseFee":"0x187","ApprovalPriorityFee":"0xf4240","ApprovalGasAmount":0,"ApprovalFee":"0x0","ApprovalL1Fee":"0x0","TxTotalFee":"0x4e0b3bd034","EstimatedTime":1,"RequiredTokenBalance":0,"RequiredNativeBalance":100335195918388,"SubtractFees":false},"TxData":{"TxArgs":{"version":1,"from":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","to":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","gas":"0x51c56","gasPrice":null,"value":"0x5af3107a4000","nonce":"0x9e","maxFeePerGas":"0xf454e","maxPriorityFeePerGas":"0xf4240","input":"0x","data":"0xeea0d7b2000000000000000000000000000000000000000000000000000000000000a4b1000000000000000000000000a1e277ea6b97effc5b61b3bf5de03f438981247e00000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000005a49f9b2ee2100000000000000000000000000000000000000000000000000005a6a35bbb41b00000000000000000000000000000000000000000000000000000000673681070000000000000000000000000000000000000000000000000000009f8db203c60000000000000000000000000000000000000000000000000000000067368107","multiTransactionID":0},"Tx":{"type":"0x2","nonce":"0x9e","gasPrice":"0x0","maxPriorityFeePerGas":"0xf4240","maxFeePerGas":"0xf454e","gas":"0x51c56","value":"0x5af3107a4000","input":"0xeea0d7b2000000000000000000000000000000000000000000000000000000000000a4b1000000000000000000000000a1e277ea6b97effc5b61b3bf5de03f438981247e00000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000005a49f9b2ee2100000000000000000000000000000000000000000000000000005a6a35bbb41b00000000000000000000000000000000000000000000000000000000673681070000000000000000000000000000000000000000000000000000009f8db203c60000000000000000000000000000000000000000000000000000000067368107","v":"0x1","r":"0x1392c6310f0bcd6118ad8990b4efec7606ce5fd456d9549c893f0dd4137dd939","s":"0x346391a2ab047657589934198f734b0870be29319d1a109177f0472ee34b4b6e","to":"0x86ca30bef97fb651b8d866d45503684b90cb3312","chainId":"0xa","accessList":[],"hash":"0x7832ffbd60a7c85e2e4f4f12053a9706f455a79d6ef3fab1ec5bc730638d4c47"},"HashToSign":"0xa7fae1c642fc625a3a5c4499bb9261843d9f6144e801e17a9cc6912c975149cf","Signature":"E5LGMQ8LzWEYrYmQtO/sdgbOX9RW2VSciT8N1BN92Tk0Y5GiqwR2V1iZNBmPc0sIcL4pMZ0aEJF38Ecu40tLbgE=","SentHash":"0x7832ffbd60a7c85e2e4f4f12053a9706f455a79d6ef3fab1ec5bc730638d4c47"},"ApprovalTxData":null}]`
|
|
|
|
return createDBParams(routeInputParamsJSON, buildInputParamsJSON, transactionDetailsJSON)
|
|
}
|
|
|
|
func getUSDTSendTxDBTestData() dbParams {
|
|
const routeInputParamsJSON = `{"uuid":"m37wpca9zhzjf","sendType":0,"addrFrom":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","addrTo":"0x0adb6caa256a5375c638c00e2ff80a9ac1b2d3a7","amountIn":"0x7a120","amountOut":"0x0","tokenID":"USDT","tokenIDIsOwnerToken":false,"toTokenID":"","disabledFromChainIDs":[],"disabledToChainIDs":[1],"gasFeeMode":1,"fromLockedAmount":{},"TestnetMode":false,"username":"","publicKey":"","packID":null,"TestsMode":false,"TestParams":null}`
|
|
const buildInputParamsJSON = `{"uuid":"m37wpca9zhzjf","slippagePercentage":0}`
|
|
const transactionDetailsJSON = `[{"RouterPath":{"ProcessorName":"Transfer","FromChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalRpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","fallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalFallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","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":11155420},"ToChain":{"chainId":10,"chainName":"Optimism","defaultRpcUrl":"","defaultFallbackURL":"","defaultFallbackURL2":"","rpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","originalRpcUrl":"https://optimism-mainnet.infura.io/v3/36835196264a4ea6bf73a25445cd19e7","fallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","originalFallbackURL":"https://optimism-archival.rpc.grove.city/v1/39d9bfd5","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":11155420},"FromToken":{"address":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","name":"Tether USD","symbol":"USDT","decimals":6,"chainId":10,"pegSymbol":"","verified":true,"tokenListId":"uniswap"},"ToToken":null,"AmountIn":"0x7a120","AmountInLocked":false,"AmountOut":"0x7a120","SuggestedLevelsForMaxFeesPerGas":{"low":"0xf43d6","medium":"0xf456c","high":"0xf4702"},"MaxFeesPerGas":"0xf456c","TxBaseFee":"0x196","TxPriorityFee":"0xf4240","TxGasAmount":42117,"TxBonderFees":"0x0","TxTokenFees":"0x0","TxFee":"0x9d068411c","TxL1Fee":"0x0","ApprovalRequired":false,"ApprovalAmountRequired":null,"ApprovalContractAddress":"0x0000000000000000000000000000000000000000","ApprovalBaseFee":"0x196","ApprovalPriorityFee":"0xf4240","ApprovalGasAmount":0,"ApprovalFee":"0x0","ApprovalL1Fee":"0x0","TxTotalFee":"0x9d068411c","EstimatedTime":1,"RequiredTokenBalance":500000,"RequiredNativeBalance":42151199004,"SubtractFees":false},"TxData":{"TxArgs":{"version":1,"from":"0xa1e277ea6b97effc5b61b3bf5de03f438981247e","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","gas":"0xa485","gasPrice":null,"value":"0x0","nonce":null,"maxFeePerGas":"0xf456c","maxPriorityFeePerGas":"0xf4240","input":"0x","data":"0xa9059cbb0000000000000000000000000adb6caa256a5375c638c00e2ff80a9ac1b2d3a7000000000000000000000000000000000000000000000000000000000007a120","multiTransactionID":0},"Tx":{"type":"0x2","nonce":"0x9d","gasPrice":"0x0","maxPriorityFeePerGas":"0xf4240","maxFeePerGas":"0xf456c","gas":"0xa485","value":"0x0","input":"0xa9059cbb0000000000000000000000000adb6caa256a5375c638c00e2ff80a9ac1b2d3a7000000000000000000000000000000000000000000000000000000000007a120","v":"0x1","r":"0xba020c08cd0da1e30b315eccbae2b24c8a3aab0f98649ce6879df4a215e2a52d","s":"0x78ef66b8d67deb8e84add943cf2c302950325d96e1d48916b4f45f403c7b52a5","to":"0x94b008aa00579c1307b0ef2c499ad98a8ce58e58","chainId":"0xa","accessList":[],"hash":"0xedab8b30bc56913f4d435cfb1b7056bbc1435ca9e2db5fb235378f2abedbb469"},"HashToSign":"0xf93b88f79710ca347351d67def900c941fee479bd8c233655f97c549b75a1823","Signature":"ugIMCM0NoeMLMV7MuuKyTIo6qw+YZJzmh530ohXipS1472a41n3rjoSt2UPPLDApUDJdluHUiRa09F9APHtSpQE=","SentHash":"0xedab8b30bc56913f4d435cfb1b7056bbc1435ca9e2db5fb235378f2abedbb469"},"ApprovalTxData":null}]`
|
|
|
|
return createDBParams(routeInputParamsJSON, buildInputParamsJSON, transactionDetailsJSON)
|
|
}
|