diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-31 08:30:19 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-31 08:30:19 +0800 |
commit | 995861de4d61ffae9e60ae3fc08b2775b2e81f7b (patch) | |
tree | 74fa44db33570dbccb8f0265f8e9bccd87592936 /test | |
parent | 600c9dd27dde3269a1682b875f82d3db46cee2c9 (diff) | |
download | dexon-995861de4d61ffae9e60ae3fc08b2775b2e81f7b.tar dexon-995861de4d61ffae9e60ae3fc08b2775b2e81f7b.tar.gz dexon-995861de4d61ffae9e60ae3fc08b2775b2e81f7b.tar.bz2 dexon-995861de4d61ffae9e60ae3fc08b2775b2e81f7b.tar.lz dexon-995861de4d61ffae9e60ae3fc08b2775b2e81f7b.tar.xz dexon-995861de4d61ffae9e60ae3fc08b2775b2e81f7b.tar.zst dexon-995861de4d61ffae9e60ae3fc08b2775b2e81f7b.zip |
event options
Diffstat (limited to 'test')
-rw-r--r-- | test/event.js | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/test/event.js b/test/event.js index 781f42e5e..43f8dcf38 100644 --- a/test/event.js +++ b/test/event.js @@ -2,7 +2,7 @@ var assert = require('assert'); var event = require('../lib/event.js'); describe('event', function () { - it('should create filter input object from given', function () { + it('should create basic filter input object', function () { // given var address = '0x012345'; @@ -14,9 +14,37 @@ describe('event', function () { // then assert.equal(result.address, address); - assert.equal(result.topics.length, 1); - assert.equal(result.topics[0], signature); + assert.equal(result.topic.length, 1); + assert.equal(result.topic[0], signature); }); + + it('should create basic filter input object', function () { + + // given + var address = '0x012345'; + var signature = '0x987654'; + var options = { + earliest: 1, + latest: 2, + offset: 3, + max: 4 + }; + + // when + var impl = event(address, signature); + var result = impl({}, options); + + // then + assert.equal(result.address, address); + assert.equal(result.topic.length, 1); + assert.equal(result.topic[0], signature); + assert.equal(result.earliest, options.earliest); + assert.equal(result.latest, options.latest); + assert.equal(result.offset, options.offset); + assert.equal(result.max, options.max); + + }); + }); |