forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed 'libjsqrc/ethereumjs/' changes from 16861fc..ca46cb5
ca46cb5 updated examples aff3497 updated icap example 9fa9b16 gulp 61f1ba6 Merge pull request ethereum#224 from alexvandesande/prefix-name-reorg 448dd30 Merge branch 'master' into develop 7753724 build files fc3dc7a build files c9ebd7e version 0.5.0 448cf03 Merge branch 'master' into develop 43e8f0e Merge pull request ethereum#207 from ethereum/icap 0a56733 updated icap example e67e705 Merge pull request ethereum#223 from ethereum/revert-222-master f229f4e Revert "sync sendTransaction returning tx address" ca58837 Merge pull request ethereum#222 from jesuscript/master 66a2b6c sync sendTransaction returning tx address b19e46c updated "deposit" method description, updated icap example contract abi fbb9a41 Merge branch 'develop' into icap 3bb6e4f sha3 backward compatibility. ethereum#205 d0be181 fixed const functions calls handling errors 858d0c6 lint 95aabe3 sendIBANTransaction && tests 5866f08 milli should have two l's bacb03c Rename Kwei to kwei, added support for some SI base units for ether dfd5060 use "official" namereg, updated examples d8ad2b7 Merge branch 'develop' into icap 3fb420f Merge branch 'master' into develop ea4d66e updated examples e6209c6 Merge branch 'master' into develop 71ae809 version 0.4.3 92e2a2f Merge branch 'master' into develop d03bec6 decoding of empty array, fixed ethereum#210, fixed ethereum#211 9abf38a fixed encoding of empty arrays 2ad458c Merge pull request ethereum#212 from ethereum/estimateGas be2e93f build d4bf850 fixed typo 0594e7f add estimateGas to contract methods and fixed sendTransaction return value 55c4653 test/isIBAN.js e9483a6 icap.html example 6fb04d8 namereg example allows to register custom names 60c9bf8 removed natspec example, added namereg example cd773fc updated docs 4af0085 web3.eth.namereg contract, icap in progress 02556ea removed unnecessary file d320552 crypto-js integrated into project adf91df sha3 init git-subtree-dir: libjsqrc/ethereumjs git-subtree-split: ca46cb5c94da4d37e9f4a5b8f6c0d117b72668d7
- Loading branch information
Showing
9 changed files
with
240 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var chai = require('chai'); | ||
var assert = chai.assert; | ||
var sha3 = require('../lib/utils/sha3'); | ||
var web3 = require('../index'); | ||
|
||
describe('lib/utils/sha3', function () { | ||
var test = function (v, e) { | ||
it('should encode ' + v + ' to ' + e, function () { | ||
assert.equal(sha3(v), e); | ||
}); | ||
}; | ||
|
||
test('test123', 'f81b517a242b218999ec8eec0ea6e2ddbef2a367a14e93f4a32a39e260f686ad'); | ||
test('test(int)', 'f4d03772bec1e62fbe8c5691e1a9101e520e8f8b5ca612123694632bf3cb51b1'); | ||
test(web3.fromAscii('test123'), 'f81b517a242b218999ec8eec0ea6e2ddbef2a367a14e93f4a32a39e260f686ad'); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
var chai = require('chai'); | ||
var utils = require('../lib/utils/utils.js'); | ||
var assert = chai.assert; | ||
|
||
var tests = [ | ||
{ obj: function () {}, is: false}, | ||
{ obj: new Function(), is: false}, | ||
{ obj: 'function', is: false}, | ||
{ obj: {}, is: false}, | ||
{ obj: '[]', is: false}, | ||
{ obj: '[1, 2]', is: false}, | ||
{ obj: '{}', is: false}, | ||
{ obj: '{"a": 123, "b" :3,}', is: false}, | ||
{ obj: '{"c" : 2}', is: false}, | ||
{ obj: 'XE81ETHXREGGAVOFYORK', is: true}, | ||
{ obj: 'XE81ETCXREGGAVOFYORK', is: false}, | ||
{ obj: 'XE81ETHXREGGAVOFYORKD', is: false}, | ||
{ obj: 'XE81ETHXREGGaVOFYORK', is: false}, | ||
{ obj: 'XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS', is: true}, | ||
{ obj: 'XD7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS', is: false} | ||
]; | ||
|
||
describe('lib/utils/utils', function () { | ||
describe('isIBAN', function () { | ||
tests.forEach(function (test) { | ||
it('shoud test if value ' + test.obj + ' is iban: ' + test.is, function () { | ||
assert.equal(utils.isIBAN(test.obj), test.is); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
var chai = require('chai'); | ||
var assert = chai.assert; | ||
var web3 = require('../index'); | ||
var FakeHttpProvider = require('./helpers/FakeHttpProvider'); | ||
var FakeHttpProvider2 = require('./helpers/FakeHttpProvider2'); | ||
|
||
describe('web3.eth.sendIBANTransaction', function () { | ||
it('should send transaction', function () { | ||
|
||
var iban = 'XE81ETHXREGGAVOFYORK'; | ||
var address = '0x1234567890123456789012345678901234500000'; | ||
var exAddress = '0x1234567890123456789012345678901234567890' | ||
|
||
var provider = new FakeHttpProvider2(); | ||
web3.setProvider(provider); | ||
web3.reset(); | ||
|
||
provider.injectResultList([{ | ||
result: exAddress | ||
}, { | ||
result: '' | ||
}]); | ||
|
||
var step = 0; | ||
provider.injectValidation(function (payload) { | ||
if (step === 0) { | ||
step++; | ||
assert.equal(payload.method, 'eth_call'); | ||
assert.deepEqual(payload.params, [{ | ||
data: '0x3b3b57de5852454700000000000000000000000000000000000000000000000000000000', | ||
to: web3.eth.namereg.address | ||
}, "latest"]); | ||
|
||
return; | ||
} | ||
assert.equal(payload.method, 'eth_sendTransaction'); | ||
assert.deepEqual(payload.params, [{ | ||
data: '0xb214faa54741564f46594f524b0000000000000000000000000000000000000000000000', | ||
from: address, | ||
to: exAddress, | ||
value: payload.params[0].value // don't check this | ||
}]); | ||
}); | ||
|
||
web3.eth.sendIBANTransaction(address, iban, 10000); | ||
|
||
}); | ||
}); | ||
|
This file was deleted.
Oops, something went wrong.