Merge coretypes repo

This commit is contained in:
Chris Clark
2015-10-07 10:57:21 -07:00
parent ef0d1f5679
commit 2877d1a280
55 changed files with 8142 additions and 25 deletions

View File

@@ -0,0 +1,24 @@
'use strict';
const assert = require('assert-diff');
const {Amount} = require('../src/coretypes');
describe('Amount', function() {
it('can be parsed from', function() {
assert(Amount.from('1000000') instanceof Amount);
assert.equal(Amount.from('1000000').valueString(), '1000000');
const fixture = {
'value': '1',
'issuer': '0000000000000000000000000000000000000000',
'currency': 'USD'
};
const amt = Amount.from(fixture);
const rewritten = {
'value': '1',
'issuer': 'rrrrrrrrrrrrrrrrrrrrrhoLvTp',
'currency': 'USD'
};
assert.deepEqual(amt.toJSON(), rewritten);
});
});