Skip to content

Commit 182dfb9

Browse files
committed
piecrust: support bytecheck integrity check of arguments
1 parent 2619a2e commit 182dfb9

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

piecrust/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Change `call` and `feeder_call` functions to support `bytecheck`-based integrity check of arguments [#324]
13+
1014
### Added
1115

1216
- Add `Session::migrate` to allow for swapping contract code [#313]
@@ -360,6 +364,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
360364

361365
<!-- ISSUES -->
362366
[#325]: https://github.com/dusk-network/piecrust/issues/325
367+
[#324]: https://github.com/dusk-network/piecrust/issues/324
363368
[#301]: https://github.com/dusk-network/piecrust/issues/313
364369
[#301]: https://github.com/dusk-network/piecrust/issues/301
365370
[#296]: https://github.com/dusk-network/piecrust/issues/296

piecrust/src/session.rs

+2
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ impl Session {
339339
) -> Result<CallReceipt<R>, Error>
340340
where
341341
A: for<'b> Serialize<StandardBufSerializer<'b>>,
342+
A::Archived: for<'b> CheckBytes<DefaultValidator<'b>>,
342343
R: Archive,
343344
R::Archived: Deserialize<R, Infallible>
344345
+ for<'b> CheckBytes<DefaultValidator<'b>>,
@@ -462,6 +463,7 @@ impl Session {
462463
) -> Result<CallReceipt<R>, Error>
463464
where
464465
A: for<'b> Serialize<StandardBufSerializer<'b>>,
466+
A::Archived: for<'b> CheckBytes<DefaultValidator<'b>>,
465467
R: Archive,
466468
R::Archived: Deserialize<R, Infallible>
467469
+ for<'b> CheckBytes<DefaultValidator<'b>>,

piecrust/tests/spender.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub fn panic_msg_gets_through() -> Result<(), Error> {
6464
let receipt = session.call::<_, Result<(), ContractError>>(
6565
callcenter_id,
6666
"call_spend_with_limit",
67-
&(spender_id, 1000u64),
67+
&(spender_id, 1175u64),
6868
LIMIT,
6969
)?;
7070

@@ -125,8 +125,8 @@ pub fn contract_sets_call_limit() -> Result<(), Error> {
125125
LIMIT,
126126
)?;
127127

128-
const FIRST_LIMIT: u64 = 1000;
129-
const SECOND_LIMIT: u64 = 2000;
128+
const FIRST_LIMIT: u64 = 1175;
129+
const SECOND_LIMIT: u64 = 2175;
130130

131131
let receipt = session_1st.call::<_, Result<(), ContractError>>(
132132
callcenter_id,

0 commit comments

Comments
 (0)