web3.js/test/formatters.outputPostFormatter.js
Fabian Vogelsteller 23f428b096 Refactored the contract object (#424)
* started contract

* prepared the contract functions

* added deploy function

* added event emitter funcitons

* eventified promise

* added encodeABI

* added optional bluebird

* improved the param finder

* added call, transact and estimateGas

* allow siganture for encodeABI

* working on events

* added event listeners to contracts

* working on contract events

* changed on message to on data

* working on decoding events

* switched deploy check to subscriptions

* removed all event functions, keep only contract.on

* added subscription stuff

* fixed substractions formatters

* added log decoding

* added all events

* fixed events

* added new method calling structure

* added mined event for send tx

* worked on getPastEvents, still WIP

* working on tests

* added once method

* made options object in function execution optional

* finished pastEvents

* added request function for batch processing to contract methods

* fixed contract tests

* finished proting tests

* test provider isolatiton issues

* commented out test to prevent unsolvable issue for now

* changed deploy resolve

* deactivate encodeABI

* improved fake provider, with stacking validation and results

* added fromBlock test

* added tests for internal methods of the contract object
2016-10-07 13:07:42 +02:00

27 lines
920 B
JavaScript

var assert = require('assert');
var formatters = require('../lib/web3/formatters.js');
describe('formatters', function () {
describe('outputPostFormatter', function () {
it('should return the correct value', function () {
assert.deepEqual(formatters.outputPostFormatter({
expiry: '0x3e8',
sent: '0x3e8',
ttl: '0x3e8',
workProved: '0x3e8',
payload: '0x7b2274657374223a2274657374227d',
topics: ['0x68656c6c6f','0x6d79746f70696373']
}), {
expiry: 1000,
sent: 1000,
ttl: 1000,
workProved: 1000,
payload: '0x7b2274657374223a2274657374227d', //{test: 'test'},
// payloadRaw: '0x7b2274657374223a2274657374227d',
topics: ['hello','mytopics']
});
});
});
});