Merge branch 'develop' of https://github.com/ripple/ripple-lib into develop

Conflicts:
	src/js/ripple/serializedtypes.js
	test/serializedtypes-test.js

JSONify complex structures before comparing them in tests.
This commit is contained in:
jatchili
2013-09-10 16:46:53 -07:00
13 changed files with 152 additions and 269 deletions

View File

@@ -153,7 +153,6 @@ SerializedObject.prototype.to_json = function() {
function jsonify_structure(thing, field_name) {
var output;
console.log("JSONIFYING:", thing, field_name);
switch (typeof thing) {
case 'number':
switch (field_name) {
@@ -167,9 +166,6 @@ function jsonify_structure(thing, field_name) {
output = TRANSACTION_TYPES[thing] || thing;
break;
default:
if (typeof thing.to_json === 'function') {
console.log("WE COULD HAVE DONE:", thing.to_json());
}
output = thing;
}
break;
@@ -190,10 +186,11 @@ function jsonify_structure(thing, field_name) {
default:
output = thing;
}
console.log("AND THE RESULT WAS:", output);
return output;
};
SerializedObject.jsonify_structure = jsonify_structure; //So that we can access it from elsewhere.
SerializedObject.prototype.serialize = function (typedef, obj) {
// Ensure canonical order
typedef = SerializedObject._sort_typedef(typedef.slice());