web3.js/test/iban.toAddress.js

27 lines
884 B
JavaScript
Raw Normal View History

2015-08-06 17:11:15 +02:00
var chai = require('chai');
var assert = chai.assert;
2017-02-14 16:35:27 +01:00
var Iban = require('../packages/web3-eth-iban');
2015-08-06 17:11:15 +02:00
var tests = [
{ direct: 'XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS', address: '0x00c5496aEe77C1bA1f0854206A26DdA82a81D6D8'}
2015-08-06 17:11:15 +02:00
];
describe('lib/web3/iban', function () {
describe('Iban.toAddress()', function () {
tests.forEach(function (test) {
it('shoud transform iban to address: ' + test.address, function () {
assert.deepEqual(Iban.toAddress(test.direct), test.address);
});
});
});
describe('iban instance address()', function () {
2015-08-06 17:11:15 +02:00
tests.forEach(function (test) {
it('shoud transform iban to address: ' + test.address, function () {
var iban = new Iban(test.direct);
2017-02-08 10:58:36 +01:00
assert.deepEqual(iban.toAddress(), test.address);
2015-08-06 17:11:15 +02:00
});
});
2015-08-06 17:11:15 +02:00
});
});