Questions tagged [chain-extension]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
39 views

How can I increase contract memory in pallet-contracts + chain-extension?

I am exposing some external functions to ink! contracts via a chain-extension in pallet-contracts. I am essentially passing a vector of bytes as a parameter to a contract method and directly ...
user avatar
1 vote
1 answer
33 views

Contract CodeRejected when using chain extension

I've recently upgraded my chain to the latest substrate master, however, I'm unable to deploy contracts that use a chain extension. When I try to use a chain extension, the contract fails to deploy ...
user avatar
  • 333
1 vote
1 answer
21 views

How to retrieve dynamic type size data from chain extension in ink? [duplicate]

my example looks like this : #[ink(extension = 1111] fn asset_name(asset_id: u32) -> Result<[u8], PalletAssetErr> or this fn asset_name(asset_id: u32) -> Result<[u8], PalletAssetErr>...
user avatar
  • 31
2 votes
1 answer
35 views

How to return error from chain extension?

I saw how to handle error from chain extension on smart contract side https://paritytech.github.io/ink-docs/macros-attributes/chain-extension#error-code But I can't find example and can't understand ...
user avatar
  • 31
4 votes
1 answer
53 views

How to benchmark a chain extension?

I would like to know the recommended way to benchmark a chain extension, and then how to charge the calculated weight. According to this document, we need to write benchmarks.
user avatar
4 votes
2 answers
69 views

Correct way to use dynamic sized types in chain extension

I'm writing chain extensions for my pallets and I have a few functions that require dynamic sized types, for example Vec<u8> for metadata and Vec<u64> for a list of asset ids. The way I am ...
user avatar
5 votes
2 answers
87 views

How do I test a chain extension used in the runtime?

I am aware of this example that shows how to create a mock chain extension and test that. However, I do not know how to test the chain extension that is used by the runtime and calling functions from ...
user avatar
2 votes
1 answer
41 views

Chain Extension func_id enumeration is resulting in ContractTrapped for func ids greater than 1

I'm encountering an issue where a contract is only able to called functions in my chain extension if they are enumerated with function ids 0 and 1. My chain extension has four functions, lets say ...
user avatar
  • 333