Test for Bytes (string input) (#749)

This commit is contained in:
Jaco Greeff
2019-03-01 09:39:56 +01:00
committed by GitHub
parent 0157f0b2e2
commit 806a37c50c
@@ -9,6 +9,12 @@ describe('Bytes', () => {
const CODE = new Uint8Array([0x14, 0x3a, 0x63, 0x6f, 0x64, 0x65]);
describe('construction', () => {
it('decodes when input is string', () => {
expect(
new Bytes(':code').toU8a()
).toEqual(CODE);
});
it('decodes when hex is not length prefixed', () => {
expect(
new Bytes('0x3a636f6465').toU8a()