Skip to content

Commit

Permalink
Small U8a cleanup for Moment, duplicate line in Text (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Nov 7, 2018
1 parent 0175d78 commit f1920e9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion packages/types/src/Moment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 0 additions & 2 deletions packages/types/src/Text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit f1920e9

Please sign in to comment.