Skip to content

Commit

Permalink
Merge pull request #893 from everx-labs/fix
Browse files Browse the repository at this point in the history
Fix the build
  • Loading branch information
tonjen authored Feb 22, 2025
1 parent 0fb7cfd commit 68ee158
Show file tree
Hide file tree
Showing 42 changed files with 39,255 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## Version 2.2.25

- Fix the build

## Version 2.2.0

- Use modern crates anyhow and thiserror instead of failure
Expand Down
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build = 'common/build/build.rs'
edition = '2021'
name = 'ever_vm'
version = '2.2.24'
version = '2.2.25'

[dependencies]
anyhow = '1.0'
Expand All @@ -27,8 +27,10 @@ rand = '0.8'
ever_assembler = { git = 'https://github.com/everx-labs/ever-assembler.git' }

[features]
ci_run = [ ]
fift_check = [ ]
gosh = [ 'ever_block/gosh', 'diffy', 'similar', 'zstd' ]
gosh_test = [ 'gosh', 'ever_assembler/gosh' ]
log_file = [ ]
signature_no_check = [ ]
signature_with_id = [ 'ever_block/signature_with_id' ]
Expand Down
2 changes: 2 additions & 0 deletions src/tests/test_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,5 @@ fn test_sorted_validator_list() {
}
}

#[cfg(feature = "ci_run")]
mod private_test_accounts;
2 changes: 2 additions & 0 deletions src/tests/test_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,5 @@ fn test_currency_collection_ser() {
assert_eq!(b1, b2);
}

#[cfg(feature = "ci_run")]
mod private_test_executor;
1 change: 1 addition & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
demo.blk
73 changes: 73 additions & 0 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Copyright (C) 2019-2024 EverX. All Rights Reserved.
*
* Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
* this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific EVERX DEV software governing permissions and
* limitations under the License.
*/

pub mod test_framework;
pub use test_framework::*;

use ever_block::GlobalCapabilities;
use ever_assembler::CompileError;
use ever_vm::stack::StackItem;
use ever_block::{BuilderData, SliceData, ExceptionCode};

#[allow(dead_code)]
pub mod create {
use super::*;

pub fn cell<T: AsRef<[u8]>>(data:T) -> StackItem {
let data = data.as_ref().to_vec();
StackItem::Cell(BuilderData::with_bitstring(data).unwrap().into_cell().unwrap())
}

pub fn builder<T: AsRef<[u8]>>(data:T) -> StackItem {
let builder = BuilderData::with_bitstring(data.as_ref().to_vec()).unwrap();
StackItem::builder(builder)
}

pub fn slice<T: AsRef<[u8]>>(data:T) -> StackItem {
let data = data.as_ref().to_vec();
let slice = SliceData::new(data);
StackItem::Slice(slice)
}

pub fn tuple<T: AsRef<[StackItem]>>(data: &T) -> StackItem {
let data = data.as_ref().to_vec();
StackItem::tuple(data)
}
}

#[allow(dead_code)]
pub fn test_single_argument_fail(cmd: &str, argument: isize) {
let code = format!("{} {}", cmd, argument);
test_case(code)
.expect_compilation_failure(CompileError::out_of_range(1, 1, cmd, "arg 0"));
}

#[allow(dead_code)]
pub fn expect_exception(code: &str, exc_code: ExceptionCode) {
test_case(code).expect_failure(exc_code);
}

#[allow(dead_code)]
pub fn expect_exception_with_capability(
code: &str,
exc_code: ExceptionCode,
capability: GlobalCapabilities,
check_fift: bool
) {
test_case(
code,
)
.with_capability(capability)
.skip_fift_check(!check_fift)
.expect_failure(exc_code);
}
Loading

0 comments on commit 68ee158

Please sign in to comment.