aboutsummaryrefslogtreecommitdiffstats
path: root/test/proxy_wrapper_test.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-30 04:11:50 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-30 04:11:50 +0800
commit7ca113b59bc5a755f878825353e2d66b2b51324b (patch)
treec60321477183f8d204cb1c7d420951965a1aa6ad /test/proxy_wrapper_test.ts
parentfd242a1e0620fdff535934e241720bbe42b276dd (diff)
downloaddexon-sol-tools-7ca113b59bc5a755f878825353e2d66b2b51324b.tar
dexon-sol-tools-7ca113b59bc5a755f878825353e2d66b2b51324b.tar.gz
dexon-sol-tools-7ca113b59bc5a755f878825353e2d66b2b51324b.tar.bz2
dexon-sol-tools-7ca113b59bc5a755f878825353e2d66b2b51324b.tar.lz
dexon-sol-tools-7ca113b59bc5a755f878825353e2d66b2b51324b.tar.xz
dexon-sol-tools-7ca113b59bc5a755f878825353e2d66b2b51324b.tar.zst
dexon-sol-tools-7ca113b59bc5a755f878825353e2d66b2b51324b.zip
Add a test for a ProxyWrapper
Diffstat (limited to 'test/proxy_wrapper_test.ts')
-rw-r--r--test/proxy_wrapper_test.ts35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/proxy_wrapper_test.ts b/test/proxy_wrapper_test.ts
new file mode 100644
index 000000000..98c5d1c31
--- /dev/null
+++ b/test/proxy_wrapper_test.ts
@@ -0,0 +1,35 @@
+import * as _ from 'lodash';
+import 'mocha';
+import * as chai from 'chai';
+import {chaiSetup} from './utils/chai_setup';
+import {web3Factory} from './utils/web3_factory';
+import {ZeroEx} from '../src';
+import {BlockchainLifecycle} from './utils/blockchain_lifecycle';
+import {SchemaValidator} from '../src/utils/schema_validator';
+import {tokenSchema} from '../src/schemas/token_schema';
+import {ProxyWrapper} from '../src/contract_wrappers/proxy_wrapper';
+
+chaiSetup.configure();
+const expect = chai.expect;
+const blockchainLifecycle = new BlockchainLifecycle();
+
+describe('ProxyWrapper', () => {
+ let zeroEx: ZeroEx;
+ before(async () => {
+ const web3 = web3Factory.create();
+ zeroEx = new ZeroEx(web3.currentProvider);
+ });
+ beforeEach(async () => {
+ await blockchainLifecycle.startAsync();
+ });
+ afterEach(async () => {
+ await blockchainLifecycle.revertAsync();
+ });
+ describe('#isAuthorizedAsync', () => {
+ it('should return false if the address is not authorized', async () => {
+ const proxyWrapper = (zeroEx as any)._proxyWrapper as ProxyWrapper;
+ const isAuthorized = await proxyWrapper.isAuthorizedAsync(ZeroEx.NULL_ADDRESS);
+ expect(isAuthorized).to.be.false();
+ });
+ });
+});