strict-types / strict-encoding Goto Github PK
View Code? Open in Web Editor NEWProtobufs for functional programming
Home Page: https://strict-encoding.org
License: Apache License 2.0
Protobufs for functional programming
Home Page: https://strict-encoding.org
License: Apache License 2.0
The InvalidRString::InvalidChar
error contains the character that has been found to be invalid, but it may not match the character in the original string.
As an example, trying to issue an asset using a Unicode character in the ticker or name trigger this issue.
More specifically, issuing a NIA asset with name name with ℧nicode characters
throws the error:
string 'name with ℧nicode characters' contains invalid character 'â'
This probably happens because the string is parsed 1 byte at a time and the 1st byte of the Unicode character happens to correspond to the â
ASCII character, and this may lead do confusion.
Since the invalid character cannot be correctly interpreted in some cases, it may be better to omit it and just report the string that failed, or report the position of the invalid character in the string (which I think should always be correct) instead of its ASCII representation.
For instance u256
is replaced with U16
Allow deriving custom strict_check via providing a method to call.
This reduces boilerplate in method implementation and avoids rust compiler crashes due to recursions in generic resolution
For checking internal data consistency upon decoding operation
impl<const VERSION: u8> StrictDecode for ___ {
fn strict_check(&self) -> Result<(), DecodeError> {
// ...
}
}
The method should have a default implementation which should not error.
strategy::AsConfined
Provide manual PartialEq implementation which ensures that both tag and name for all variants are distinct
TLV stream has to be the last data item in any message. This wouldn't be the case if a message has fields which are in turn structures with TLV fields, as was discovered by @crisdut in LNP-WG/lnp-node#66
Derive macro has somehow to prevent that from happening (not clear how though...).
Here is the output of cargo build -p strict_encoding -v --no-default-features
:
rustc --crate-name strict_encoding --edition=2021 rust/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=181 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="strict_encoding_derive"' -C metadata=e188277cae2a4737 -C extra-filename=-e188277cae2a4737 --out-dir /Users/yudaikiyofuji/IdeaProjects/strict-encoding/target/debug/deps -C incremental=/Users/yudaikiyofuji/IdeaProjects/strict-encoding/target/debug/incremental -L dependency=/Users/yudaikiyofuji/IdeaProjects/strict-encoding/target/debug/deps --extern amplify=/Users/yudaikiyofuji/IdeaProjects/strict-encoding/target/debug/deps/libamplify-be50d4e6df4ec592.rmeta --extern strict_encoding_derive=/Users/yudaikiyofuji/IdeaProjects/strict-encoding/target/debug/deps/libstrict_encoding_derive-627116894db1dd46.dylib
You can see the feature default
is unexpectedly activated. This is likely because we have a dev-dependency strict_encoding_test
which is circularly dependent on strict-encoding
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.