solidity/formatters.outputLogFormatter.js
Marek Kotewicz 9470fa2d4c Squashed 'libjsqrc/ethereumjs/' changes from ca46cb5..ecde334
ecde334 Merge pull request #241 from SilentCicero/master
3af1e82 Update eth.js
86d9b58 Added sendRawTransaction
4228b02 common fixes in requestmanager
47e292a version 0.6.0
c597034 gulp
9417bbf Merge branch 'master' into develop
15df5d6 Merge branch 'master' of https://github.com/ethereum/ethereum.js
e947252 Merge pull request #234 from ethereum/ethers-patch-1
4d165de update license per name change to web3.js
03ae21b special logs will never be nulls, so there is no reason to check for null value
66f1def updated dependencies, gulp
ccb436e Merge branch 'master' into develop
d729884 unrelevant change in example
fdf46ed fixed providor not set in request manager
811e3b2 Merge branch 'develop' of https://github.com/ethereum/ethereum.js into develop
f454dda Merge branch 'develop' of https://github.com/asinyagin/web3.js into develop
4384805 build files
b09bf31 Merge branch 'develop' into allAsync
6ea0d67 Set requests content type to application/json
fe703f5 Merge pull request #229 from ethereum/extendWeb3
a90a85a mereg develop
a2e5fbd add tests for the outputformatters
556eb45 re-add map files
08d2212 small fix on outputFormatters, dont transform null to 0
1495a0c add comlexity push for poll, does only show on travis
7518ed4 changed extend to _extend
1aefebd merged develop
b6c49d4 improved async polling
16252f3 imporved async callback adding, without setinterval
f242489 add optional default block parameter to contract call fixes #159
1d3d727 improved comment
d9ce08e improved filter interval
ddafe00 asyncified filters
d14c706 build and improved extend function
733e19e add extend method and tests

git-subtree-dir: libjsqrc/ethereumjs
git-subtree-split: ecde3345e0e6d4bca0ce03e08ee4957395cd6194
2015-06-23 10:00:27 +02:00

48 lines
2.0 KiB
JavaScript

var assert = require('assert');
var formatters = require('../lib/web3/formatters.js');
describe('formatters', function () {
describe('outputLogFormatter', function () {
it('should return the correct value', function () {
assert.deepEqual(formatters.outputLogFormatter({
transactionIndex: '0x3e8',
logIndex: '0x3e8',
blockNumber: '0x3e8',
transactionHash: '0xd6960376d6c6dea93647383ffb245cfced97ccc5c7525397a543a72fdaea5265',
blockHash: '0xd6960376d6c6dea93647383ffb245cfced97ccc5c7525397a543a72fdaea5265',
data: '0x7b2274657374223a2274657374227',
topics: ['0x68656c6c6f','0x6d79746f70696373']
}), {
transactionIndex: 1000,
logIndex: 1000,
blockNumber: 1000,
transactionHash: '0xd6960376d6c6dea93647383ffb245cfced97ccc5c7525397a543a72fdaea5265',
blockHash: '0xd6960376d6c6dea93647383ffb245cfced97ccc5c7525397a543a72fdaea5265',
data: '0x7b2274657374223a2274657374227',
topics: ['0x68656c6c6f','0x6d79746f70696373']
});
});
it('should return the correct value, when null values are present', function () {
assert.deepEqual(formatters.outputLogFormatter({
transactionIndex: null,
logIndex: null,
blockNumber: null,
transactionHash: null,
blockHash: null,
data: '0x7b2274657374223a2274657374227',
topics: ['0x68656c6c6f','0x6d79746f70696373']
}), {
transactionIndex: null,
logIndex: null,
blockNumber: null,
transactionHash: null,
blockHash: null,
data: '0x7b2274657374223a2274657374227',
topics: ['0x68656c6c6f','0x6d79746f70696373']
});
});
});
});