Small U8a cleanup for Moment, duplicate line in Text (#383)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user