nilAddress to ZeroEx.NULL_ADDRESS
This commit is contained in:
committed by
Amir Bandeali
parent
564ddff4c7
commit
cc77f8489e
@@ -42,7 +42,6 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
let erc20TransferProxyV1: ERC20Proxy_v1Contract;
|
let erc20TransferProxyV1: ERC20Proxy_v1Contract;
|
||||||
let erc20TransferProxy: ERC20ProxyContract;
|
let erc20TransferProxy: ERC20ProxyContract;
|
||||||
let erc721TransferProxy: ERC721ProxyContract;
|
let erc721TransferProxy: ERC721ProxyContract;
|
||||||
const nilAddress = '0x0000000000000000000000000000000000000000';
|
|
||||||
const INITIAL_BALANCE = new BigNumber(10000);
|
const INITIAL_BALANCE = new BigNumber(10000);
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
@@ -129,7 +128,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: owner },
|
{ from: owner },
|
||||||
);
|
);
|
||||||
const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
||||||
@@ -140,7 +139,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: owner },
|
{ from: owner },
|
||||||
);
|
);
|
||||||
let proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
let proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
||||||
@@ -149,7 +148,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC721,
|
AssetProxyId.ERC721,
|
||||||
erc721TransferProxy.address,
|
erc721TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: owner },
|
{ from: owner },
|
||||||
);
|
);
|
||||||
proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC721);
|
proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC721);
|
||||||
@@ -160,7 +159,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: owner },
|
{ from: owner },
|
||||||
);
|
);
|
||||||
let proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
let proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
||||||
@@ -190,18 +189,18 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: owner },
|
{ from: owner },
|
||||||
);
|
);
|
||||||
const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
||||||
expect(proxyAddress).to.be.equal(erc20TransferProxy.address);
|
expect(proxyAddress).to.be.equal(erc20TransferProxy.address);
|
||||||
|
|
||||||
// The following transaction will throw because the currentAddress is no longer nilAddress
|
// The following transaction will throw because the currentAddress is no longer ZeroEx.NULL_ADDRESS
|
||||||
return expect(
|
return expect(
|
||||||
assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: owner },
|
{ from: owner },
|
||||||
),
|
),
|
||||||
).to.be.rejectedWith(constants.REVERT);
|
).to.be.rejectedWith(constants.REVERT);
|
||||||
@@ -211,7 +210,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: owner },
|
{ from: owner },
|
||||||
);
|
);
|
||||||
const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
||||||
@@ -220,12 +219,12 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
// The following transaction will reset the proxy address
|
// The following transaction will reset the proxy address
|
||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
{ from: owner },
|
{ from: owner },
|
||||||
);
|
);
|
||||||
const newProxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
const newProxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
||||||
expect(newProxyAddress).to.be.equal(nilAddress);
|
expect(newProxyAddress).to.be.equal(ZeroEx.NULL_ADDRESS);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw if requesting address is not authorized', async () => {
|
it('should throw if requesting address is not authorized', async () => {
|
||||||
@@ -233,7 +232,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: notOwner },
|
{ from: notOwner },
|
||||||
),
|
),
|
||||||
).to.be.rejectedWith(constants.REVERT);
|
).to.be.rejectedWith(constants.REVERT);
|
||||||
@@ -245,7 +244,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: owner },
|
{ from: owner },
|
||||||
);
|
);
|
||||||
const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
||||||
@@ -254,7 +253,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
|
|
||||||
it('should return NULL address if requesting non-existent proxy', async () => {
|
it('should return NULL address if requesting non-existent proxy', async () => {
|
||||||
const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
const proxyAddress = await assetProxyDispatcher.getAssetProxy.callAsync(AssetProxyId.ERC20);
|
||||||
expect(proxyAddress).to.be.equal(nilAddress);
|
expect(proxyAddress).to.be.equal(ZeroEx.NULL_ADDRESS);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -264,7 +263,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: owner },
|
{ from: owner },
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -315,7 +314,7 @@ describe('AssetProxyDispatcher', () => {
|
|||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: owner },
|
{ from: owner },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -43,7 +43,6 @@ describe('Asset Transfer Proxies', () => {
|
|||||||
let erc20TransferProxyV1: ERC20Proxy_v1Contract;
|
let erc20TransferProxyV1: ERC20Proxy_v1Contract;
|
||||||
let erc20TransferProxy: ERC20ProxyContract;
|
let erc20TransferProxy: ERC20ProxyContract;
|
||||||
let erc721TransferProxy: ERC721ProxyContract;
|
let erc721TransferProxy: ERC721ProxyContract;
|
||||||
const nilAddress = '0x0000000000000000000000000000000000000000';
|
|
||||||
const makerTokenId = new BigNumber('0x1010101010101010101010101010101010101010101010101010101010101010');
|
const makerTokenId = new BigNumber('0x1010101010101010101010101010101010101010101010101010101010101010');
|
||||||
const INITIAL_BALANCE = new BigNumber(10000);
|
const INITIAL_BALANCE = new BigNumber(10000);
|
||||||
|
|
||||||
|
@@ -149,23 +149,22 @@ describe('Exchange', () => {
|
|||||||
await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(erc20TransferProxyV1.address, {
|
await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(erc20TransferProxyV1.address, {
|
||||||
from: accounts[0],
|
from: accounts[0],
|
||||||
});
|
});
|
||||||
const nilAddress = '0x0000000000000000000000000000000000000000';
|
|
||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20_V1,
|
AssetProxyId.ERC20_V1,
|
||||||
erc20TransferProxyV1.address,
|
erc20TransferProxyV1.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: accounts[0] },
|
{ from: accounts[0] },
|
||||||
);
|
);
|
||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: accounts[0] },
|
{ from: accounts[0] },
|
||||||
);
|
);
|
||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC721,
|
AssetProxyId.ERC721,
|
||||||
erc721TransferProxy.address,
|
erc721TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: accounts[0] },
|
{ from: accounts[0] },
|
||||||
);
|
);
|
||||||
zeroEx = new ZeroEx(provider, {
|
zeroEx = new ZeroEx(provider, {
|
||||||
|
@@ -64,17 +64,16 @@ describe('Exchange', () => {
|
|||||||
await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(erc20TransferProxyV1.address, {
|
await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(erc20TransferProxyV1.address, {
|
||||||
from: accounts[0],
|
from: accounts[0],
|
||||||
});
|
});
|
||||||
const nilAddress = '0x0000000000000000000000000000000000000000';
|
|
||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20_V1,
|
AssetProxyId.ERC20_V1,
|
||||||
erc20TransferProxyV1.address,
|
erc20TransferProxyV1.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: accounts[0] },
|
{ from: accounts[0] },
|
||||||
);
|
);
|
||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: accounts[0] },
|
{ from: accounts[0] },
|
||||||
);
|
);
|
||||||
const zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID });
|
const zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID });
|
||||||
|
@@ -114,17 +114,16 @@ describe('Exchange', () => {
|
|||||||
await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(erc20TransferProxyV1.address, {
|
await tokenTransferProxy.addAuthorizedAddress.sendTransactionAsync(erc20TransferProxyV1.address, {
|
||||||
from: accounts[0],
|
from: accounts[0],
|
||||||
});
|
});
|
||||||
const nilAddress = '0x0000000000000000000000000000000000000000';
|
|
||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20_V1,
|
AssetProxyId.ERC20_V1,
|
||||||
erc20TransferProxyV1.address,
|
erc20TransferProxyV1.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: accounts[0] },
|
{ from: accounts[0] },
|
||||||
);
|
);
|
||||||
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
await assetProxyDispatcher.addAssetProxy.sendTransactionAsync(
|
||||||
AssetProxyId.ERC20,
|
AssetProxyId.ERC20,
|
||||||
erc20TransferProxy.address,
|
erc20TransferProxy.address,
|
||||||
nilAddress,
|
ZeroEx.NULL_ADDRESS,
|
||||||
{ from: accounts[0] },
|
{ from: accounts[0] },
|
||||||
);
|
);
|
||||||
const zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID });
|
const zeroEx = new ZeroEx(provider, { networkId: constants.TESTRPC_NETWORK_ID });
|
||||||
|
Reference in New Issue
Block a user