test_: added wallet tests (#6062)

This commit is contained in:
Yevheniia Berdnyk 2024-11-12 15:30:13 +02:00 committed by GitHub
parent 7ee45bab1c
commit 1887b00435
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 1632 additions and 4 deletions

View File

@ -0,0 +1,104 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"required": [
"id",
"jsonrpc",
"result"
],
"properties": {
"id": {
"type": "string"
},
"jsonrpc": {
"type": "string"
},
"result": {
"type": "array",
"items": {
"type": "object",
"required": [
"address",
"chat",
"clock",
"colorId",
"createdAt",
"emoji",
"hidden",
"key-uid",
"mixedcase-address",
"name",
"operable",
"path",
"position",
"prodPreferredChainIds",
"public-key",
"removed",
"testPreferredChainIds",
"type",
"wallet"
],
"properties": {
"address": {
"type": "string"
},
"chat": {
"type": "boolean"
},
"clock": {
"type": "integer"
},
"colorId": {
"type": "string"
},
"createdAt": {
"type": "integer"
},
"emoji": {
"type": "string"
},
"hidden": {
"type": "boolean"
},
"key-uid": {
"type": "string"
},
"mixedcase-address": {
"type": "string"
},
"name": {
"type": "string"
},
"operable": {
"type": "string"
},
"path": {
"type": "string"
},
"position": {
"type": "integer"
},
"prodPreferredChainIds": {
"type": "string"
},
"public-key": {
"type": "string"
},
"removed": {
"type": "boolean"
},
"testPreferredChainIds": {
"type": "string"
},
"type": {
"type": "string"
},
"wallet": {
"type": "boolean"
}
}
}
}
}
}

View File

@ -0,0 +1,60 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"required": [
"id",
"jsonrpc",
"result"
],
"properties": {
"id": {
"type": "string"
},
"jsonrpc": {
"type": "string"
},
"result": {
"type": "array",
"items": {
"type": "object",
"required": [
"emoji",
"id",
"isPopular",
"isToken",
"name",
"shortName",
"symbol",
"unicode"
],
"properties": {
"emoji": {
"type": "string"
},
"id": {
"type": "string"
},
"isPopular": {
"type": "boolean"
},
"isToken": {
"type": "boolean"
},
"name": {
"type": "string"
},
"shortName": {
"type": "string"
},
"symbol": {
"type": "string"
},
"unicode": {
"type": "string"
}
}
}
}
}
}

View File

@ -0,0 +1,21 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"required": [
"id",
"jsonrpc",
"result"
],
"properties": {
"id": {
"type": "string"
},
"jsonrpc": {
"type": "string"
},
"result": {
"type": "null"
}
}
}

View File

@ -0,0 +1,33 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"required": [
"id",
"jsonrpc",
"result"
],
"properties": {
"id": {
"type": "string"
},
"jsonrpc": {
"type": "string"
},
"result": {
"type": "object",
"required": [
"cursor",
"notifications"
],
"properties": {
"cursor": {
"type": "string"
},
"notifications": {
"type": "null"
}
}
}
}
}

View File

@ -0,0 +1,457 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"required": [
"jsonrpc",
"id",
"result"
],
"properties": {
"jsonrpc": {
"type": "string"
},
"id": {
"type": "string"
},
"result": {
"type": "object",
"required": [
"DAI",
"ETH",
"EUROC",
"STT",
"UNI",
"USDC",
"WEENUS",
"WETH",
"WETH9",
"XEENUS",
"YEENUS",
"ZEENUS"
],
"properties": {
"DAI": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "number"
},
"HIGHDAY": {
"type": "number"
},
"LOWDAY": {
"type": "number"
},
"CHANGEPCTHOUR": {
"type": "number"
},
"CHANGEPCTDAY": {
"type": "number"
},
"CHANGEPCT24HOUR": {
"type": "number"
},
"CHANGE24HOUR": {
"type": "number"
}
}
},
"ETH": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "number"
},
"HIGHDAY": {
"type": "number"
},
"LOWDAY": {
"type": "number"
},
"CHANGEPCTHOUR": {
"type": "number"
},
"CHANGEPCTDAY": {
"type": "number"
},
"CHANGEPCT24HOUR": {
"type": "number"
},
"CHANGE24HOUR": {
"type": "number"
}
}
},
"EUROC": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "integer"
},
"HIGHDAY": {
"type": "integer"
},
"LOWDAY": {
"type": "integer"
},
"CHANGEPCTHOUR": {
"type": "integer"
},
"CHANGEPCTDAY": {
"type": "integer"
},
"CHANGEPCT24HOUR": {
"type": "integer"
},
"CHANGE24HOUR": {
"type": "integer"
}
}
},
"STT": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "number"
},
"HIGHDAY": {
"type": "number"
},
"LOWDAY": {
"type": "number"
},
"CHANGEPCTHOUR": {
"type": "number"
},
"CHANGEPCTDAY": {
"type": "number"
},
"CHANGEPCT24HOUR": {
"type": "number"
},
"CHANGE24HOUR": {
"type": "number"
}
}
},
"UNI": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "number"
},
"HIGHDAY": {
"type": "number"
},
"LOWDAY": {
"type": "number"
},
"CHANGEPCTHOUR": {
"type": "number"
},
"CHANGEPCTDAY": {
"type": "number"
},
"CHANGEPCT24HOUR": {
"type": "number"
},
"CHANGE24HOUR": {
"type": "number"
}
}
},
"USDC": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "number"
},
"HIGHDAY": {
"type": "number"
},
"LOWDAY": {
"type": "number"
},
"CHANGEPCTHOUR": {
"type": "number"
},
"CHANGEPCTDAY": {
"type": "number"
},
"CHANGEPCT24HOUR": {
"type": "number"
},
"CHANGE24HOUR": {
"type": "number"
}
}
},
"WEENUS": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "integer"
},
"HIGHDAY": {
"type": "integer"
},
"LOWDAY": {
"type": "integer"
},
"CHANGEPCTHOUR": {
"type": "integer"
},
"CHANGEPCTDAY": {
"type": "integer"
},
"CHANGEPCT24HOUR": {
"type": "integer"
},
"CHANGE24HOUR": {
"type": "integer"
}
}
},
"WETH": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "number"
},
"HIGHDAY": {
"type": "number"
},
"LOWDAY": {
"type": "number"
},
"CHANGEPCTHOUR": {
"type": "number"
},
"CHANGEPCTDAY": {
"type": "number"
},
"CHANGEPCT24HOUR": {
"type": "number"
},
"CHANGE24HOUR": {
"type": "number"
}
}
},
"WETH9": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "integer"
},
"HIGHDAY": {
"type": "integer"
},
"LOWDAY": {
"type": "integer"
},
"CHANGEPCTHOUR": {
"type": "integer"
},
"CHANGEPCTDAY": {
"type": "integer"
},
"CHANGEPCT24HOUR": {
"type": "integer"
},
"CHANGE24HOUR": {
"type": "integer"
}
}
},
"XEENUS": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "integer"
},
"HIGHDAY": {
"type": "integer"
},
"LOWDAY": {
"type": "integer"
},
"CHANGEPCTHOUR": {
"type": "integer"
},
"CHANGEPCTDAY": {
"type": "integer"
},
"CHANGEPCT24HOUR": {
"type": "integer"
},
"CHANGE24HOUR": {
"type": "integer"
}
}
},
"YEENUS": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "integer"
},
"HIGHDAY": {
"type": "integer"
},
"LOWDAY": {
"type": "integer"
},
"CHANGEPCTHOUR": {
"type": "integer"
},
"CHANGEPCTDAY": {
"type": "integer"
},
"CHANGEPCT24HOUR": {
"type": "integer"
},
"CHANGE24HOUR": {
"type": "integer"
}
}
},
"ZEENUS": {
"type": "object",
"required": [
"MKTCAP",
"HIGHDAY",
"LOWDAY",
"CHANGEPCTHOUR",
"CHANGEPCTDAY",
"CHANGEPCT24HOUR",
"CHANGE24HOUR"
],
"properties": {
"MKTCAP": {
"type": "integer"
},
"HIGHDAY": {
"type": "integer"
},
"LOWDAY": {
"type": "integer"
},
"CHANGEPCTHOUR": {
"type": "integer"
},
"CHANGEPCTDAY": {
"type": "integer"
},
"CHANGEPCT24HOUR": {
"type": "integer"
},
"CHANGE24HOUR": {
"type": "integer"
}
}
}
}
}
}
}

View File

@ -0,0 +1,169 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"required": [
"id",
"jsonrpc",
"result"
],
"properties": {
"id": {
"type": "string"
},
"jsonrpc": {
"type": "string"
},
"result": {
"type": "object",
"required": [
"DAI",
"ETH",
"EUROC",
"STT",
"UNI",
"USDC",
"WEENUS",
"WETH",
"WETH9",
"XEENUS",
"YEENUS",
"ZEENUS"
],
"properties": {
"DAI": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "number"
}
}
},
"ETH": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "number"
}
}
},
"EUROC": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "integer"
}
}
},
"STT": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "number"
}
}
},
"UNI": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "number"
}
}
},
"USDC": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "number"
}
}
},
"WEENUS": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "integer"
}
}
},
"WETH": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "number"
}
}
},
"WETH9": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "integer"
}
}
},
"XEENUS": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "integer"
}
}
},
"YEENUS": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "integer"
}
}
},
"ZEENUS": {
"type": "object",
"required": [
"usd"
],
"properties": {
"usd": {
"type": "integer"
}
}
}
}
}
}
}

View File

@ -0,0 +1,313 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"required": [
"jsonrpc",
"id",
"result"
],
"properties": {
"jsonrpc": {
"type": "string"
},
"id": {
"type": "string"
},
"result": {
"type": "object",
"required": [
"DAI",
"ETH",
"STT",
"UNI",
"USDC",
"WETH"
],
"properties": {
"DAI": {
"type": "object",
"required": [
"Id",
"Name",
"Symbol",
"Description",
"TotalCoinsMined",
"AssetLaunchDate",
"AssetWhitepaperUrl",
"AssetWebsiteUrl",
"BuiltOn",
"SmartContractAddress"
],
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
},
"Symbol": {
"type": "string"
},
"Description": {
"type": "string"
},
"TotalCoinsMined": {
"type": "number"
},
"AssetLaunchDate": {
"type": "string"
},
"AssetWhitepaperUrl": {
"type": "string"
},
"AssetWebsiteUrl": {
"type": "string"
},
"BuiltOn": {
"type": "string"
},
"SmartContractAddress": {
"type": "string"
}
}
},
"ETH": {
"type": "object",
"required": [
"Id",
"Name",
"Symbol",
"Description",
"TotalCoinsMined",
"AssetLaunchDate",
"AssetWhitepaperUrl",
"AssetWebsiteUrl",
"BuiltOn",
"SmartContractAddress"
],
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
},
"Symbol": {
"type": "string"
},
"Description": {
"type": "string"
},
"TotalCoinsMined": {
"type": "number"
},
"AssetLaunchDate": {
"type": "string"
},
"AssetWhitepaperUrl": {
"type": "string"
},
"AssetWebsiteUrl": {
"type": "string"
},
"BuiltOn": {
"type": "string"
},
"SmartContractAddress": {
"type": "string"
}
}
},
"STT": {
"type": "object",
"required": [
"Id",
"Name",
"Symbol",
"Description",
"TotalCoinsMined",
"AssetLaunchDate",
"AssetWhitepaperUrl",
"AssetWebsiteUrl",
"BuiltOn",
"SmartContractAddress"
],
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
},
"Symbol": {
"type": "string"
},
"Description": {
"type": "string"
},
"TotalCoinsMined": {
"type": "number"
},
"AssetLaunchDate": {
"type": "string"
},
"AssetWhitepaperUrl": {
"type": "string"
},
"AssetWebsiteUrl": {
"type": "string"
},
"BuiltOn": {
"type": "string"
},
"SmartContractAddress": {
"type": "string"
}
}
},
"UNI": {
"type": "object",
"required": [
"Id",
"Name",
"Symbol",
"Description",
"TotalCoinsMined",
"AssetLaunchDate",
"AssetWhitepaperUrl",
"AssetWebsiteUrl",
"BuiltOn",
"SmartContractAddress"
],
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
},
"Symbol": {
"type": "string"
},
"Description": {
"type": "string"
},
"TotalCoinsMined": {
"type": "number"
},
"AssetLaunchDate": {
"type": "string"
},
"AssetWhitepaperUrl": {
"type": "string"
},
"AssetWebsiteUrl": {
"type": "string"
},
"BuiltOn": {
"type": "string"
},
"SmartContractAddress": {
"type": "string"
}
}
},
"USDC": {
"type": "object",
"required": [
"Id",
"Name",
"Symbol",
"Description",
"TotalCoinsMined",
"AssetLaunchDate",
"AssetWhitepaperUrl",
"AssetWebsiteUrl",
"BuiltOn",
"SmartContractAddress"
],
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
},
"Symbol": {
"type": "string"
},
"Description": {
"type": "string"
},
"TotalCoinsMined": {
"type": "number"
},
"AssetLaunchDate": {
"type": "string"
},
"AssetWhitepaperUrl": {
"type": "string"
},
"AssetWebsiteUrl": {
"type": "string"
},
"BuiltOn": {
"type": "string"
},
"SmartContractAddress": {
"type": "string"
}
}
},
"WETH": {
"type": "object",
"required": [
"Id",
"Name",
"Symbol",
"Description",
"TotalCoinsMined",
"AssetLaunchDate",
"AssetWhitepaperUrl",
"AssetWebsiteUrl",
"BuiltOn",
"SmartContractAddress"
],
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
},
"Symbol": {
"type": "string"
},
"Description": {
"type": "string"
},
"TotalCoinsMined": {
"type": "number"
},
"AssetLaunchDate": {
"type": "string"
},
"AssetWhitepaperUrl": {
"type": "string"
},
"AssetWebsiteUrl": {
"type": "string"
},
"BuiltOn": {
"type": "string"
},
"SmartContractAddress": {
"type": "string"
}
}
}
}
}
}
}

View File

@ -0,0 +1,53 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"required": [
"type",
"event"
],
"properties": {
"type": {
"type": "string"
},
"event": {
"type": "object",
"required": [
"type",
"blockNumber",
"accounts",
"message",
"at",
"chainId",
"requestId",
"EventParams"
],
"properties": {
"type": {
"type": "string"
},
"blockNumber": {
"type": "null"
},
"accounts": {
"type": "null"
},
"message": {
"type": "string"
},
"at": {
"type": "integer"
},
"chainId": {
"type": "integer"
},
"requestId": {
"type": "integer"
},
"EventParams": {
"type": "null"
}
}
}
}
}

View File

@ -0,0 +1,53 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"required": [
"type",
"event"
],
"properties": {
"type": {
"type": "string"
},
"event": {
"type": "object",
"required": [
"type",
"blockNumber",
"accounts",
"message",
"at",
"chainId",
"requestId",
"EventParams"
],
"properties": {
"type": {
"type": "string"
},
"blockNumber": {
"type": "null"
},
"accounts": {
"type": "null"
},
"message": {
"type": "string"
},
"at": {
"type": "integer"
},
"chainId": {
"type": "integer"
},
"requestId": {
"type": "integer"
},
"EventParams": {
"type": "null"
}
}
}
}
}

View File

@ -0,0 +1,20 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"properties": {
"id": {
"type": "string"
},
"jsonrpc": {
"type": "string"
},
"result": {
"type": "null"
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
}

View File

@ -0,0 +1,216 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "http://example.com/example.json",
"type": "object",
"required": [
"id",
"jsonrpc",
"result"
],
"properties": {
"id": {
"type": "string"
},
"jsonrpc": {
"type": "string"
},
"result": {
"type": "object",
"required": [
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
],
"properties": {
"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266": {
"type": "array",
"items": {
"type": "object",
"required": [
"address",
"assetWebsiteUrl",
"balancesPerChain",
"builtOn",
"chainId",
"decimals",
"description",
"marketValuesPerCurrency",
"name",
"pegSymbol",
"symbol",
"tokenListId",
"verified"
],
"properties": {
"address": {
"type": "string"
},
"assetWebsiteUrl": {
"type": "string"
},
"balancesPerChain": {
"type": "object",
"required": [
"31337"
],
"properties": {
"31337": {
"type": "object",
"required": [
"address",
"balance",
"balance1DayAgo",
"chainId",
"hasError",
"rawBalance"
],
"properties": {
"address": {
"type": "string"
},
"balance": {
"type": "string"
},
"balance1DayAgo": {
"type": "string"
},
"chainId": {
"type": "integer"
},
"hasError": {
"type": "boolean"
},
"rawBalance": {
"type": "string"
}
}
}
}
},
"builtOn": {
"type": "string"
},
"chainId": {
"type": "integer"
},
"decimals": {
"type": "integer"
},
"description": {
"type": "string"
},
"marketValuesPerCurrency": {
"type": "object",
"required": [
"USD",
"usd"
],
"properties": {
"USD": {
"type": "object",
"required": [
"change24hour",
"changePct24hour",
"changePctDay",
"changePctHour",
"hasError",
"highDay",
"lowDay",
"marketCap",
"price"
],
"properties": {
"change24hour": {
"type": "number"
},
"changePct24hour": {
"type": "number"
},
"changePctDay": {
"type": "number"
},
"changePctHour": {
"type": "number"
},
"hasError": {
"type": "boolean"
},
"highDay": {
"type": "number"
},
"lowDay": {
"type": "number"
},
"marketCap": {
"type": "number"
},
"price": {
"type": "number"
}
}
},
"usd": {
"type": "object",
"required": [
"change24hour",
"changePct24hour",
"changePctDay",
"changePctHour",
"hasError",
"highDay",
"lowDay",
"marketCap",
"price"
],
"properties": {
"change24hour": {
"type": "number"
},
"changePct24hour": {
"type": "number"
},
"changePctDay": {
"type": "number"
},
"changePctHour": {
"type": "number"
},
"hasError": {
"type": "boolean"
},
"highDay": {
"type": "number"
},
"lowDay": {
"type": "number"
},
"marketCap": {
"type": "number"
},
"price": {
"type": "number"
}
}
}
}
},
"name": {
"type": "string"
},
"pegSymbol": {
"type": "string"
},
"symbol": {
"type": "string"
},
"tokenListId": {
"type": "string"
},
"verified": {
"type": "boolean"
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,20 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"properties": {
"id": {
"type": "string"
},
"jsonrpc": {
"type": "string"
},
"result": {
"type": "null"
}
},
"required": [
"id",
"jsonrpc",
"result"
],
"type": "object"
}

View File

@ -2,6 +2,7 @@ import random
import pytest
from constants import user_1
from test_cases import StatusBackendTestCase
@ -12,9 +13,11 @@ class TestAccounts(StatusBackendTestCase):
@pytest.mark.parametrize(
"method, params",
[
("accounts_getAccounts", []),
("accounts_getKeypairs", []),
("accounts_hasPairedDevices", []),
("accounts_remainingAccountCapacity", [])
("accounts_remainingAccountCapacity", []),
("multiaccounts_getIdentityImages", [user_1.private_key]),
],
)

View File

@ -0,0 +1,23 @@
import random
import pytest
from test_cases import StatusBackendTestCase
@pytest.mark.accounts
@pytest.mark.rpc
class TestAppGeneral(StatusBackendTestCase):
@pytest.mark.parametrize(
"method, params",
[
("appgeneral_getCurrencies", []),
],
)
def test_(self, method, params):
_id = str(random.randint(1, 8888))
response = self.rpc_client.rpc_valid_request(method, params, _id)
self.rpc_client.verify_json_schema(response.json(), method)

View File

@ -22,8 +22,10 @@ class StatusDTestCase:
class StatusBackendTestCase:
await_signals = []
def setup_class(self):
self.rpc_client = StatusBackend()
self.rpc_client = StatusBackend(await_signals=self.await_signals)
self.network_id = 31337
@ -140,3 +142,11 @@ class SignalTestCase(StatusDTestCase):
websocket_thread = threading.Thread(target=self.signal_client._connect)
websocket_thread.daemon = True
websocket_thread.start()
class SignalBackendTestCase(StatusBackendTestCase):
def setup_method(self):
websocket_thread = threading.Thread(target=self.rpc_client._connect)
websocket_thread.daemon = True
websocket_thread.start()

View File

@ -15,6 +15,7 @@ class TestRpc(StatusBackendTestCase):
"method, params",
[
("wakuext_peers", []),
("wakuext_activityCenterNotifications", [{"cursor": "", "limit": 20, "activityTypes": [5], "readType": 2}])
],
)
def test_(self, method, params):

View File

@ -5,7 +5,8 @@ import jsonschema
import pytest
from conftest import option
from test_cases import StatusBackendTestCase, TransactionTestCase
from constants import user_1
from test_cases import StatusBackendTestCase, TransactionTestCase, StatusDTestCase
@pytest.mark.wallet
@ -85,7 +86,36 @@ class TestRpc(StatusBackendTestCase):
("wallet_getEthereumChains", []),
("wallet_getTokenList", []),
("wallet_getCryptoOnRamps", []),
("wallet_getCachedCurrencyFormats", [])
("wallet_getCachedCurrencyFormats", []),
("wallet_fetchPrices",
[["WETH9", "USDC", "ZEENUS", "EUROC", "WEENUS", "XEENUS", "WETH", "ETH", "STT", "UNI", "YEENUS", "DAI"],
["usd"]]),
("wallet_fetchMarketValues",
[["WETH9", "USDC", "ZEENUS", "EUROC", "WEENUS", "XEENUS", "WETH", "ETH", "STT", "UNI", "YEENUS", "DAI"],
"usd"]),
("wallet_fetchTokenDetails",
[["WETH9", "USDC", "ZEENUS", "EUROC", "WEENUS", "XEENUS", "WETH", "ETH", "STT", "UNI", "YEENUS", "DAI"]]),
("wallet_checkRecentHistoryForChainIDs", [[31337], [user_1.address]]),
("wallet_getWalletConnectActiveSessions", [1728995277]),
("wallet_stopSuggestedRoutesAsyncCalculation", []),
]
)
def test_(self, method, params):
_id = str(random.randint(1, 8888))
response = self.rpc_client.rpc_valid_request(method, params, _id)
self.rpc_client.verify_json_schema(response.json(), method)
@pytest.mark.wallet
@pytest.mark.rpc
class TestRpcStatusD(StatusDTestCase): # temp for methods not implemented in Status Backend
@pytest.mark.parametrize(
"method, params",
[
("wallet_getWalletToken", [[user_1.address, ]]),
],
)
def test_(self, method, params):

View File

@ -0,0 +1,42 @@
import json
import random
import pytest
from constants import user_1
from test_cases import SignalBackendTestCase
@pytest.mark.wallet
@pytest.mark.rpc
class TestWalletRpcSignal(SignalBackendTestCase):
await_signals = ["wallet", ]
def setup_method(self):
super().setup_method()
self.request_id = str(random.randint(1, 8888))
def test_wallet_get_owned_collectibles_async(self):
method = "wallet_getOwnedCollectiblesAsync"
params = [0, [self.network_id, ], [user_1.address], None, 0, 25, 1,
{"fetch-type": 2, "max-cache-age-seconds": 3600}]
self.rpc_client.rpc_valid_request(method, params, self.request_id)
signal_response = self.rpc_client.wait_for_signal("wallet", timeout=60)
self.rpc_client.verify_json_schema(signal_response, method)
assert signal_response['event']['type'] == "wallet-owned-collectibles-filtering-done"
message = json.loads(signal_response['event']['message'].replace("'", "\""))
assert user_1.address in message['ownershipStatus'].keys()
def test_wallet_filter_activity_async(self):
method = "wallet_filterActivityAsync"
params = [1, [user_1.address], [self.network_id],
{"period": {"startTimestamp": 0, "endTimestamp": 0}, "types": [], "statuses": [],
"counterpartyAddresses": [], "assets": [], "collectibles": [], "filterOutAssets": False,
"filterOutCollectibles": False}, 0, 50]
self.rpc_client.rpc_valid_request(method, params, self.request_id)
signal_response = self.rpc_client.wait_for_signal("wallet", timeout=60)
self.rpc_client.verify_json_schema(signal_response, method)
assert signal_response['event']['type'] == "wallet-activity-filtering-done"
message = json.loads(signal_response['event']['message'].replace("'", "\""))
for item in message['activities']:
assert user_1.address in item['sender'], item['recipient']