Refactor contribution serializer and validation #94
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "bugfix/schema_changes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
And fix seeds.
I set this to WIP, because I'm going to add proposal validation and valid proposal seeds to this as well.
Ready for review!
@ -72,1 +51,4 @@
}
/**
* Validate serialized data against schema
What about:
:shipit:
@fsmanuel what's with your comment, want to merge it?
@ -72,1 +51,4 @@
}
/**
* Validate serialized data against schema
Let's try ro create smaller PRs for suggestions like this, instead of having them hold up larger branches from being merged.
(E.g. personally, I don't like unnamed options, so I'd probably propose to use an options object for this. But that's a completely different discussion than if the schema validation here is implemented good enough in general or not.)
What do you think?
@ -72,1 +51,4 @@
}
/**
* Validate serialized data against schema
Well I think that the initial idea to move the validation into the serializer was to get rid of the
JSON.stringify
->JSON.parse
thing for the validation. My suggestion is focusing on how we can prevent this.Another thing I don't understand is why you removed the static function and don't use the class at all.
@ -72,1 +51,4 @@
}
/**
* Validate serialized data against schema
That's not at all how I understood the idea. I merely refactored everything to be both shared modules and also do the validation in the class instead of outside.
Not sure I understand. It's using only the class now, because I added more functions to it. I turned the static function into a prototype function, because that's actually using the class with prototype properties then.
@ -72,1 +51,4 @@
}
/**
* Validate serialized data against schema
By the way, in a way I also like validating exactly what's being stored in IPFS. I don't see it as a problem, and I don't see why a refactoring of that should keep us from merging now, as explained. I'm open to good reasons why the code in this PR doesn't work or is so bad it needs to be changed. But frankly, it seems like wasting time to me. This refactoring wouldn't even affect the code using the class from the outside. Let alone clients using the wrapper.
@ -72,1 +51,4 @@
}
/**
* Validate serialized data against schema
I was referring to this https://github.com/67P/kredits-contracts/pull/92#discussion_r274168386
So my suggestion adds little to archive this. I modified to code above to better illustrate the idea. If you disagree merge it as is.
I think reviews are the place to raise this discussions, aren't they?
@ -72,1 +51,4 @@
}
/**
* Validate serialized data against schema
That being said. I like your implementation!