Squashed 'libjsqrc/ethereumjs/' changes from d509360..eceeda7

eceeda7 gulp
cc3e373 Merge pull request #109 from LefterisJP/string_hash_rename
3a22498 string type basically becomes bytes type
760634a Changing abi tests to use fixed bytes type
6554479 Merge pull request #108 from frozeman/apiOverhaul
b322378 removed unecessary utils
9a3d320 changed my author url
8516a2f removed uncommented line
1730f21 add version replacement use version.json now
27e5706 bumped version
3614cea bumped version
9c3d1b2 merged develop
2e320ed add versions
08a38b3 removed unecessary open in httpprovidor
5636510 add inputformatter for sha3
50ca903 add build
f351e95 removed unecessary log
67ab5ef removed unecessary log

git-subtree-dir: libjsqrc/ethereumjs
git-subtree-split: eceeda7d0878579cdc6324f3026ae88079c30720
This commit is contained in:
Marek Kotewicz 2015-03-13 16:13:43 +01:00
parent 792c3e7094
commit 60162d919b
3 changed files with 17 additions and 125 deletions

View File

@ -227,56 +227,6 @@ describe('abi', function() {
});
it('should parse input hash', function() {
// given
var d = clone(description);
d[0].inputs = [
{ type: "hash" }
];
// when
var parser = abi.inputParser(d);
// then
assert.equal(parser.test("0x407d73d8a49eeb85d32cf465507dd71d507100c1"), "000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1");
});
it('should parse input hash256', function() {
// given
var d = clone(description);
d[0].inputs = [
{ type: "hash256" }
];
// when
var parser = abi.inputParser(d);
// then
assert.equal(parser.test("0x407d73d8a49eeb85d32cf465507dd71d507100c1"), "000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1");
});
it('should parse input hash160', function() {
// given
var d = clone(description);
d[0].inputs = [
{ type: "hash160" }
];
// when
var parser = abi.inputParser(d);
// then
assert.equal(parser.test("0x407d73d8a49eeb85d32cf465507dd71d507100c1"), "000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1");
});
it('should parse input address', function () {
// given
@ -294,13 +244,13 @@ describe('abi', function() {
});
it('should parse input string', function () {
it('should parse input fixed bytes type', function () {
// given
var d = clone(description);
d[0].inputs = [
{ type: "string" }
{ type: "bytes" }
];
// when
@ -318,14 +268,14 @@ describe('abi', function() {
);
});
it('should parse input int followed by a string', function () {
it('should parse input int followed by a fixed bytes type', function () {
// given
var d = clone(description);
d[0].inputs = [
{ type: "int" },
{ type: "string" }
{ type: "bytes" }
];
// when
@ -340,13 +290,13 @@ describe('abi', function() {
);
});
it('should parse input string followed by an int', function () {
it('should parse input fixed bytes type followed by an int', function () {
// given
var d = clone(description);
d[0].inputs = [
{ type: "string" },
{ type: "bytes" },
{ type: "int" }
];
@ -391,8 +341,8 @@ describe('abi', function() {
},{
name: "test2",
type: "function",
inputs: [{ type: "string" }],
outputs: [{ type: "string" }]
inputs: [{ type: "bytes" }],
outputs: [{ type: "bytes" }]
}];
// when

View File

@ -21,13 +21,13 @@ var description = [{
describe('abi', function() {
describe('outputParser', function() {
it('should parse output string', function() {
it('should parse output fixed bytes type', function() {
// given
var d = clone(description);
d[0].outputs = [
{ type: "string" }
{ type: "bytes" }
];
// when
@ -181,64 +181,6 @@ describe('abi', function() {
assert.equal(parser.test("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0")[0], -16);
});
it('should parse output hash', function() {
// given
var d = clone(description);
d[0].outputs = [
{ type: 'hash' }
];
// when
var parser = abi.outputParser(d);
// then
assert.equal(
parser.test("0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1")[0],
"0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1"
);
});
it('should parse output hash256', function() {
// given
var d = clone(description);
d[0].outputs = [
{ type: 'hash256' }
];
// when
var parser = abi.outputParser(d);
// then
assert.equal(
parser.test("0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1")[0],
"0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1"
);
});
it('should parse output hash160', function() {
// given
var d = clone(description);
d[0].outputs = [
{ type: 'hash160' }
];
// when
var parser = abi.outputParser(d);
// then
assert.equal(
parser.test("0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1")[0],
"0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1"
);
// TODO shouldnt' the expected hash be shorter?
});
it('should parse output address', function() {
// given
@ -317,14 +259,14 @@ describe('abi', function() {
});
it('should parse multiple output strings', function() {
it('should parse multiple output fixed bytes type', function() {
// given
var d = clone(description);
d[0].outputs = [
{ type: "string" },
{ type: "string" }
{ type: "bytes" },
{ type: "bytes" }
];
// when
@ -380,8 +322,8 @@ describe('abi', function() {
},{
name: "test2",
type: "function",
inputs: [{ type: "string" }],
outputs: [{ type: "string" }]
inputs: [{ type: "bytes" }],
outputs: [{ type: "bytes" }]
}];
// when

View File

@ -5,8 +5,8 @@ var u = require('./test.utils.js');
describe('web3', function() {
describe('db', function() {
u.methodExists(web3.db, 'put');
u.methodExists(web3.db, 'get');
u.methodExists(web3.db, 'putHex');
u.methodExists(web3.db, 'getHex');
u.methodExists(web3.db, 'putString');
u.methodExists(web3.db, 'getString');
});