Expand identity derive fields (incl. all) (#1680)

This commit is contained in:
Jaco Greeff
2019-12-19 11:00:47 +01:00
committed by GitHub
parent 26734bf8bf
commit 9196ce85a0
3 changed files with 33 additions and 4 deletions
+9
View File
@@ -9,6 +9,7 @@ import { isString, isU8a, u8aToU8a } from '@polkadot/util';
import Enum from '../codec/Enum';
import { createType } from '../codec/create/createType';
import Bytes from './Bytes';
import H256 from './H256';
function decodeDataU8a (registry: Registry, value: Uint8Array): [any, number | undefined] {
if (!value.length) {
@@ -66,10 +67,18 @@ export default class Data extends Enum {
return this.raw as Bytes;
}
get asSha256 (): H256 {
return this.raw as H256;
}
get isRaw (): boolean {
return this.index === 1;
}
get isSha256 (): boolean {
return this.index === 3;
}
/**
* @description The encoded length
*/