Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse reply helpers #502

Merged
merged 28 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7e52f64
Add first impl using prost
maurolacy Oct 20, 2021
18ddb76
Add manual protobuf decoding
maurolacy Oct 20, 2021
ce22a9c
Add protobuf parsing helpers
maurolacy Oct 20, 2021
16dbb2d
Add length checks / avoid panic
maurolacy Oct 20, 2021
f14dec1
Add length-prefixed field protobuf parser
maurolacy Oct 21, 2021
bb4baad
Add parse_reply_execute_data helper
maurolacy Oct 21, 2021
0cee15a
Add empty instantiate data check
maurolacy Oct 21, 2021
ad1cc93
Add field number to parse protobuf helpers
maurolacy Oct 21, 2021
3390286
Add protobuf base128 varint decoding
maurolacy Oct 21, 2021
9b69ce0
Fix protobuf base128 varint decoding
maurolacy Oct 21, 2021
82449eb
Define the expected data explicitly
maurolacy Oct 21, 2021
1e1e19b
Remove unnecessary / extra bit shifts
maurolacy Oct 21, 2021
ff25971
Add string works tests
maurolacy Oct 22, 2021
489133b
Add string errs tests
maurolacy Oct 23, 2021
68f2121
Add bytes works tests
maurolacy Oct 23, 2021
4d29b4c
Add varint and length prefixed tests
maurolacy Oct 23, 2021
4abee6a
Use protobuf encoding helper for bytes tests
maurolacy Oct 23, 2021
ed54fb8
Use protobuf encoding helper for string
maurolacy Oct 23, 2021
6885041
Fix empty string case
maurolacy Oct 23, 2021
2c81a96
Consolidate string tests
maurolacy Oct 23, 2021
36e4e10
Use slice instead of vec
maurolacy Oct 23, 2021
e478292
Merge branch 'main' into 480-reply-parsing-helpers
maurolacy Oct 25, 2021
ec2f741
Simplify varint computation
maurolacy Oct 25, 2021
2153df7
Avoid split_off when possible
maurolacy Oct 25, 2021
13ca025
Avoid unnecessary conversion
maurolacy Oct 25, 2021
41a57ae
Merge branch 'main' into 480-reply-parsing-helpers
maurolacy Oct 26, 2021
ad1aa5f
Update prost to latest version
maurolacy Oct 26, 2021
a442d7c
Update lock file
maurolacy Oct 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/cw0/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ thiserror = { version = "1.0.21" }

[dev-dependencies]
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.10.0" }
prost = "0.9"
2 changes: 2 additions & 0 deletions packages/cw0/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ mod balance;
mod event;
mod expiration;
mod pagination;
mod parse_reply;
mod payment;

pub use pagination::{
calc_range_end, calc_range_start, calc_range_start_string, maybe_addr, maybe_canonical,
};
pub use parse_reply::{parse_reply_execute_data, parse_reply_instantiate_data};
pub use payment::{may_pay, must_pay, nonpayable, one_coin, PaymentError};

pub use crate::balance::NativeBalance;
Expand Down
Loading