Remove artifacts dep from contract-wrappers

This commit is contained in:
Jacob Evans
2019-12-02 17:22:07 +11:00
parent dd90aabad6
commit 00e34758c4
22 changed files with 28 additions and 170 deletions

View File

@@ -40,15 +40,6 @@ const KNOWN_MULTI_ASSET_ENCODING = {
'0x94cfcdd7000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000024f47261b00000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000204a7cb5fb70000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c480000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000003e90000000000000000000000000000000000000000000000000000000000002711000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000007d10000000000000000000000000000000000000000000000000000000000004e210000000000000000000000000000000000000000000000000000000000000044025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c4800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
};
const KNOWN_DUTCH_AUCTION_ENCODING = {
tokenAddress: '0x34d402f14d58e001d8efbe6585051bf9706aa064',
assetData: '0xf47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064', // ERC20
beginTimeSeconds: new BigNumber(1562807905),
beginAmount: new BigNumber(5),
dutchAuctionAssetData:
'0xf47261b000000000000000000000000034d402f14d58e001d8efbe6585051bf9706aa064000000000000000000000000000000000000000000000000000000005d268e610000000000000000000000000000000000000000000000000000000000000005',
};
describe('assetDataUtils', () => {
it('should encode ERC20', () => {
const assetData = assetDataUtils.encodeERC20AssetData(KNOWN_ERC20_ENCODING.address);
@@ -184,28 +175,4 @@ describe('assetDataUtils', () => {
expect(decodedErc1155AssetData2.tokenIds).to.be.deep.equal(KNOWN_ERC1155_ENCODING.tokenIds);
expect(decodedErc1155AssetData2.callbackData).to.be.equal(KNOWN_ERC1155_ENCODING.callbackData);
});
it('should encode Dutch Auction', async () => {
const encodedAssetData = assetDataUtils.encodeDutchAuctionAssetData(
KNOWN_DUTCH_AUCTION_ENCODING.assetData,
KNOWN_DUTCH_AUCTION_ENCODING.beginTimeSeconds,
KNOWN_DUTCH_AUCTION_ENCODING.beginAmount,
);
expect(encodedAssetData).to.be.equal(KNOWN_DUTCH_AUCTION_ENCODING.dutchAuctionAssetData);
});
it('should decode Dutch Auction', async () => {
const { assetData, beginTimeSeconds, beginAmount } = assetDataUtils.decodeDutchAuctionData(
KNOWN_DUTCH_AUCTION_ENCODING.dutchAuctionAssetData,
);
const { assetProxyId, tokenAddress } = assetDataUtils.decodeERC20AssetData(
KNOWN_DUTCH_AUCTION_ENCODING.assetData,
);
// tslint:disable:no-unnecessary-type-assertion
expect((assetData as ERC20AssetData).assetProxyId).to.be.equal(assetProxyId);
expect((assetData as ERC20AssetData).tokenAddress).to.be.equal(tokenAddress);
// tslint:enable:no-unnecessary-type-assertion
expect(beginTimeSeconds).to.deep.equal(KNOWN_DUTCH_AUCTION_ENCODING.beginTimeSeconds);
expect(beginAmount).to.deep.equal(KNOWN_DUTCH_AUCTION_ENCODING.beginAmount);
});
});