-
Notifications
You must be signed in to change notification settings - Fork 89
feat(network): add conversion from protobuf transaction outputs to sn api #2055
feat(network): add conversion from protobuf transaction outputs to sn api #2055
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2055 +/- ##
==========================================
- Coverage 69.63% 69.15% -0.49%
==========================================
Files 131 131
Lines 17220 17340 +120
Branches 17220 17340 +120
==========================================
Hits 11992 11992
- Misses 3904 4024 +120
Partials 1324 1324 ☔ View full report in Codecov by Sentry. |
61d44bb
to
d06c5bf
Compare
e3a4136
to
24459b6
Compare
d06c5bf
to
db6b510
Compare
24459b6
to
b4feeb4
Compare
db6b510
to
38fcac0
Compare
b4feeb4
to
8ed7fa2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @asmaastarkware and @dan-starkware)
crates/papyrus_protobuf/src/converters/receipt.rs
line 107 at r2 (raw file):
} // The price_unit will be updated in the caller function
Change this to:
// The returned price_unit isn't correct. It can be fixed by calling set_price_unit_based_on_transaction
In general, comments should be in the scope of the function and not the entire crate
Same in other places
crates/papyrus_protobuf/src/converters/receipt.rs
line 452 at r2 (raw file):
} fn create_receipt_common_from_txn_output_fields(
Add proto to this name somewhere
create_proto_receipt_common_from_txn_output_fields
crates/papyrus_protobuf/src/converters/transaction.rs
line 1122 at r2 (raw file):
_ => return, }; if let Some(ref mut receipt_type) = receipt.r#type {
use let-else to remove one indentation to all the code below
crates/papyrus_protobuf/src/converters/transaction.rs
line 1125 at r2 (raw file):
match receipt_type { protobuf::receipt::Type::Invoke(invoke) => { if let Some(ref mut common) = invoke.common {
return here the reference to common and in all other transactions and then, in a single place, set the price unit
38fcac0
to
45b99ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @dan-starkware and @ShahakShama)
crates/papyrus_protobuf/src/converters/receipt.rs
line 107 at r2 (raw file):
Previously, ShahakShama wrote…
Change this to:
// The returned price_unit isn't correct. It can be fixed by calling set_price_unit_based_on_transaction
In general, comments should be in the scope of the function and not the entire crate
Same in other places
Done.
crates/papyrus_protobuf/src/converters/receipt.rs
line 452 at r2 (raw file):
Previously, ShahakShama wrote…
Add proto to this name somewhere
create_proto_receipt_common_from_txn_output_fields
Done.
crates/papyrus_protobuf/src/converters/transaction.rs
line 1122 at r2 (raw file):
Previously, ShahakShama wrote…
use let-else to remove one indentation to all the code below
Done.
crates/papyrus_protobuf/src/converters/transaction.rs
line 1125 at r2 (raw file):
Previously, ShahakShama wrote…
return here the reference to common and in all other transactions and then, in a single place, set the price unit
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @asmaastarkware and @dan-starkware)
crates/papyrus_protobuf/src/converters/receipt.rs
line 115 at r3 (raw file):
value.execution_status, ); // The returned price_unit isn't correct.
Move this to the start of the function. And change it to docstring (3 slashes)
Same everywhere
45b99ec
to
dae7be4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dan-starkware and @ShahakShama)
crates/papyrus_protobuf/src/converters/receipt.rs
line 115 at r3 (raw file):
Previously, ShahakShama wrote…
Move this to the start of the function. And change it to docstring (3 slashes)
Same everywhere
Done.
dae7be4
to
6068093
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @dan-starkware)
This change is