Expand available middleware methods (#7275)

* Expand available methods

* Updated with expanded groupings
This commit is contained in:
Jaco Greeff 2017-12-13 12:02:31 +01:00 committed by GitHub
parent 82d7fc54b3
commit 053c009cdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 79 additions and 30 deletions

View File

@ -17,16 +17,33 @@
const methodGroups = { const methodGroups = {
shell: { shell: {
methods: [ methods: [
'shell_loadApp'
]
},
dapps: {
methods: [
'parity_dappsRefresh',
'parity_dappsUrl',
'shell_getApps', 'shell_getApps',
'shell_getFilteredMethods', 'shell_getMethodPermissions'
'shell_getMethodGroups', ]
'shell_getMethodPermissions', },
dappsEdit: {
methods: [
'shell_setAppPinned',
'shell_setAppVisibility', 'shell_setAppVisibility',
'shell_setMethodPermissions' 'shell_setMethodPermissions'
] ]
}, },
accountsView: { accounts: {
methods: ['parity_accountsInfo', 'parity_allAccountsInfo'] methods: [
'parity_accountsInfo',
'parity_allAccountsInfo',
'parity_getNewDappsAddresses',
'parity_getNewDappsDefaultAddress',
'parity_hardwareAccountsInfo',
'parity_lockedHardwareAccountsInfo'
]
}, },
accountsCreate: { accountsCreate: {
methods: [ methods: [
@ -40,35 +57,67 @@ const methodGroups = {
] ]
}, },
accountsEdit: { accountsEdit: {
methods: ['parity_setAccountName', 'parity_setAccountMeta']
},
upgrade: {
methods: [ methods: [
'parity_consensusCapability', 'parity_setAccountName',
'parity_executeUpgrade', 'parity_setAccountMeta',
'parity_upgradeReady', 'parity_hardwarePinMatrixAck',
'parity_versionInfo' 'parity_setNewDappsAddresses',
'parity_setNewDappsDefaultAddress'
]
},
accountsDelete: {
methods: [
'parity_killAccount',
'parity_removeAddress'
] ]
}, },
vaults: { vaults: {
methods: [ methods: [
'parity_changeVault',
'parity_changeVaultPassword',
'parity_closeVault', 'parity_closeVault',
'parity_getVaultMeta', 'parity_getVaultMeta',
'parity_listVaults', 'parity_listVaults',
'parity_listOpenedVaults', 'parity_listOpenedVaults',
'parity_newVault', 'parity_openVault'
'parity_openVault', ]
},
vaultsCreate: {
methods: [
'parity_newVault'
]
},
vaultsEdit: {
methods: [
'parity_changeVault',
'parity_changeVaultPassword',
'parity_setVaultMeta' 'parity_setVaultMeta'
] ]
}, },
other: { signerRequests: {
methods: [ methods: [
'parity_checkRequest', 'parity_checkRequest',
'parity_hashContent',
'parity_localTransactions' 'parity_localTransactions'
] ]
},
signerConfirm: {
methods: [
'parity_confirmRequest',
'parity_confirmRequestRaw',
'parity_rejectRequest'
]
},
node: {
methods: [
'parity_hashContent',
'parity_consensusCapability',
'parity_upgradeReady',
'parity_versionInfo',
'parity_wsUrl'
]
},
nodeUpgrade: {
methods: [
'parity_executeUpgrade'
]
} }
}; };

View File

@ -74,18 +74,6 @@ export default function execute (appId, method, params, callback) {
return true; return true;
} }
case 'shell_setAppVisibility': {
const [appId, visibility] = params;
callback(
null,
visibility
? dappsStore.showApp(appId)
: dappsStore.hideApp(appId)
);
return true;
}
case 'shell_setAppPinned': { case 'shell_setAppPinned': {
const [appId, pinned] = params; const [appId, pinned] = params;
@ -98,6 +86,18 @@ export default function execute (appId, method, params, callback) {
return true; return true;
} }
case 'shell_setAppVisibility': {
const [appId, visibility] = params;
callback(
null,
visibility
? dappsStore.showApp(appId)
: dappsStore.hideApp(appId)
);
return true;
}
case 'shell_setMethodPermissions': { case 'shell_setMethodPermissions': {
const [permissions] = params; const [permissions] = params;