fixed typo
This commit is contained in:
parent
d831e559f0
commit
f3539bf448
@ -20,7 +20,7 @@ export class DynamicBytesDataType extends AbstractBlobDataType {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!_.startsWith(value, '0x')) {
|
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) {
|
} else if (value.length % 2 !== 0) {
|
||||||
throw new Error(`Tried to assign ${value}, which is contains a half-byte. Use full bytes only.`);
|
throw new Error(`Tried to assign ${value}, which is contains a half-byte. Use full bytes only.`);
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ export class StaticBytesDataType extends AbstractBlobDataType {
|
|||||||
private _sanityCheckValue(value: string | Buffer): void {
|
private _sanityCheckValue(value: string | Buffer): void {
|
||||||
if (typeof value === 'string') {
|
if (typeof value === 'string') {
|
||||||
if (!_.startsWith(value, '0x')) {
|
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) {
|
} else if (value.length % 2 !== 0) {
|
||||||
throw new Error(`Tried to assign ${value}, which is contains a half-byte. Use full bytes only.`);
|
throw new Error(`Tried to assign ${value}, which is contains a half-byte. Use full bytes only.`);
|
||||||
}
|
}
|
||||||
|
@ -1121,7 +1121,7 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
|
|||||||
// Encode Args and validate result
|
// Encode Args and validate result
|
||||||
expect(() => {
|
expect(() => {
|
||||||
dataType.encode(args, encodingRules);
|
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 () => {
|
it('Should throw when pass in bad hex (include a half-byte)', async () => {
|
||||||
// Create DataType object
|
// Create DataType object
|
||||||
@ -1235,7 +1235,7 @@ describe('ABI Encoder: EVM Data Type Encoding/Decoding', () => {
|
|||||||
// Encode Args and validate result
|
// Encode Args and validate result
|
||||||
expect(() => {
|
expect(() => {
|
||||||
dataType.encode(args, encodingRules);
|
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 () => {
|
it('Should throw when pass in bad hex (include a half-byte)', async () => {
|
||||||
// Create DataType object
|
// Create DataType object
|
||||||
|
Loading…
x
Reference in New Issue
Block a user