Skip to content

Commit

Permalink
Naming consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunxw committed Aug 9, 2023
1 parent dc28dbb commit 6e56a94
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chain-extensions/types/xvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl From<CallError> for XvmExecutionResult {
// `0` is reserved for `Ok`
let error_code = match input {
InvalidVmId => 1,
SameVmCallNotAllowed => 2,
SameVmCallDenied => 2,
InvalidTarget => 3,
InputTooLarge => 4,
ExceedMaxWeightLimit => 5,
Expand Down
2 changes: 1 addition & 1 deletion pallets/xvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ where
ensure!(
context.source_vm_id != vm_id,
CallErrorWithWeight {
error: CallError::SameVmCallNotAllowed,
error: CallError::SameVmCallDenied,
used_weight: overheads,
}
);
Expand Down
4 changes: 2 additions & 2 deletions pallets/xvm/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn calling_into_same_vm_is_not_allowed() {
value
),
CallErrorWithWeight {
error: CallError::SameVmCallNotAllowed,
error: CallError::SameVmCallDenied,
used_weight: evm_used_weight
},
);
Expand All @@ -66,7 +66,7 @@ fn calling_into_same_vm_is_not_allowed() {
assert_noop!(
Xvm::call(wasm_context, wasm_vm_id, ALICE, wasm_target, input, value),
CallErrorWithWeight {
error: CallError::SameVmCallNotAllowed,
error: CallError::SameVmCallDenied,
used_weight: wasm_used_weight
},
);
Expand Down
2 changes: 1 addition & 1 deletion precompiles/xvm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl XvmCall<AccountId> for MockXvmWithArgsCheck {
ensure!(
vm_id != VmId::Evm,
CallErrorWithWeight {
error: SameVmCallNotAllowed,
error: SameVmCallDenied,
used_weight: Weight::zero()
}
);
Expand Down
2 changes: 1 addition & 1 deletion primitives/src/xvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub enum CallError {
/// Invalid VM id.
InvalidVmId,
/// Calling the contracts in the same VM is not allowed.
SameVmCallNotAllowed,
SameVmCallDenied,
/// Target contract address is invalid.
InvalidTarget,
/// Input is too large.
Expand Down

0 comments on commit 6e56a94

Please sign in to comment.