Merge branch 'feat/exchange-proxy/vip-uniswap' into fix/ep/meta-transactions
This commit is contained in:
@@ -7,8 +7,8 @@ import { ContractArtifact } from 'ethereum-types';
|
||||
|
||||
import * as AffiliateFeeTransformer from '../test/generated-artifacts/AffiliateFeeTransformer.json';
|
||||
import * as AllowanceTarget from '../test/generated-artifacts/AllowanceTarget.json';
|
||||
import * as Bootstrap from '../test/generated-artifacts/Bootstrap.json';
|
||||
import * as BridgeAdapter from '../test/generated-artifacts/BridgeAdapter.json';
|
||||
import * as BootstrapFeature from '../test/generated-artifacts/BootstrapFeature.json';
|
||||
import * as FillQuoteTransformer from '../test/generated-artifacts/FillQuoteTransformer.json';
|
||||
import * as FixinCommon from '../test/generated-artifacts/FixinCommon.json';
|
||||
import * as FixinEIP712 from '../test/generated-artifacts/FixinEIP712.json';
|
||||
@@ -16,22 +16,23 @@ import * as FixinReentrancyGuard from '../test/generated-artifacts/FixinReentran
|
||||
import * as FlashWallet from '../test/generated-artifacts/FlashWallet.json';
|
||||
import * as FullMigration from '../test/generated-artifacts/FullMigration.json';
|
||||
import * as IAllowanceTarget from '../test/generated-artifacts/IAllowanceTarget.json';
|
||||
import * as IBootstrap from '../test/generated-artifacts/IBootstrap.json';
|
||||
import * as IBridgeAdapter from '../test/generated-artifacts/IBridgeAdapter.json';
|
||||
import * as IBootstrapFeature from '../test/generated-artifacts/IBootstrapFeature.json';
|
||||
import * as IERC20Bridge from '../test/generated-artifacts/IERC20Bridge.json';
|
||||
import * as IERC20Transformer from '../test/generated-artifacts/IERC20Transformer.json';
|
||||
import * as IExchange from '../test/generated-artifacts/IExchange.json';
|
||||
import * as IFeature from '../test/generated-artifacts/IFeature.json';
|
||||
import * as IFlashWallet from '../test/generated-artifacts/IFlashWallet.json';
|
||||
import * as IGasToken from '../test/generated-artifacts/IGasToken.json';
|
||||
import * as IMetaTransactions from '../test/generated-artifacts/IMetaTransactions.json';
|
||||
import * as IMetaTransactionsFeature from '../test/generated-artifacts/IMetaTransactionsFeature.json';
|
||||
import * as InitialMigration from '../test/generated-artifacts/InitialMigration.json';
|
||||
import * as IOwnable from '../test/generated-artifacts/IOwnable.json';
|
||||
import * as ISignatureValidator from '../test/generated-artifacts/ISignatureValidator.json';
|
||||
import * as ISimpleFunctionRegistry from '../test/generated-artifacts/ISimpleFunctionRegistry.json';
|
||||
import * as IOwnableFeature from '../test/generated-artifacts/IOwnableFeature.json';
|
||||
import * as ISignatureValidatorFeature from '../test/generated-artifacts/ISignatureValidatorFeature.json';
|
||||
import * as ISimpleFunctionRegistryFeature from '../test/generated-artifacts/ISimpleFunctionRegistryFeature.json';
|
||||
import * as ITestSimpleFunctionRegistryFeature from '../test/generated-artifacts/ITestSimpleFunctionRegistryFeature.json';
|
||||
import * as ITokenSpender from '../test/generated-artifacts/ITokenSpender.json';
|
||||
import * as ITransformERC20 from '../test/generated-artifacts/ITransformERC20.json';
|
||||
import * as ITokenSpenderFeature from '../test/generated-artifacts/ITokenSpenderFeature.json';
|
||||
import * as ITransformERC20Feature from '../test/generated-artifacts/ITransformERC20Feature.json';
|
||||
import * as IUniswapV2Feature from '../test/generated-artifacts/IUniswapV2Feature.json';
|
||||
import * as IZeroEx from '../test/generated-artifacts/IZeroEx.json';
|
||||
import * as LibBootstrap from '../test/generated-artifacts/LibBootstrap.json';
|
||||
import * as LibCommonRichErrors from '../test/generated-artifacts/LibCommonRichErrors.json';
|
||||
@@ -55,7 +56,6 @@ import * as LibTransformERC20RichErrors from '../test/generated-artifacts/LibTra
|
||||
import * as LibTransformERC20Storage from '../test/generated-artifacts/LibTransformERC20Storage.json';
|
||||
import * as LibWalletRichErrors from '../test/generated-artifacts/LibWalletRichErrors.json';
|
||||
import * as LogMetadataTransformer from '../test/generated-artifacts/LogMetadataTransformer.json';
|
||||
import * as MetaTransactions from '../test/generated-artifacts/MetaTransactions.json';
|
||||
import * as MixinAdapterAddresses from '../test/generated-artifacts/MixinAdapterAddresses.json';
|
||||
import * as MixinBalancer from '../test/generated-artifacts/MixinBalancer.json';
|
||||
import * as MixinCurve from '../test/generated-artifacts/MixinCurve.json';
|
||||
@@ -65,10 +65,11 @@ import * as MixinOasis from '../test/generated-artifacts/MixinOasis.json';
|
||||
import * as MixinUniswap from '../test/generated-artifacts/MixinUniswap.json';
|
||||
import * as MixinUniswapV2 from '../test/generated-artifacts/MixinUniswapV2.json';
|
||||
import * as MixinZeroExBridge from '../test/generated-artifacts/MixinZeroExBridge.json';
|
||||
import * as Ownable from '../test/generated-artifacts/Ownable.json';
|
||||
import * as MetaTransactionsFeature from '../test/generated-artifacts/MetaTransactionsFeature.json';
|
||||
import * as OwnableFeature from '../test/generated-artifacts/OwnableFeature.json';
|
||||
import * as PayTakerTransformer from '../test/generated-artifacts/PayTakerTransformer.json';
|
||||
import * as SignatureValidator from '../test/generated-artifacts/SignatureValidator.json';
|
||||
import * as SimpleFunctionRegistry from '../test/generated-artifacts/SimpleFunctionRegistry.json';
|
||||
import * as SignatureValidatorFeature from '../test/generated-artifacts/SignatureValidatorFeature.json';
|
||||
import * as SimpleFunctionRegistryFeature from '../test/generated-artifacts/SimpleFunctionRegistryFeature.json';
|
||||
import * as TestCallTarget from '../test/generated-artifacts/TestCallTarget.json';
|
||||
import * as TestDelegateCaller from '../test/generated-artifacts/TestDelegateCaller.json';
|
||||
import * as TestFillQuoteTransformerBridge from '../test/generated-artifacts/TestFillQuoteTransformerBridge.json';
|
||||
@@ -91,9 +92,9 @@ import * as TestTransformerHost from '../test/generated-artifacts/TestTransforme
|
||||
import * as TestWeth from '../test/generated-artifacts/TestWeth.json';
|
||||
import * as TestWethTransformerHost from '../test/generated-artifacts/TestWethTransformerHost.json';
|
||||
import * as TestZeroExFeature from '../test/generated-artifacts/TestZeroExFeature.json';
|
||||
import * as TokenSpender from '../test/generated-artifacts/TokenSpender.json';
|
||||
import * as TokenSpenderFeature from '../test/generated-artifacts/TokenSpenderFeature.json';
|
||||
import * as Transformer from '../test/generated-artifacts/Transformer.json';
|
||||
import * as TransformERC20 from '../test/generated-artifacts/TransformERC20.json';
|
||||
import * as TransformERC20Feature from '../test/generated-artifacts/TransformERC20Feature.json';
|
||||
import * as TransformerDeployer from '../test/generated-artifacts/TransformerDeployer.json';
|
||||
import * as WethTransformer from '../test/generated-artifacts/WethTransformer.json';
|
||||
import * as ZeroEx from '../test/generated-artifacts/ZeroEx.json';
|
||||
@@ -125,21 +126,22 @@ export const artifacts = {
|
||||
IAllowanceTarget: IAllowanceTarget as ContractArtifact,
|
||||
IFlashWallet: IFlashWallet as ContractArtifact,
|
||||
TransformerDeployer: TransformerDeployer as ContractArtifact,
|
||||
Bootstrap: Bootstrap as ContractArtifact,
|
||||
IBootstrap: IBootstrap as ContractArtifact,
|
||||
BootstrapFeature: BootstrapFeature as ContractArtifact,
|
||||
IBootstrapFeature: IBootstrapFeature as ContractArtifact,
|
||||
IFeature: IFeature as ContractArtifact,
|
||||
IMetaTransactions: IMetaTransactions as ContractArtifact,
|
||||
IOwnable: IOwnable as ContractArtifact,
|
||||
ISignatureValidator: ISignatureValidator as ContractArtifact,
|
||||
ISimpleFunctionRegistry: ISimpleFunctionRegistry as ContractArtifact,
|
||||
ITokenSpender: ITokenSpender as ContractArtifact,
|
||||
ITransformERC20: ITransformERC20 as ContractArtifact,
|
||||
MetaTransactions: MetaTransactions as ContractArtifact,
|
||||
Ownable: Ownable as ContractArtifact,
|
||||
SignatureValidator: SignatureValidator as ContractArtifact,
|
||||
SimpleFunctionRegistry: SimpleFunctionRegistry as ContractArtifact,
|
||||
TokenSpender: TokenSpender as ContractArtifact,
|
||||
TransformERC20: TransformERC20 as ContractArtifact,
|
||||
IMetaTransactionsFeature: IMetaTransactionsFeature as ContractArtifact,
|
||||
IOwnableFeature: IOwnableFeature as ContractArtifact,
|
||||
ISignatureValidatorFeature: ISignatureValidatorFeature as ContractArtifact,
|
||||
ISimpleFunctionRegistryFeature: ISimpleFunctionRegistryFeature as ContractArtifact,
|
||||
ITokenSpenderFeature: ITokenSpenderFeature as ContractArtifact,
|
||||
ITransformERC20Feature: ITransformERC20Feature as ContractArtifact,
|
||||
IUniswapV2Feature: IUniswapV2Feature as ContractArtifact,
|
||||
MetaTransactionsFeature: MetaTransactionsFeature as ContractArtifact,
|
||||
OwnableFeature: OwnableFeature as ContractArtifact,
|
||||
SignatureValidatorFeature: SignatureValidatorFeature as ContractArtifact,
|
||||
SimpleFunctionRegistryFeature: SimpleFunctionRegistryFeature as ContractArtifact,
|
||||
TokenSpenderFeature: TokenSpenderFeature as ContractArtifact,
|
||||
TransformERC20Feature: TransformERC20Feature as ContractArtifact,
|
||||
LibSignedCallData: LibSignedCallData as ContractArtifact,
|
||||
FixinCommon: FixinCommon as ContractArtifact,
|
||||
FixinEIP712: FixinEIP712 as ContractArtifact,
|
||||
|
@@ -12,12 +12,12 @@ import { BigNumber, hexUtils, StringRevertError, ZeroExRevertErrors } from '@0x/
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { generateCallDataSignature, signCallData } from '../../src/signed_call_data';
|
||||
import { MetaTransactionsContract, ZeroExContract } from '../../src/wrappers';
|
||||
import { IZeroExContract, MetaTransactionsFeatureContract } from '../../src/wrappers';
|
||||
import { artifacts } from '../artifacts';
|
||||
import { abis } from '../utils/abis';
|
||||
import { fullMigrateAsync } from '../utils/migration';
|
||||
import {
|
||||
ITokenSpenderContract,
|
||||
ITokenSpenderFeatureContract,
|
||||
TestMetaTransactionsTransformERC20FeatureContract,
|
||||
TestMetaTransactionsTransformERC20FeatureEvents,
|
||||
TestMintableERC20TokenContract,
|
||||
@@ -29,8 +29,8 @@ blockchainTests.resets('MetaTransactions feature', env => {
|
||||
let owner: string;
|
||||
let sender: string;
|
||||
let signers: string[];
|
||||
let zeroEx: ZeroExContract;
|
||||
let feature: MetaTransactionsContract;
|
||||
let zeroEx: IZeroExContract;
|
||||
let feature: MetaTransactionsFeatureContract;
|
||||
let feeToken: TestMintableERC20TokenContract;
|
||||
let transformERC20Feature: TestMetaTransactionsTransformERC20FeatureContract;
|
||||
let allowanceTarget: string;
|
||||
@@ -52,14 +52,14 @@ blockchainTests.resets('MetaTransactions feature', env => {
|
||||
zeroEx = await fullMigrateAsync(owner, env.provider, env.txDefaults, {
|
||||
transformERC20: transformERC20Feature.address,
|
||||
});
|
||||
feature = new MetaTransactionsContract(zeroEx.address, env.provider, { ...env.txDefaults, from: sender }, abis);
|
||||
feature = new MetaTransactionsFeatureContract(zeroEx.address, env.provider, { ...env.txDefaults, from: sender }, abis);
|
||||
feeToken = await TestMintableERC20TokenContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestMintableERC20Token,
|
||||
env.provider,
|
||||
env.txDefaults,
|
||||
{},
|
||||
);
|
||||
allowanceTarget = await new ITokenSpenderContract(zeroEx.address, env.provider, env.txDefaults)
|
||||
allowanceTarget = await new ITokenSpenderFeatureContract(zeroEx.address, env.provider, env.txDefaults)
|
||||
.getAllowanceTarget()
|
||||
.callAsync();
|
||||
// Fund signers with fee tokens.
|
||||
|
@@ -3,12 +3,12 @@ import { hexUtils, OwnableRevertErrors, StringRevertError, ZeroExRevertErrors }
|
||||
|
||||
import { artifacts } from '../artifacts';
|
||||
import { initialMigrateAsync } from '../utils/migration';
|
||||
import { IOwnableContract, IOwnableEvents, TestMigratorContract, TestMigratorEvents } from '../wrappers';
|
||||
import { IOwnableFeatureContract, IOwnableFeatureEvents, TestMigratorContract, TestMigratorEvents } from '../wrappers';
|
||||
|
||||
blockchainTests.resets('Ownable feature', env => {
|
||||
const notOwner = randomAddress();
|
||||
let owner: string;
|
||||
let ownable: IOwnableContract;
|
||||
let ownable: IOwnableFeatureContract;
|
||||
let testMigrator: TestMigratorContract;
|
||||
let succeedingMigrateFnCallData: string;
|
||||
let failingMigrateFnCallData: string;
|
||||
@@ -19,7 +19,7 @@ blockchainTests.resets('Ownable feature', env => {
|
||||
[owner] = await env.getAccountAddressesAsync();
|
||||
logDecoder = new LogDecoder(env.web3Wrapper, artifacts);
|
||||
const zeroEx = await initialMigrateAsync(owner, env.provider, env.txDefaults);
|
||||
ownable = new IOwnableContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
ownable = new IOwnableFeatureContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
testMigrator = await TestMigratorContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestMigrator,
|
||||
env.provider,
|
||||
@@ -49,7 +49,7 @@ blockchainTests.resets('Ownable feature', env => {
|
||||
newOwner,
|
||||
},
|
||||
],
|
||||
IOwnableEvents.OwnershipTransferred,
|
||||
IOwnableFeatureEvents.OwnershipTransferred,
|
||||
);
|
||||
expect(await ownable.owner().callAsync()).to.eq(newOwner);
|
||||
});
|
||||
|
@@ -5,7 +5,7 @@ import { hexUtils, ZeroExRevertErrors } from '@0x/utils';
|
||||
import * as ethjs from 'ethereumjs-util';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import { SignatureValidatorContract, ZeroExContract } from '../../src/wrappers';
|
||||
import { IZeroExContract, SignatureValidatorFeatureContract } from '../../src/wrappers';
|
||||
import { abis } from '../utils/abis';
|
||||
import { fullMigrateAsync } from '../utils/migration';
|
||||
|
||||
@@ -14,13 +14,13 @@ const { NULL_BYTES } = constants;
|
||||
blockchainTests.resets('SignatureValidator feature', env => {
|
||||
let owner: string;
|
||||
let signers: string[];
|
||||
let zeroEx: ZeroExContract;
|
||||
let feature: SignatureValidatorContract;
|
||||
let zeroEx: IZeroExContract;
|
||||
let feature: SignatureValidatorFeatureContract;
|
||||
|
||||
before(async () => {
|
||||
[owner, ...signers] = await env.getAccountAddressesAsync();
|
||||
zeroEx = await fullMigrateAsync(owner, env.provider, env.txDefaults);
|
||||
feature = new SignatureValidatorContract(zeroEx.address, env.provider, env.txDefaults, abis);
|
||||
feature = new SignatureValidatorFeatureContract(zeroEx.address, env.provider, env.txDefaults, abis);
|
||||
});
|
||||
|
||||
describe('validateHashSignature()', () => {
|
||||
|
@@ -5,8 +5,8 @@ import { ZeroExContract } from '../../src/wrappers';
|
||||
import { artifacts } from '../artifacts';
|
||||
import { initialMigrateAsync } from '../utils/migration';
|
||||
import {
|
||||
ISimpleFunctionRegistryContract,
|
||||
ISimpleFunctionRegistryEvents,
|
||||
ISimpleFunctionRegistryFeatureContract,
|
||||
ISimpleFunctionRegistryFeatureEvents,
|
||||
ITestSimpleFunctionRegistryFeatureContract,
|
||||
TestSimpleFunctionRegistryFeatureImpl1Contract,
|
||||
TestSimpleFunctionRegistryFeatureImpl2Contract,
|
||||
@@ -17,7 +17,7 @@ blockchainTests.resets('SimpleFunctionRegistry feature', env => {
|
||||
const notOwner = randomAddress();
|
||||
let owner: string;
|
||||
let zeroEx: ZeroExContract;
|
||||
let registry: ISimpleFunctionRegistryContract;
|
||||
let registry: ISimpleFunctionRegistryFeatureContract;
|
||||
let testFnSelector: string;
|
||||
let testFeature: ITestSimpleFunctionRegistryFeatureContract;
|
||||
let testFeatureImpl1: TestSimpleFunctionRegistryFeatureImpl1Contract;
|
||||
@@ -26,7 +26,7 @@ blockchainTests.resets('SimpleFunctionRegistry feature', env => {
|
||||
before(async () => {
|
||||
[owner] = await env.getAccountAddressesAsync();
|
||||
zeroEx = await initialMigrateAsync(owner, env.provider, env.txDefaults);
|
||||
registry = new ISimpleFunctionRegistryContract(zeroEx.address, env.provider, {
|
||||
registry = new ISimpleFunctionRegistryFeatureContract(zeroEx.address, env.provider, {
|
||||
...env.txDefaults,
|
||||
from: owner,
|
||||
});
|
||||
@@ -75,7 +75,7 @@ blockchainTests.resets('SimpleFunctionRegistry feature', env => {
|
||||
verifyEventsFromLogs(
|
||||
logs,
|
||||
[{ selector: testFnSelector, oldImpl: NULL_ADDRESS, newImpl: testFeatureImpl1.address }],
|
||||
ISimpleFunctionRegistryEvents.ProxyFunctionUpdated,
|
||||
ISimpleFunctionRegistryFeatureEvents.ProxyFunctionUpdated,
|
||||
);
|
||||
const r = await testFeature.testFn().callAsync();
|
||||
expect(r).to.bignumber.eq(1337);
|
||||
@@ -117,7 +117,7 @@ blockchainTests.resets('SimpleFunctionRegistry feature', env => {
|
||||
verifyEventsFromLogs(
|
||||
logs,
|
||||
[{ selector: testFnSelector, oldImpl: testFeatureImpl2.address, newImpl: NULL_ADDRESS }],
|
||||
ISimpleFunctionRegistryEvents.ProxyFunctionUpdated,
|
||||
ISimpleFunctionRegistryFeatureEvents.ProxyFunctionUpdated,
|
||||
);
|
||||
const rollbackLength = await registry.getRollbackLength(testFnSelector).callAsync();
|
||||
expect(rollbackLength).to.bignumber.eq(0);
|
||||
|
@@ -7,29 +7,29 @@ import {
|
||||
} from '@0x/contracts-test-utils';
|
||||
import { BigNumber, hexUtils, StringRevertError, ZeroExRevertErrors } from '@0x/utils';
|
||||
|
||||
import { TokenSpenderContract, ZeroExContract } from '../../src/wrappers';
|
||||
import { IZeroExContract, TokenSpenderFeatureContract } from '../../src/wrappers';
|
||||
import { artifacts } from '../artifacts';
|
||||
import { abis } from '../utils/abis';
|
||||
import { fullMigrateAsync } from '../utils/migration';
|
||||
import { TestTokenSpenderERC20TokenContract, TestTokenSpenderERC20TokenEvents } from '../wrappers';
|
||||
|
||||
blockchainTests.resets('TokenSpender feature', env => {
|
||||
let zeroEx: ZeroExContract;
|
||||
let feature: TokenSpenderContract;
|
||||
let zeroEx: IZeroExContract;
|
||||
let feature: TokenSpenderFeatureContract;
|
||||
let token: TestTokenSpenderERC20TokenContract;
|
||||
let allowanceTarget: string;
|
||||
|
||||
before(async () => {
|
||||
const [owner] = await env.getAccountAddressesAsync();
|
||||
zeroEx = await fullMigrateAsync(owner, env.provider, env.txDefaults, {
|
||||
tokenSpender: (await TokenSpenderContract.deployFrom0xArtifactAsync(
|
||||
tokenSpender: (await TokenSpenderFeatureContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestTokenSpender,
|
||||
env.provider,
|
||||
env.txDefaults,
|
||||
artifacts,
|
||||
)).address,
|
||||
});
|
||||
feature = new TokenSpenderContract(zeroEx.address, env.provider, env.txDefaults, abis);
|
||||
feature = new TokenSpenderFeatureContract(zeroEx.address, env.provider, env.txDefaults, abis);
|
||||
token = await TestTokenSpenderERC20TokenContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestTokenSpenderERC20Token,
|
||||
env.provider,
|
||||
|
@@ -14,18 +14,18 @@ import { DecodedLogEntry } from 'ethereum-types';
|
||||
import * as ethjs from 'ethereumjs-util';
|
||||
|
||||
import { generateCallDataHashSignature, signCallData } from '../../src/signed_call_data';
|
||||
import { TransformERC20Contract, ZeroExContract } from '../../src/wrappers';
|
||||
import { IZeroExContract, TransformERC20FeatureContract } from '../../src/wrappers';
|
||||
import { artifacts } from '../artifacts';
|
||||
import { abis } from '../utils/abis';
|
||||
import { fullMigrateAsync } from '../utils/migration';
|
||||
import {
|
||||
FlashWalletContract,
|
||||
ITokenSpenderContract,
|
||||
ITokenSpenderFeatureContract,
|
||||
TestMintableERC20TokenContract,
|
||||
TestMintTokenERC20TransformerContract,
|
||||
TestMintTokenERC20TransformerEvents,
|
||||
TestMintTokenERC20TransformerMintTransformEventArgs,
|
||||
TransformERC20Events,
|
||||
TransformERC20FeatureEvents,
|
||||
} from '../wrappers';
|
||||
|
||||
const { NULL_BYTES, NULL_BYTES32 } = constants;
|
||||
@@ -39,8 +39,8 @@ blockchainTests.resets('TransformERC20 feature', env => {
|
||||
let taker: string;
|
||||
let sender: string;
|
||||
let transformerDeployer: string;
|
||||
let zeroEx: ZeroExContract;
|
||||
let feature: TransformERC20Contract;
|
||||
let zeroEx: IZeroExContract;
|
||||
let feature: TransformERC20FeatureContract;
|
||||
let wallet: FlashWalletContract;
|
||||
let allowanceTarget: string;
|
||||
|
||||
@@ -51,7 +51,7 @@ blockchainTests.resets('TransformERC20 feature', env => {
|
||||
env.provider,
|
||||
env.txDefaults,
|
||||
{
|
||||
transformERC20: (await TransformERC20Contract.deployFrom0xArtifactAsync(
|
||||
transformERC20: (await TransformERC20FeatureContract.deployFrom0xArtifactAsync(
|
||||
artifacts.TestTransformERC20,
|
||||
env.provider,
|
||||
env.txDefaults,
|
||||
@@ -60,9 +60,9 @@ blockchainTests.resets('TransformERC20 feature', env => {
|
||||
},
|
||||
{ transformerDeployer },
|
||||
);
|
||||
feature = new TransformERC20Contract(zeroEx.address, env.provider, { ...env.txDefaults, from: sender }, abis);
|
||||
feature = new TransformERC20FeatureContract(zeroEx.address, env.provider, { ...env.txDefaults, from: sender }, abis);
|
||||
wallet = new FlashWalletContract(await feature.getTransformWallet().callAsync(), env.provider, env.txDefaults);
|
||||
allowanceTarget = await new ITokenSpenderContract(zeroEx.address, env.provider, env.txDefaults)
|
||||
allowanceTarget = await new ITokenSpenderFeatureContract(zeroEx.address, env.provider, env.txDefaults)
|
||||
.getAllowanceTarget()
|
||||
.callAsync();
|
||||
await feature.setQuoteSigner(callDataSigner).awaitTransactionSuccessAsync({ from: owner });
|
||||
@@ -99,7 +99,7 @@ blockchainTests.resets('TransformERC20 feature', env => {
|
||||
verifyEventsFromLogs(
|
||||
receipt.logs,
|
||||
[{ transformerDeployer: newDeployer }],
|
||||
TransformERC20Events.TransformerDeployerUpdated,
|
||||
TransformERC20FeatureEvents.TransformerDeployerUpdated,
|
||||
);
|
||||
const actualDeployer = await feature.getTransformerDeployer().callAsync();
|
||||
expect(actualDeployer).to.eq(newDeployer);
|
||||
@@ -122,7 +122,7 @@ blockchainTests.resets('TransformERC20 feature', env => {
|
||||
it('owner can set the quote signer with `setQuoteSigner()`', async () => {
|
||||
const newSigner = randomAddress();
|
||||
const receipt = await feature.setQuoteSigner(newSigner).awaitTransactionSuccessAsync({ from: owner });
|
||||
verifyEventsFromLogs(receipt.logs, [{ quoteSigner: newSigner }], TransformERC20Events.QuoteSignerUpdated);
|
||||
verifyEventsFromLogs(receipt.logs, [{ quoteSigner: newSigner }], TransformERC20FeatureEvents.QuoteSignerUpdated);
|
||||
const actualSigner = await feature.getQuoteSigner().callAsync();
|
||||
expect(actualSigner).to.eq(newSigner);
|
||||
});
|
||||
@@ -259,7 +259,7 @@ blockchainTests.resets('TransformERC20 feature', env => {
|
||||
outputToken: outputToken.address,
|
||||
},
|
||||
],
|
||||
TransformERC20Events.TransformedERC20,
|
||||
TransformERC20FeatureEvents.TransformedERC20,
|
||||
);
|
||||
verifyEventsFromLogs(
|
||||
receipt.logs,
|
||||
@@ -316,7 +316,7 @@ blockchainTests.resets('TransformERC20 feature', env => {
|
||||
outputToken: ETH_TOKEN_ADDRESS,
|
||||
},
|
||||
],
|
||||
TransformERC20Events.TransformedERC20,
|
||||
TransformERC20FeatureEvents.TransformedERC20,
|
||||
);
|
||||
verifyEventsFromLogs(
|
||||
receipt.logs,
|
||||
@@ -376,7 +376,7 @@ blockchainTests.resets('TransformERC20 feature', env => {
|
||||
outputToken: outputToken.address,
|
||||
},
|
||||
],
|
||||
TransformERC20Events.TransformedERC20,
|
||||
TransformERC20FeatureEvents.TransformedERC20,
|
||||
);
|
||||
verifyEventsFromLogs(
|
||||
receipt.logs,
|
||||
|
@@ -9,11 +9,11 @@ import { abis } from './utils/abis';
|
||||
import { deployFullFeaturesAsync, FullFeatures } from './utils/migration';
|
||||
import {
|
||||
AllowanceTargetContract,
|
||||
IMetaTransactionsContract,
|
||||
IOwnableContract,
|
||||
ISignatureValidatorContract,
|
||||
ITokenSpenderContract,
|
||||
ITransformERC20Contract,
|
||||
IMetaTransactionsFeatureContract,
|
||||
IOwnableFeatureContract,
|
||||
ISignatureValidatorFeatureContract,
|
||||
ITokenSpenderFeatureContract,
|
||||
ITransformERC20FeatureContract,
|
||||
TestFullMigrationContract,
|
||||
ZeroExContract,
|
||||
} from './wrappers';
|
||||
@@ -50,7 +50,7 @@ blockchainTests.resets('Full migration', env => {
|
||||
});
|
||||
|
||||
it('ZeroEx has the correct owner', async () => {
|
||||
const ownable = new IOwnableContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
const ownable = new IOwnableFeatureContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
const actualOwner = await ownable.owner().callAsync();
|
||||
expect(actualOwner).to.eq(owner);
|
||||
});
|
||||
@@ -70,11 +70,11 @@ blockchainTests.resets('Full migration', env => {
|
||||
|
||||
const FEATURE_FNS = {
|
||||
TokenSpender: {
|
||||
contractType: ITokenSpenderContract,
|
||||
contractType: ITokenSpenderFeatureContract,
|
||||
fns: ['_spendERC20Tokens'],
|
||||
},
|
||||
TransformERC20: {
|
||||
contractType: ITransformERC20Contract,
|
||||
contractType: ITransformERC20FeatureContract,
|
||||
fns: [
|
||||
'transformERC20',
|
||||
'_transformERC20',
|
||||
@@ -86,11 +86,11 @@ blockchainTests.resets('Full migration', env => {
|
||||
],
|
||||
},
|
||||
SignatureValidator: {
|
||||
contractType: ISignatureValidatorContract,
|
||||
contractType: ISignatureValidatorFeatureContract,
|
||||
fns: ['isValidHashSignature', 'validateHashSignature'],
|
||||
},
|
||||
MetaTransactions: {
|
||||
contractType: IMetaTransactionsContract,
|
||||
contractType: IMetaTransactionsFeatureContract,
|
||||
fns: [
|
||||
'executeMetaTransaction',
|
||||
'batchExecuteMetaTransactions',
|
||||
@@ -181,7 +181,7 @@ blockchainTests.resets('Full migration', env => {
|
||||
let allowanceTarget: AllowanceTargetContract;
|
||||
|
||||
before(async () => {
|
||||
const contract = new ITokenSpenderContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
const contract = new ITokenSpenderFeatureContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
allowanceTarget = new AllowanceTargetContract(
|
||||
await contract.getAllowanceTarget().callAsync(),
|
||||
env.provider,
|
||||
@@ -199,10 +199,10 @@ blockchainTests.resets('Full migration', env => {
|
||||
});
|
||||
|
||||
describe('TransformERC20', () => {
|
||||
let feature: ITransformERC20Contract;
|
||||
let feature: ITransformERC20FeatureContract;
|
||||
|
||||
before(async () => {
|
||||
feature = new ITransformERC20Contract(zeroEx.address, env.provider, env.txDefaults);
|
||||
feature = new ITransformERC20FeatureContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
});
|
||||
|
||||
it('has the correct transformer deployer', async () => {
|
||||
|
@@ -4,10 +4,10 @@ import { hexUtils, ZeroExRevertErrors } from '@0x/utils';
|
||||
import { artifacts } from './artifacts';
|
||||
import { BootstrapFeatures, deployBootstrapFeaturesAsync } from './utils/migration';
|
||||
import {
|
||||
IBootstrapContract,
|
||||
IBootstrapFeatureContract,
|
||||
InitialMigrationContract,
|
||||
IOwnableContract,
|
||||
SimpleFunctionRegistryContract,
|
||||
IOwnableFeatureContract,
|
||||
SimpleFunctionRegistryFeatureContract,
|
||||
TestInitialMigrationContract,
|
||||
ZeroExContract,
|
||||
} from './wrappers';
|
||||
@@ -16,7 +16,7 @@ blockchainTests.resets('Initial migration', env => {
|
||||
let owner: string;
|
||||
let zeroEx: ZeroExContract;
|
||||
let migrator: TestInitialMigrationContract;
|
||||
let bootstrapFeature: IBootstrapContract;
|
||||
let bootstrapFeature: IBootstrapFeatureContract;
|
||||
let features: BootstrapFeatures;
|
||||
|
||||
before(async () => {
|
||||
@@ -29,7 +29,7 @@ blockchainTests.resets('Initial migration', env => {
|
||||
artifacts,
|
||||
env.txDefaults.from as string,
|
||||
);
|
||||
bootstrapFeature = new IBootstrapContract(
|
||||
bootstrapFeature = new IBootstrapFeatureContract(
|
||||
await migrator.bootstrapFeature().callAsync(),
|
||||
env.provider,
|
||||
env.txDefaults,
|
||||
@@ -82,10 +82,10 @@ blockchainTests.resets('Initial migration', env => {
|
||||
});
|
||||
|
||||
describe('Ownable feature', () => {
|
||||
let ownable: IOwnableContract;
|
||||
let ownable: IOwnableFeatureContract;
|
||||
|
||||
before(async () => {
|
||||
ownable = new IOwnableContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
ownable = new IOwnableFeatureContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
});
|
||||
|
||||
it('has the correct owner', async () => {
|
||||
@@ -95,10 +95,10 @@ blockchainTests.resets('Initial migration', env => {
|
||||
});
|
||||
|
||||
describe('SimpleFunctionRegistry feature', () => {
|
||||
let registry: SimpleFunctionRegistryContract;
|
||||
let registry: SimpleFunctionRegistryFeatureContract;
|
||||
|
||||
before(async () => {
|
||||
registry = new SimpleFunctionRegistryContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
registry = new SimpleFunctionRegistryFeatureContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
});
|
||||
|
||||
it('_extendSelf() is deregistered', async () => {
|
||||
|
@@ -7,8 +7,8 @@ import { artifacts } from './artifacts';
|
||||
import { initialMigrateAsync } from './utils/migration';
|
||||
import {
|
||||
IFeatureContract,
|
||||
IOwnableContract,
|
||||
ISimpleFunctionRegistryContract,
|
||||
IOwnableFeatureContract,
|
||||
ISimpleFunctionRegistryFeatureContract,
|
||||
TestZeroExFeatureContract,
|
||||
TestZeroExFeatureEvents,
|
||||
} from './wrappers';
|
||||
@@ -16,15 +16,15 @@ import {
|
||||
blockchainTests.resets('ZeroEx contract', env => {
|
||||
let owner: string;
|
||||
let zeroEx: ZeroExContract;
|
||||
let ownable: IOwnableContract;
|
||||
let registry: ISimpleFunctionRegistryContract;
|
||||
let ownable: IOwnableFeatureContract;
|
||||
let registry: ISimpleFunctionRegistryFeatureContract;
|
||||
let testFeature: TestZeroExFeatureContract;
|
||||
|
||||
before(async () => {
|
||||
[owner] = await env.getAccountAddressesAsync();
|
||||
zeroEx = await initialMigrateAsync(owner, env.provider, env.txDefaults);
|
||||
ownable = new IOwnableContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
registry = new ISimpleFunctionRegistryContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
ownable = new IOwnableFeatureContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
registry = new ISimpleFunctionRegistryFeatureContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
testFeature = new TestZeroExFeatureContract(zeroEx.address, env.provider, env.txDefaults);
|
||||
// Register test features.
|
||||
const testFeatureImpl = await TestZeroExFeatureContract.deployFrom0xArtifactAsync(
|
||||
|
Reference in New Issue
Block a user