web3.js/test/shh.post.js

46 lines
1.0 KiB
JavaScript
Raw Normal View History

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