fixed typo

This commit is contained in:
Greg Hysen 2019-05-08 11:01:30 -07:00
parent d831e559f0
commit f3539bf448
3 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ export class DynamicBytesDataType extends AbstractBlobDataType {
return;
}
if (!_.startsWith(value, '0x')) {
throw new Error(`Tried to encode non-hex value. Value must inlcude '0x' prefix.`);
throw new Error(`Tried to encode non-hex value. Value must include '0x' prefix.`);
} else if (value.length % 2 !== 0) {
throw new Error(`Tried to assign ${value}, which is contains a half-byte. Use full bytes only.`);
}

View File

@ -68,7 +68,7 @@ export class StaticBytesDataType extends AbstractBlobDataType {
private _sanityCheckValue(value: string | Buffer): void {
if (typeof value === 'string') {
if (!_.startsWith(value, '0x')) {
throw new Error(`Tried to encode non-hex value. Value must inlcude '0x' prefix.`);
throw new Error(`Tried to encode non-hex value. Value must include '0x' prefix.`);
} else if (value.length % 2 !== 0) {
throw new Error(`Tried to assign ${value}, which is contains a half-byte. Use full bytes only.`);
}

View File

@ -1121,7 +1121,7 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Encode Args and validate result
expect(() => {
dataType.encode(args, encodingRules);
}).to.throw("Tried to encode non-hex value. Value must inlcude '0x' prefix.");
}).to.throw("Tried to encode non-hex value. Value must include '0x' prefix.");
});
it('Should throw when pass in bad hex (include a half-byte)', async () => {
// Create DataType object
@ -1235,7 +1235,7 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
// Encode Args and validate result
expect(() => {
dataType.encode(args, encodingRules);
}).to.throw("Tried to encode non-hex value. Value must inlcude '0x' prefix.");
}).to.throw("Tried to encode non-hex value. Value must include '0x' prefix.");
});
it('Should throw when pass in bad hex (include a half-byte)', async () => {
// Create DataType object