Skip to content

Commit 30e86a7

Browse files
committed
chore: disable chain extension example and add todo for replacement
1 parent 4777960 commit 30e86a7

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

examples/chain-extension/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Testing a chain extension
22

3+
TODO: Replace with precompile example since chain extensions are deprecated in pallet-revive.
4+
35
This example shows how you can use `drink` to test a chain extension.
46

57
From the perspective of a contract implementation or writing tests there is nothing special (i.e., more than usual) that you have to do to interact with a chain extension.

examples/chain-extension/src/chain_extension_ink_side.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*
12
use ink::env::{chain_extension::FromStatusCode, DefaultEnvironment, Environment};
23
34
/// Simple chain extension that provides some staking information.
@@ -38,3 +39,4 @@ impl Environment for StakingEnvironment {
3839
3940
type ChainExtension = StakingExtension;
4041
}
42+
*/

examples/chain-extension/src/chain_extension_runtime_side.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*
12
use drink::pallet_revive::{
23
chain_extension::{ChainExtension, Config as ContractsConfig, Environment, Ext, RetVal},
34
wasm::Memory,
@@ -27,3 +28,4 @@ impl<Runtime: ContractsConfig> ChainExtension<Runtime> for StakingExtension {
2728
Ok(RetVal::Converging(0))
2829
}
2930
}
31+
*/

examples/chain-extension/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#![cfg_attr(not(feature = "std"), no_std, no_main)]
22

3+
//! TODO: Replace with precompile example since chain extensions are deprecated in pallet-revive.
4+
5+
/*
36
/// Fixed value returned by the example chain extension.
47
#[cfg(test)]
58
const CHAIN_EXTENSION_RETURN_VALUE: u32 = 100;
@@ -70,3 +73,4 @@ mod tests {
7073
Ok(())
7174
}
7275
}
76+
*/

0 commit comments

Comments
 (0)