Skip to content

Commit 401ec48

Browse files
fix: revert node contract update extrinsic
1 parent cfe820c commit 401ec48

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

substrate-node/charts/substrate-node/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ name: substrate-node
33
description: Tfchain node
44
type: application
55
version: 0.2.4
6-
appVersion: "2.1.0-b2"
6+
appVersion: "2.1.0-b3"

substrate-node/pallets/pallet-smart-contract/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,10 @@ pub mod pallet {
320320
origin: OriginFor<T>,
321321
contract_id: u64,
322322
deployment_hash: DeploymentHash,
323+
deployment_data: DeploymentDataInput<T>,
323324
) -> DispatchResultWithPostInfo {
324325
let account_id = ensure_signed(origin)?;
325-
Self::_update_node_contract(account_id, contract_id, deployment_hash)
326+
Self::_update_node_contract(account_id, contract_id, deployment_hash, deployment_data)
326327
}
327328

328329
#[pallet::weight(10_000 + T::DbWeight::get().writes(1))]
@@ -650,6 +651,7 @@ impl<T: Config> Pallet<T> {
650651
account_id: T::AccountId,
651652
contract_id: u64,
652653
deployment_hash: DeploymentHash,
654+
deployment_data: DeploymentDataInput<T>,
653655
) -> DispatchResultWithPostInfo {
654656
let mut contract = Contracts::<T>::get(contract_id).ok_or(Error::<T>::ContractNotExists)?;
655657
let twin =
@@ -680,6 +682,7 @@ impl<T: Config> Pallet<T> {
680682
);
681683

682684
node_contract.deployment_hash = deployment_hash;
685+
node_contract.deployment_data = deployment_data;
683686

684687
// override values
685688
contract.contract_type = types::ContractData::NodeContract(node_contract);

substrate-node/pallets/pallet-smart-contract/src/tests.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ fn test_update_node_contract_works() {
176176
assert_ok!(SmartContractModule::update_node_contract(
177177
Origin::signed(alice()),
178178
1,
179-
new_hash
179+
new_hash,
180+
get_deployment_data()
180181
));
181182

182183
let node_contract = types::NodeContract {
@@ -219,7 +220,8 @@ fn test_update_node_contract_not_exists_fails() {
219220
SmartContractModule::update_node_contract(
220221
Origin::signed(alice()),
221222
1,
222-
generate_deployment_hash()
223+
generate_deployment_hash(),
224+
get_deployment_data()
223225
),
224226
Error::<TestRuntime>::ContractNotExists
225227
);
@@ -244,7 +246,8 @@ fn test_update_node_contract_wrong_twins_fails() {
244246
SmartContractModule::update_node_contract(
245247
Origin::signed(bob()),
246248
1,
247-
generate_deployment_hash()
249+
generate_deployment_hash(),
250+
get_deployment_data()
248251
),
249252
Error::<TestRuntime>::TwinNotAuthorizedToUpdateContract
250253
);

substrate-node/runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
139139
spec_name: create_runtime_str!("substrate-threefold"),
140140
impl_name: create_runtime_str!("substrate-threefold"),
141141
authoring_version: 1,
142-
spec_version: 105,
142+
spec_version: 106,
143143
impl_version: 1,
144144
apis: RUNTIME_API_VERSIONS,
145145
transaction_version: 2,

0 commit comments

Comments
 (0)