Skip to content

Commit

Permalink
Merge branch 'master' into release-52-1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica authored Aug 1, 2024
2 parents 49bc839 + 94f4353 commit 67d6f46
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,15 @@
"mutability": "readonly",
"inputs": [
{
"name": "_arg",
"name": "arg",
"type": "AbiWithManagedBufferReadToEnd"
}
],
"outputs": []
"outputs": [
{
"type": "bytes"
}
]
},
{
"name": "payable_egld",
Expand Down
6 changes: 3 additions & 3 deletions contracts/feature-tests/abi-tester/src/abi_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,12 @@ where
Arg0: ProxyArg<AbiWithManagedBufferReadToEnd<Env::Api>>,
>(
self,
_arg: Arg0,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
arg: Arg0,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ManagedBuffer<Env::Api>> {
self.wrapped_tx
.payment(NotPayable)
.raw_call("takes_object_with_managed_buffer_read_to_end")
.argument(&_arg)
.argument(&arg)
.original_result()
}

Expand Down
5 changes: 3 additions & 2 deletions contracts/feature-tests/abi-tester/src/abi_tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ pub trait AbiTester {
#[view]
fn takes_object_with_managed_buffer_read_to_end(
&self,
_arg: AbiWithManagedBufferReadToEnd<Self::Api>,
) {
arg: AbiWithManagedBufferReadToEnd<Self::Api>,
) -> ManagedBuffer {
arg.flush.to_managed_buffer()
}

#[endpoint]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ impl<M: ManagedTypeApi> ManagedBufferReadToEnd<M> {
pub fn new_from_buf(buf: ManagedBuffer<M>) -> Self {
Self { buffer: buf }
}

#[inline]
pub fn to_managed_buffer(&self) -> ManagedBuffer<M> {
self.buffer.clone()
}
}

impl<M: ManagedTypeApi> PartialEq for ManagedBufferReadToEnd<M> {
Expand Down

0 comments on commit 67d6f46

Please sign in to comment.