public entry fun test<T: drop + store>(
t: T,
ctx: &mut TxContext,
) {}
sui client call \
--module test \
--package $PKD_ID \
--function test \
--type-args "u8" \
--args 1 \
--gas-budget 100000000 \
errors
Could not serialize argument of type TypeParameter(0) at 0
1 Like
@shiqicao entry functions do accept generic type parameters.
I am sensing the issue is probably passing it by using the CLI, because I tried the same function using TS SDK and it worked fine as a workaround.
const tx = new TransactionBlock();
tx.moveCall({
target: '{pkg_id}::test::test',
typeArguments: ['u8'],
arguments: [
tx.pure('1', 'u8')
]
... proceed with signing & executing the transaction
2 Likes