Skip to content

Commit

Permalink
Merge pull request #37 from 0xProject/fix/encoding-rules-export
Browse files Browse the repository at this point in the history
export and `EncodingRules` from utils
  • Loading branch information
dorothy-zbornak authored Apr 26, 2021
2 parents 6a16a67 + 25c6f3b commit a5a594b
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 5 deletions.
9 changes: 9 additions & 0 deletions abi-gen/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"version": "5.5.2",
"changes": [
{
"note": "Use `EncodingRules` instead of `AbiEncoder.EncodingRules` in templates",
"pr": 37
}
]
},
{
"timestamp": 1619466964,
"version": "5.5.1",
Expand Down
4 changes: 2 additions & 2 deletions abi-gen/templates/TypeScript/contract.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
TxAccessListWithGas,
SupportedProvider,
} from 'ethereum-types';
import { AbiEncoder, BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { assert } from '@0x/assert';
Expand Down Expand Up @@ -381,7 +381,7 @@ export class {{contractName}}Contract extends BaseContract {
txDefaults?: Partial<TxData>,
logDecodeDependencies?: { [contractName: string]: ContractAbi },
deployedBytecode: string | undefined = {{contractName}}Contract.deployedBytecode,
encodingRules?: AbiEncoder.EncodingRules,
encodingRules?: EncodingRules,
) {
super('{{contractName}}', {{contractName}}Contract.ABI(), address, supportedProvider, txDefaults, logDecodeDependencies, deployedBytecode, encodingRules);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
Expand Down
4 changes: 3 additions & 1 deletion abi-gen/test-cli/output/typescript/abi_gen_dummy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
TxAccessListWithGas,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { assert } from '@0x/assert';
Expand Down Expand Up @@ -2140,6 +2140,7 @@ export class AbiGenDummyContract extends BaseContract {
txDefaults?: Partial<TxData>,
logDecodeDependencies?: { [contractName: string]: ContractAbi },
deployedBytecode: string | undefined = AbiGenDummyContract.deployedBytecode,
encodingRules?: EncodingRules,
) {
super(
'AbiGenDummy',
Expand All @@ -2149,6 +2150,7 @@ export class AbiGenDummyContract extends BaseContract {
txDefaults,
logDecodeDependencies,
deployedBytecode,
encodingRules,
);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
this._subscriptionManager = new SubscriptionManager<AbiGenDummyEventArgs, AbiGenDummyEvents>(
Expand Down
4 changes: 3 additions & 1 deletion abi-gen/test-cli/output/typescript/lib_dummy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
TxAccessListWithGas,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { assert } from '@0x/assert';
Expand Down Expand Up @@ -222,6 +222,7 @@ export class LibDummyContract extends BaseContract {
txDefaults?: Partial<TxData>,
logDecodeDependencies?: { [contractName: string]: ContractAbi },
deployedBytecode: string | undefined = LibDummyContract.deployedBytecode,
encodingRules?: EncodingRules,
) {
super(
'LibDummy',
Expand All @@ -231,6 +232,7 @@ export class LibDummyContract extends BaseContract {
txDefaults,
logDecodeDependencies,
deployedBytecode,
encodingRules,
);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
LibDummyContract.ABI().forEach((item, index) => {
Expand Down
4 changes: 3 additions & 1 deletion abi-gen/test-cli/output/typescript/test_lib_dummy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
TxAccessListWithGas,
SupportedProvider,
} from 'ethereum-types';
import { BigNumber, classUtils, hexUtils, logUtils, providerUtils } from '@0x/utils';
import { AbiEncoder, BigNumber, classUtils, EncodingRules, hexUtils, logUtils, providerUtils } from '@0x/utils';
import { EventCallback, IndexedFilterValues, SimpleContractArtifact } from '@0x/types';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { assert } from '@0x/assert';
Expand Down Expand Up @@ -315,6 +315,7 @@ export class TestLibDummyContract extends BaseContract {
txDefaults?: Partial<TxData>,
logDecodeDependencies?: { [contractName: string]: ContractAbi },
deployedBytecode: string | undefined = TestLibDummyContract.deployedBytecode,
encodingRules?: EncodingRules,
) {
super(
'TestLibDummy',
Expand All @@ -324,6 +325,7 @@ export class TestLibDummyContract extends BaseContract {
txDefaults,
logDecodeDependencies,
deployedBytecode,
encodingRules,
);
classUtils.bindAll(this, ['_abiEncoderByFunctionSignature', 'address', '_web3Wrapper']);
TestLibDummyContract.ABI().forEach((item, index) => {
Expand Down
9 changes: 9 additions & 0 deletions utils/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"version": "6.4.2",
"changes": [
{
"note": "Export `EncodingRules` and `DecodingRules` at the root level",
"pr": 37
}
]
},
{
"version": "6.4.1",
"changes": [
Expand Down
1 change: 1 addition & 0 deletions utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export { fetchAsync } from './fetch_async';
export { signTypedDataUtils } from './sign_typed_data_utils';
export { hexUtils } from './hex_utils';
export import AbiEncoder = require('./abi_encoder');
export { EncodingRules, DecodingRules } from './abi_encoder';
export * from './types';
export { generatePseudoRandom256BitNumber } from './random';
export {
Expand Down

0 comments on commit a5a594b

Please sign in to comment.