web3.js/test/web3.shh.post.js
Fabian Vogelsteller bbfefb091c Modularize web3.js (#541)
* added sub packages

* added lerna monopackage management

* check for package is instance

* added method, subscription and utils package

* moved almost all packages

* moved all packages, no umbrella package yet

* added extend to packages

* made contract pass

* made batch tests pass

* expose providers

* fixed test async

* fixed test errors

* fixed test event encode decode

* fixed test formatter tests

* fixed method tests

* fixed method utils

* fixed some eth methods

* fixed some eth methods 2

* bumped version 0.18.3 to republish meteor package

* fixed get* tests

* fixed subscribe tests

* added newBlockHeaders subscription

* remove unpublished package from package.json

* added sendTransaction test

* fixed call test

* moved files to done

* changed extend

* added iban tests

* Fixed ALL tests

* Fixed lint tests

* Fixed contract tests

* added method tests

* added more method tests to test promiEvents extensively

* added confirmation event

* improved method confirmation checking
2017-01-26 10:24:14 +01:00

46 lines
1.0 KiB
JavaScript

var testMethod = require('./helpers/test.method.js');
var utils = require('../packages/web3-utils');
var method = 'post';
var tests = [{
args: [{
from: '0x123123123',
topics: ['hello_world'],
payload: utils.toHex('12345'),
ttl: 100,
workToProve: 101
}],
formattedArgs: [{
from: '0x123123123',
topics: [utils.fromUtf8('hello_world')],
payload: utils.toHex('12345'),
ttl: utils.toHex('100'),
workToProve: utils.toHex('101')
}],
result: true,
formattedResult: true,
call: 'shh_'+ method
}, {
args: [{
from: '0x21312',
topics: ['hello_world'],
payload: '0x12345',
ttl: 0x100,
workToProve: 0x101
}],
formattedArgs: [{
from: '0x21312',
topics: [utils.fromUtf8('hello_world')],
payload: '0x12345',
ttl: '0x100',
workToProve: '0x101'
}],
result: true,
formattedResult: true,
call: 'shh_'+ method
}];
testMethod.runTests('shh', method, tests);