Proper default accounts RPCs (#4580)
* Default accounts setting - account provider * RPC support for default accounts * Updating JS code * Rename whitelist to addresses
This commit is contained in:
@@ -61,7 +61,7 @@ export default class AccountStore {
|
||||
this.setDefaultAccount(address);
|
||||
|
||||
return this._api.parity
|
||||
.setNewDappsWhitelist(accounts)
|
||||
.setNewDappsAddresses(accounts)
|
||||
.catch((error) => {
|
||||
console.warn('makeDefaultAccount', error);
|
||||
});
|
||||
@@ -78,7 +78,7 @@ export default class AccountStore {
|
||||
|
||||
return Promise
|
||||
.all([
|
||||
this._api.parity.getNewDappsWhitelist(),
|
||||
this._api.parity.getNewDappsAddresses(),
|
||||
this._api.parity.allAccountsInfo()
|
||||
])
|
||||
.then(([whitelist, accounts]) => {
|
||||
|
||||
@@ -76,8 +76,8 @@ describe('views/ParityBar/AccountStore', () => {
|
||||
store.setAccounts.restore();
|
||||
});
|
||||
|
||||
it('calls into parity_getNewDappsWhitelist', () => {
|
||||
expect(api.parity.getNewDappsWhitelist).to.have.been.called;
|
||||
it('calls into parity_getNewDappsAddresses', () => {
|
||||
expect(api.parity.getNewDappsAddresses).to.have.been.called;
|
||||
});
|
||||
|
||||
it('calls into parity_allAccountsInfo', () => {
|
||||
@@ -104,8 +104,8 @@ describe('views/ParityBar/AccountStore', () => {
|
||||
return store.makeDefaultAccount(ACCOUNT_NEW);
|
||||
});
|
||||
|
||||
it('calls into parity_setNewDappsWhitelist (with ordering)', () => {
|
||||
expect(api.parity.setNewDappsWhitelist).to.have.been.calledWith([
|
||||
it('calls into parity_setNewDappsAddresses (with ordering)', () => {
|
||||
expect(api.parity.setNewDappsAddresses).to.have.been.calledWith([
|
||||
ACCOUNT_NEW, ACCOUNT_FIRST, ACCOUNT_DEFAULT
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -36,8 +36,8 @@ function createApi () {
|
||||
parity: {
|
||||
defaultAccount: sinon.stub().resolves(ACCOUNT_DEFAULT),
|
||||
allAccountsInfo: sinon.stub().resolves(ACCOUNTS),
|
||||
getNewDappsWhitelist: sinon.stub().resolves(null),
|
||||
setNewDappsWhitelist: sinon.stub().resolves(true)
|
||||
getNewDappsAddresses: sinon.stub().resolves(null),
|
||||
setNewDappsAddresses: sinon.stub().resolves(true)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user