aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-04-18 04:36:11 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-04-21 04:56:18 +0800
commite80f203efc70ef5787a78626a9f10cf5517b178e (patch)
tree9364ea750e96671a5a29cfb801d8c5781733d2b9 /packages/contracts/test
parentdbd65cdb04ec2fac9da22e833669307e3ee33988 (diff)
downloaddexon-sol-tools-e80f203efc70ef5787a78626a9f10cf5517b178e.tar
dexon-sol-tools-e80f203efc70ef5787a78626a9f10cf5517b178e.tar.gz
dexon-sol-tools-e80f203efc70ef5787a78626a9f10cf5517b178e.tar.bz2
dexon-sol-tools-e80f203efc70ef5787a78626a9f10cf5517b178e.tar.lz
dexon-sol-tools-e80f203efc70ef5787a78626a9f10cf5517b178e.tar.xz
dexon-sol-tools-e80f203efc70ef5787a78626a9f10cf5517b178e.tar.zst
dexon-sol-tools-e80f203efc70ef5787a78626a9f10cf5517b178e.zip
Inlined decodeMetadata in the proxies and removed encodeMetadata (already exists in Typescript). This simplifies the code.
Diffstat (limited to 'packages/contracts/test')
-rw-r--r--packages/contracts/test/asset_proxy_dispatcher/proxies.ts60
1 files changed, 0 insertions, 60 deletions
diff --git a/packages/contracts/test/asset_proxy_dispatcher/proxies.ts b/packages/contracts/test/asset_proxy_dispatcher/proxies.ts
index d1129761e..2a8b6d567 100644
--- a/packages/contracts/test/asset_proxy_dispatcher/proxies.ts
+++ b/packages/contracts/test/asset_proxy_dispatcher/proxies.ts
@@ -91,30 +91,6 @@ describe('Asset Transfer Proxies', () => {
await blockchainLifecycle.revertAsync();
});
describe('Transfer Proxy - ERC20', () => {
- it('should successfully encode/decode metadata', async () => {
- const metadata = await erc20Proxy.encodeMetadata.callAsync(AssetProxyId.ERC20, zrx.address);
- const address = await erc20Proxy.decodeMetadata.callAsync(metadata);
- expect(address).to.be.equal(zrx.address);
- });
-
- it('should successfully decode metadata encoded by typescript helpers', async () => {
- const metadata = encodeERC20ProxyData(zrx.address);
- const address = await erc20Proxy.decodeMetadata.callAsync(metadata);
- expect(address).to.be.equal(zrx.address);
- });
-
- it('should successfully encode/decode metadata padded with zeros', async () => {
- const metadata = await erc20Proxy.encodeMetadata.callAsync(AssetProxyId.ERC20, testAddressPaddedWithZeros);
- const address = await erc20Proxy.decodeMetadata.callAsync(metadata);
- expect(address).to.be.equal(testAddressPaddedWithZeros);
- });
-
- it('should successfully decode metadata encoded padded with zeros by typescript helpers', async () => {
- const metadata = encodeERC20ProxyData(testAddressPaddedWithZeros);
- const address = await erc20Proxy.decodeMetadata.callAsync(metadata);
- expect(address).to.be.equal(testAddressPaddedWithZeros);
- });
-
it('should successfully transfer tokens', async () => {
// Construct metadata for ERC20 proxy
const encodedProxyMetadata = encodeERC20ProxyData(zrx.address);
@@ -192,42 +168,6 @@ describe('Asset Transfer Proxies', () => {
});
describe('Transfer Proxy - ERC721', () => {
- it('should successfully encode/decode metadata', async () => {
- const metadata = await erc721Proxy.encodeMetadata.callAsync(
- AssetProxyId.ERC721,
- erc721Token.address,
- makerTokenId,
- );
- const [address, tokenId] = await erc721Proxy.decodeMetadata.callAsync(metadata);
- expect(address).to.be.equal(erc721Token.address);
- expect(tokenId).to.be.bignumber.equal(makerTokenId);
- });
-
- it('should successfully decode metadata encoded by typescript helpers', async () => {
- const metadata = encodeERC721ProxyData(erc721Token.address, makerTokenId);
- const [address, tokenId] = await erc721Proxy.decodeMetadata.callAsync(metadata);
- expect(address).to.be.equal(erc721Token.address);
- expect(tokenId).to.be.bignumber.equal(makerTokenId);
- });
-
- it('should successfully encode/decode metadata padded with zeros', async () => {
- const metadata = await erc721Proxy.encodeMetadata.callAsync(
- AssetProxyId.ERC721,
- testAddressPaddedWithZeros,
- makerTokenId,
- );
- const [address, tokenId] = await erc721Proxy.decodeMetadata.callAsync(metadata);
- expect(address).to.be.equal(testAddressPaddedWithZeros);
- expect(tokenId).to.be.bignumber.equal(makerTokenId);
- });
-
- it('should successfully decode metadata encoded padded with zeros by typescript helpers', async () => {
- const metadata = encodeERC721ProxyData(testAddressPaddedWithZeros, makerTokenId);
- const [address, tokenId] = await erc721Proxy.decodeMetadata.callAsync(metadata);
- expect(address).to.be.equal(testAddressPaddedWithZeros);
- expect(tokenId).to.be.bignumber.equal(makerTokenId);
- });
-
it('should successfully transfer tokens', async () => {
// Construct metadata for ERC721 proxy
const encodedProxyMetadata = encodeERC721ProxyData(erc721Token.address, makerTokenId);