aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/multisig/asset_proxy_owner.ts
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-07-07 05:12:53 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-07-11 02:24:22 +0800
commit092ca6bcf5de2d94ff503f11233c87d428eedcb8 (patch)
tree892cc61220dd4bbc769ef0e43c034b9a780103b0 /packages/contracts/test/multisig/asset_proxy_owner.ts
parent2625cbbfed087dae55c62950a9260145cf5ca8e6 (diff)
downloaddexon-0x-contracts-092ca6bcf5de2d94ff503f11233c87d428eedcb8.tar
dexon-0x-contracts-092ca6bcf5de2d94ff503f11233c87d428eedcb8.tar.gz
dexon-0x-contracts-092ca6bcf5de2d94ff503f11233c87d428eedcb8.tar.bz2
dexon-0x-contracts-092ca6bcf5de2d94ff503f11233c87d428eedcb8.tar.lz
dexon-0x-contracts-092ca6bcf5de2d94ff503f11233c87d428eedcb8.tar.xz
dexon-0x-contracts-092ca6bcf5de2d94ff503f11233c87d428eedcb8.tar.zst
dexon-0x-contracts-092ca6bcf5de2d94ff503f11233c87d428eedcb8.zip
Use 0.4.10 in AssetProxyOwner, add readBytes4 to contract and remove LibBytes
Diffstat (limited to 'packages/contracts/test/multisig/asset_proxy_owner.ts')
-rw-r--r--packages/contracts/test/multisig/asset_proxy_owner.ts24
1 files changed, 22 insertions, 2 deletions
diff --git a/packages/contracts/test/multisig/asset_proxy_owner.ts b/packages/contracts/test/multisig/asset_proxy_owner.ts
index 10fed6815..6a9843153 100644
--- a/packages/contracts/test/multisig/asset_proxy_owner.ts
+++ b/packages/contracts/test/multisig/asset_proxy_owner.ts
@@ -148,6 +148,25 @@ describe('AssetProxyOwner', () => {
});
});
+ describe('readBytes4', () => {
+ it('should revert if byte array has a length < 4', async () => {
+ const byteArrayLessThan4Bytes = '0x010101';
+ return expectContractCallFailedWithoutReasonAsync(
+ testAssetProxyOwner.publicReadBytes4.callAsync(byteArrayLessThan4Bytes, new BigNumber(0)),
+ );
+ });
+ it('should return the first 4 bytes of a byte array of arbitrary length', async () => {
+ const byteArrayLongerThan32Bytes =
+ '0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
+ const first4Bytes = await testAssetProxyOwner.publicReadBytes4.callAsync(
+ byteArrayLongerThan32Bytes,
+ new BigNumber(0),
+ );
+ const expectedFirst4Bytes = byteArrayLongerThan32Bytes.slice(0, 10);
+ expect(first4Bytes).to.equal(expectedFirst4Bytes);
+ });
+ });
+
describe('registerAssetProxy', () => {
it('should throw if not called by multisig', async () => {
const isRegistered = true;
@@ -238,8 +257,6 @@ describe('AssetProxyOwner', () => {
const registerAssetProxySubmitLog = registerAssetProxySubmitRes.logs[0] as LogWithDecodedArgs<
AssetProxyOwnerSubmissionEventArgs
>;
- const registerAssetProxyTxId = registerAssetProxySubmitLog.args.transactionId;
- await multiSigWrapper.confirmTransactionAsync(registerAssetProxyTxId, owners[1]);
const addAuthorizedAddressData = erc20Proxy.addAuthorizedAddress.getABIEncodedTransactionData(authorized);
const erc20AddAuthorizedAddressSubmitRes = await multiSigWrapper.submitTransactionAsync(
@@ -257,9 +274,12 @@ describe('AssetProxyOwner', () => {
>;
const erc721AddAuthorizedAddressSubmitLog = erc721AddAuthorizedAddressSubmitRes
.logs[0] as LogWithDecodedArgs<AssetProxyOwnerSubmissionEventArgs>;
+
+ const registerAssetProxyTxId = registerAssetProxySubmitLog.args.transactionId;
const erc20AddAuthorizedAddressTxId = erc20AddAuthorizedAddressSubmitLog.args.transactionId;
const erc721AddAuthorizedAddressTxId = erc721AddAuthorizedAddressSubmitLog.args.transactionId;
+ await multiSigWrapper.confirmTransactionAsync(registerAssetProxyTxId, owners[1]);
await multiSigWrapper.confirmTransactionAsync(erc20AddAuthorizedAddressTxId, owners[1]);
await multiSigWrapper.confirmTransactionAsync(erc721AddAuthorizedAddressTxId, owners[1]);
await increaseTimeAndMineBlockAsync(SECONDS_TIME_LOCKED.toNumber());