Update with currently available roles (#178)

This commit is contained in:
Jaco Greeff
2018-07-26 17:57:10 +02:00
committed by GitHub
parent 40dff50407
commit cf6325d7b5
4 changed files with 5 additions and 7 deletions
+1 -2
View File
@@ -8,8 +8,7 @@ const all: RoleMap = {
none: 0b00000000,
full: 0b00000001,
light: 0b00000010,
collator: 0b00000100,
validator: 0b00001000
authority: 0b00000100
};
export default all;
@@ -7,7 +7,7 @@ import rolesFromId from './fromId';
describe('rolesFromId', () => {
it('returns the role mapping an string', () => {
expect(
rolesFromId(0b00000100 | 0b00001000)
).toEqual(['none', 'collator', 'validator']);
rolesFromId(0b00000001 | 0b00000100)
).toEqual(['none', 'full', 'authority']);
});
});
+1 -2
View File
@@ -6,8 +6,7 @@ export type RoleMap = {
none: number,
full: number,
light: number,
collator: number,
validator: number
authority: number
};
export type Role = keyof RoleMap;
@@ -7,7 +7,7 @@ import rolesToId from './toId';
describe('rolesToId', () => {
it('returns the role mapping an string', () => {
expect(
rolesToId(['collator'])
rolesToId(['authority'])
).toEqual(0b00000100);
});
});