Fix entries values decoding (#2011)

* Fix entries values decoding

* Linting

* Properly unwrap storage subs
This commit is contained in:
Jaco Greeff
2020-03-08 12:57:03 +01:00
committed by GitHub
parent 17f7e4b753
commit 9bf854445c
7 changed files with 209 additions and 56 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ export default class Raw extends Uint8Array implements IU8a {
* @description Returns the base runtime type name for this instance
*/
public toRawType (): string {
return '&[u8]';
return 'Raw';
}
/**
@@ -0,0 +1,23 @@
// Copyright 2017-2020 @polkadot/types authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { TypeRegistry } from '../../create';
describe('Exposure', (): void => {
const registry = new TypeRegistry();
it('properly decodes an Exposure', (): void => {
expect(
registry.createType('Exposure', '0x0fd2c5f6bc904d990f94373671da716d04fe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e0f3e8ec04bb6db2b').toHuman()
).toEqual({
others: [{
value: '12.344k Unit',
who: '5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc'
}],
own: '30.805k Unit',
total: '43.150k Unit'
});
});
});