Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Fixed typo in ABI Encoder error message #1808

Merged
merged 2 commits into from
May 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/utils/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
[
{
"version": "4.3.3",
"changes": [
{
"note": "Fixed spelling error in ABI Encoder error message",
"pr": 1808
}
]
},
{
"version": "4.3.2",
"changes": [
{
"note": "Support for ABI encoding multibyte strings (fixes issue #1723)"
"note": "Support for ABI encoding multibyte strings (fixes issue #1723)",
"pr": 1806
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/test/abi_encoder/evm_data_types_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down