ink icon indicating copy to clipboard operation
ink copied to clipboard

Allow Slices in Message Parameters

Open HCastano opened this issue 3 years ago • 2 comments

Recently I came across some places where I thought it would be nicer to have users provide &[T] instead of Vec<T> as arguments to my contract's messages. However, I ran into some gross looking lifetime issues that I'm pretty sure could not be solved without additional support from the Ink macros themselves.

From talking with @Robbepop it looks like this is doable, but "hardish". Noting it down in case a brave dev in the future comes along and decides to try implementing this 😄

HCastano avatar Jun 09 '21 15:06 HCastano

From talking with @Robbepop it looks like this is doable, but "hardish". Noting it down in case a brave dev in the future comes along and decides to try implementing this smile

It might be doable to solve the heap memory allocation for n-ary parameters but I doubt that we will have lifetimes and slices as the solution in the end. But thanks for the issue, we can keep this for further discussion.

Robbepop avatar Jun 09 '21 16:06 Robbepop

@HCastano Can you please let me know if the issue is still relevant?

SkymanOne avatar Apr 12 '23 19:04 SkymanOne