Small U8a cleanup for Moment, duplicate line in Text (#383)

This commit is contained in:
Jaco Greeff
2018-11-07 21:05:28 +01:00
committed by GitHub
parent 0175d78603
commit f1920e911a
2 changed files with 1 additions and 3 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ export default class Moment extends Base<Date> {
} else if (value instanceof UInt) {
value = value.toBn();
} else if (value instanceof U8a) {
return Moment.decodeMoment(value);
return Moment.decodeMoment(value.raw);
} else if (isU8a(value)) {
value = u8aToBn(value.subarray(0, BITLENGTH / 8), true);
} else if (isString(value)) {
-2
View File
@@ -29,8 +29,6 @@ export default class Text extends Base<string> {
return value;
} else if (value instanceof Text) {
return value.raw;
} else if (value instanceof U8a) {
return Text.decodeText(value.raw);
} else if (value instanceof Uint8Array) {
const [offset, length] = Compact.decodeU8a(value, DEFAULT_LENGTH_BITS);