Skip to content

Commit

Permalink
Adding missing mock APIClient
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Oct 13, 2023
1 parent acc8ebc commit 7166658
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 2 deletions.
105 changes: 105 additions & 0 deletions test/data/7bb57e23b35a734db0875477bf749505aa9a3c0a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"request": {
"path": "https://jungle4.greymass.com/v1/chain/get_account",
"params": {
"method": "POST",
"body": "{\"account_name\":\"wharfkit1111\"}"
}
},
"status": 200,
"json": {
"account_name": "wharfkit1111",
"head_block_num": 102935351,
"head_block_time": "2023-10-13T19:12:47.500",
"privileged": false,
"last_code_update": "1970-01-01T00:00:00.000",
"created": "2022-12-07T01:11:58.500",
"core_liquid_balance": "996.6224 EOS",
"ram_quota": 13477,
"net_weight": 1010000,
"cpu_weight": 5010000,
"net_limit": {
"used": 1607,
"available": 1555501,
"max": 1557108
},
"cpu_limit": {
"used": 1876,
"available": 1433668,
"max": 1435544
},
"ram_usage": 3606,
"permissions": [
{
"perm_name": "active",
"parent": "owner",
"required_auth": {
"threshold": 1,
"keys": [
{
"key": "EOS6XXTaRpWhPwnb7CTV9zVsCBrvCpYMMPSk8E8hsJxhf6VFW9DYN",
"weight": 1
}
],
"accounts": [],
"waits": []
},
"linked_actions": []
},
{
"perm_name": "owner",
"parent": "",
"required_auth": {
"threshold": 1,
"keys": [
{
"key": "EOS6XXTaRpWhPwnb7CTV9zVsCBrvCpYMMPSk8E8hsJxhf6VFW9DYN",
"weight": 1
}
],
"accounts": [],
"waits": []
},
"linked_actions": []
},
{
"perm_name": "test",
"parent": "active",
"required_auth": {
"threshold": 1,
"keys": [
{
"key": "EOS6RMS3nvoN9StPzZizve6WdovaDkE5KkEcCDXW7LbepyAioMiK6",
"weight": 1
}
],
"accounts": [],
"waits": []
},
"linked_actions": [
{
"account": "eosio.token",
"action": "transfer"
}
]
}
],
"total_resources": {
"owner": "wharfkit1111",
"net_weight": "101.0000 EOS",
"cpu_weight": "501.0000 EOS",
"ram_bytes": 12077
},
"self_delegated_bandwidth": null,
"refund_request": null,
"voter_info": null,
"rex_info": null,
"subjective_cpu_bill_limit": {
"used": 0,
"available": 0,
"max": 0
},
"eosio_any_linked_actions": []
},
"text": "{\"account_name\":\"wharfkit1111\",\"head_block_num\":102935351,\"head_block_time\":\"2023-10-13T19:12:47.500\",\"privileged\":false,\"last_code_update\":\"1970-01-01T00:00:00.000\",\"created\":\"2022-12-07T01:11:58.500\",\"core_liquid_balance\":\"996.6224 EOS\",\"ram_quota\":13477,\"net_weight\":1010000,\"cpu_weight\":5010000,\"net_limit\":{\"used\":1607,\"available\":1555501,\"max\":1557108},\"cpu_limit\":{\"used\":1876,\"available\":1433668,\"max\":1435544},\"ram_usage\":3606,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS6XXTaRpWhPwnb7CTV9zVsCBrvCpYMMPSk8E8hsJxhf6VFW9DYN\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS6XXTaRpWhPwnb7CTV9zVsCBrvCpYMMPSk8E8hsJxhf6VFW9DYN\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"test\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS6RMS3nvoN9StPzZizve6WdovaDkE5KkEcCDXW7LbepyAioMiK6\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"eosio.token\",\"action\":\"transfer\"}]}],\"total_resources\":{\"owner\":\"wharfkit1111\",\"net_weight\":\"101.0000 EOS\",\"cpu_weight\":\"501.0000 EOS\",\"ram_bytes\":12077},\"self_delegated_bandwidth\":null,\"refund_request\":null,\"voter_info\":null,\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":0,\"available\":0,\"max\":0},\"eosio_any_linked_actions\":[]}"
}
6 changes: 4 additions & 2 deletions test/tests/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import {
UInt16,
WaitWeight,
} from '@wharfkit/antelope'
import {mockAccountName} from '@wharfkit/mock-data'
import {makeClient, mockAccountName} from '@wharfkit/mock-data'
import {Chains} from '@wharfkit/common'

import {Account, AccountKit, Permission} from '../../src'

const accountKit = new AccountKit(Chains.Jungle4)
const accountKit = new AccountKit(Chains.Jungle4, {
client: makeClient('https://jungle4.greymass.com'),
})

suite('Permission', function () {
let testAccount: Account
Expand Down

0 comments on commit 7166658

Please sign in to comment.