mirror of
https://github.com/FuelLabs/sway.git
synced 2025-12-23 10:11:56 +00:00
Improve Contract Call by not encoding method name (#7455)
Some checks failed
CI / cargo-fmt-check (push) Has been cancelled
Codspeed Benchmarks / benchmarks (push) Has been cancelled
CI / check-dependency-version-formats (push) Has been cancelled
CI / check-forc-manifest-version (push) Has been cancelled
CI / forc-fmt-check-sway-lib-std (push) Has been cancelled
CI / get-fuel-core-version (push) Has been cancelled
CI / build-sway-lib-std (push) Has been cancelled
CI / build-sway-examples (push) Has been cancelled
CI / build-reference-examples (push) Has been cancelled
CI / forc-fmt-check-sway-examples (push) Has been cancelled
CI / forc-fmt-check-panic (push) Has been cancelled
CI / check-sdk-harness-test-suite-compatibility (push) Has been cancelled
CI / build-mdbook (push) Has been cancelled
CI / build-forc-doc-sway-lib-std (push) Has been cancelled
CI / build-forc-test-project (push) Has been cancelled
CI / cargo-build-workspace (push) Has been cancelled
CI / cargo-clippy (push) Has been cancelled
CI / cargo-toml-fmt-check (push) Has been cancelled
CI / cargo-test-lib-std (push) Has been cancelled
CI / forc-run-benchmarks (push) Has been cancelled
CI / forc-unit-tests (push) Has been cancelled
CI / forc-pkg-fuels-deps-check (push) Has been cancelled
github pages / deploy (push) Has been cancelled
CI / cargo-unused-deps-check (push) Has been cancelled
CI / pre-publish-check (push) Has been cancelled
CI / Build and test various forc tools (push) Has been cancelled
CI / verifications-complete (push) Has been cancelled
CI / notify-slack-on-failure (push) Has been cancelled
CI / publish (push) Has been cancelled
CI / cargo-run-e2e-test (push) Has been cancelled
CI / cargo-run-e2e-test-release (push) Has been cancelled
CI / Build and upload forc binaries to release (push) Has been cancelled
CI / publish-sway-lib-std (push) Has been cancelled
Some checks failed
CI / cargo-fmt-check (push) Has been cancelled
Codspeed Benchmarks / benchmarks (push) Has been cancelled
CI / check-dependency-version-formats (push) Has been cancelled
CI / check-forc-manifest-version (push) Has been cancelled
CI / forc-fmt-check-sway-lib-std (push) Has been cancelled
CI / get-fuel-core-version (push) Has been cancelled
CI / build-sway-lib-std (push) Has been cancelled
CI / build-sway-examples (push) Has been cancelled
CI / build-reference-examples (push) Has been cancelled
CI / forc-fmt-check-sway-examples (push) Has been cancelled
CI / forc-fmt-check-panic (push) Has been cancelled
CI / check-sdk-harness-test-suite-compatibility (push) Has been cancelled
CI / build-mdbook (push) Has been cancelled
CI / build-forc-doc-sway-lib-std (push) Has been cancelled
CI / build-forc-test-project (push) Has been cancelled
CI / cargo-build-workspace (push) Has been cancelled
CI / cargo-clippy (push) Has been cancelled
CI / cargo-toml-fmt-check (push) Has been cancelled
CI / cargo-test-lib-std (push) Has been cancelled
CI / forc-run-benchmarks (push) Has been cancelled
CI / forc-unit-tests (push) Has been cancelled
CI / forc-pkg-fuels-deps-check (push) Has been cancelled
github pages / deploy (push) Has been cancelled
CI / cargo-unused-deps-check (push) Has been cancelled
CI / pre-publish-check (push) Has been cancelled
CI / Build and test various forc tools (push) Has been cancelled
CI / verifications-complete (push) Has been cancelled
CI / notify-slack-on-failure (push) Has been cancelled
CI / publish (push) Has been cancelled
CI / cargo-run-e2e-test (push) Has been cancelled
CI / cargo-run-e2e-test-release (push) Has been cancelled
CI / Build and upload forc binaries to release (push) Has been cancelled
CI / publish-sway-lib-std (push) Has been cancelled
## Description This is an optimisation of contract calls on top of https://github.com/FuelLabs/sway/pull/7440. The old version would pass a string with the method name and encode it, which is `<LEN><BYTES`. Now the compiler generates these bytes directly, avoiding encoding the method name in the first place. For that this PR creats the concept of `Literal::Binary` that does not exist in the language, yet. Would be something like `b""` in Rust. ## Improvements | Test | Before | After | Percentage | |------|--------|-------|------------| | should_pass/empty_fields_in_storage_struct (test.toml)::test_read_write_bytes | 19298 | 17533 | 9.15% | | should_pass/empty_fields_in_storage_struct (test.toml)::test_read_write_map | 14971 | 13986 | 6.58% | | should_pass/empty_fields_in_storage_struct (test.toml)::test_read_write_vec | 31061 | 29288 | 5.71% | | should_pass/language/associated_const_abi (test.toml)::test | 8789 | 7817 | 11.06% | | should_pass/language/associated_const_abi_multiple (test.toml)::test | 2421 | 2097 | 13.38% | | should_pass/language/associated_const_in_decls_of_other_constants (test.toml)::test | 870 | 709 | 18.51% | | should_pass/language/contract_caller_dynamic_address (test.toml) | 540 | 379 | 29.81% | | should_pass/language/contract_ret_intrinsic (test.toml)::test | 2133 | 1809 | 15.19% | | should_pass/language/pusha_popa_multiple_defreg (test.toml)::incorrect_pusha_popa | 819 | 624 | 23.81% | | should_pass/language/raw_identifiers (test.error_type.toml)::test | 1236 | 1075 | 13.03% | | should_pass/language/raw_identifiers (test.toml)::test | 1236 | 1075 | 13.03% | | should_pass/language/references/mutability_of_references_memcpy_bug (test.toml)::test | 1364 | 1203 | 11.80% | | should_pass/language/slice/slice_contract (test.toml)::test_success | 1338 | 1145 | 14.42% | | should_pass/language/string_slice/string_slice_contract (test.toml)::test_success | 1515 | 1322 | 12.74% | | should_pass/stdlib/storage_vec_insert (test.toml)::test_test_function | 3992 | 3831 | 4.03% | | should_pass/storage_element_key_modification (test.toml)::test_storage_key_address | 1300 | 1138 | 12.46% | | should_pass/storage_element_key_modification (test.toml)::test_storage_key_modification | 919 | 757 | 17.63% | | should_pass/storage_slot_key_calculation (test.toml)::test | 3140 | 2979 | 5.13% | | should_pass/superabi_contract_calls (test.toml)::tests | 2136 | 1812 | 15.17% | | should_pass/superabi_supertrait_same_methods (test.toml)::tests | 1097 | 936 | 14.68% | | should_pass/test_abis/abi_impl_methods_callable (test.toml)::tests | 933 | 772 | 17.26% | | should_pass/test_abis/contract_abi-auto_impl (test.toml)::tests | 933 | 772 | 17.26% | | should_pass/unit_tests/aggr_indexing (test.toml)::test1 | 6007 | 5443 | 9.39% | | should_pass/unit_tests/contract-multi-contract-calls (test.toml)::test_contract_2_call | 966 | 804 | 16.77% | | should_pass/unit_tests/contract-multi-contract-calls (test.toml)::test_contract_call | 969 | 807 | 16.72% | | should_pass/unit_tests/contract-multi-contract-calls (test.toml)::test_contract_multi_call | 1916 | 1592 | 16.91% | | should_pass/unit_tests/contract_multi_test (test.toml)::test_fail | 970 | 808 | 16.70% | | should_pass/unit_tests/contract_multi_test (test.toml)::test_success | 968 | 806 | 16.74% | | should_pass/unit_tests/script-contract-calls (test.toml)::test_contract_call | 931 | 736 | 20.95% | | should_pass/unit_tests/workspace_test (test.toml)::test_fail | 970 | 808 | 16.70% | | should_pass/unit_tests/workspace_test (test.toml)::test_success | 969 | 807 | 16.72% | ## Failed Test Only now I realized that the test for array of size zero `[u64; 0]` is not working. As this is not a useful case, I will solve it in another PR. ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers.
This commit is contained in:
parent
fc2aed7934
commit
00b9d02477
14 changed files with 189 additions and 128 deletions
|
|
@ -32,6 +32,7 @@ pub(super) fn convert_literal_to_value(context: &mut Context, ast_literal: &Lite
|
|||
Literal::String(s) => ConstantContent::get_string(context, s.as_str().as_bytes().to_vec()),
|
||||
Literal::Boolean(b) => ConstantContent::get_bool(context, *b),
|
||||
Literal::B256(bs) => ConstantContent::get_b256(context, *bs),
|
||||
Literal::Binary(bytes) => ConstantContent::get_untyped_slice(context, bytes.clone()),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -50,6 +51,7 @@ pub(super) fn convert_literal_to_constant(
|
|||
Literal::String(s) => ConstantContent::new_string(context, s.as_str().as_bytes().to_vec()),
|
||||
Literal::Boolean(b) => ConstantContent::new_bool(context, *b),
|
||||
Literal::B256(bs) => ConstantContent::new_b256(context, *bs),
|
||||
Literal::Binary(bytes) => ConstantContent::new_untyped_slice(context, bytes.clone()),
|
||||
};
|
||||
Constant::unique(context, c)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -457,12 +457,13 @@ impl<'a> FnCompiler<'a> {
|
|||
))
|
||||
}
|
||||
|
||||
fn compile_string_slice(
|
||||
// Can be used for raw untyped slice and string slice
|
||||
fn compile_slice(
|
||||
&mut self,
|
||||
context: &mut Context,
|
||||
span_md_idx: Option<MetadataIndex>,
|
||||
string_data: Value,
|
||||
string_len: u64,
|
||||
slice_ptr: Value,
|
||||
slice_len: u64,
|
||||
) -> Result<TerminatorValue, CompileError> {
|
||||
let int_ty = Type::get_uint64(context);
|
||||
let ptr_ty = Type::get_ptr(context);
|
||||
|
|
@ -471,9 +472,9 @@ impl<'a> FnCompiler<'a> {
|
|||
let ptr_val = self
|
||||
.current_block
|
||||
.append(context)
|
||||
.cast_ptr(string_data, ptr_ty)
|
||||
.cast_ptr(slice_ptr, ptr_ty)
|
||||
.add_metadatum(context, span_md_idx);
|
||||
let len_val = ConstantContent::get_uint(context, 64, string_len);
|
||||
let len_val = ConstantContent::get_uint(context, 64, slice_len);
|
||||
|
||||
// a slice is a pointer and a length
|
||||
let field_types = vec![ptr_ty, int_ty];
|
||||
|
|
@ -569,7 +570,24 @@ impl<'a> FnCompiler<'a> {
|
|||
.append(context)
|
||||
.get_global(string_data_ptr);
|
||||
let string_len = s.as_str().len() as u64;
|
||||
self.compile_string_slice(context, span_md_idx, string_ptr, string_len)
|
||||
self.compile_slice(context, span_md_idx, string_ptr, string_len)
|
||||
}
|
||||
ty::TyExpressionVariant::Literal(Literal::Binary(bytes)) => {
|
||||
let data = ConstantContent::get_untyped_slice(context, bytes.clone())
|
||||
.get_constant(context)
|
||||
.unwrap();
|
||||
let data_ptr = self.module.new_unique_global_var(
|
||||
context,
|
||||
"__const_global".into(),
|
||||
data.get_content(context).ty,
|
||||
Some(*data),
|
||||
false,
|
||||
);
|
||||
|
||||
let slice_ptr = self.current_block.append(context).get_global(data_ptr);
|
||||
let slice_len = bytes.len() as u64;
|
||||
|
||||
self.compile_slice(context, span_md_idx, slice_ptr, slice_len)
|
||||
}
|
||||
ty::TyExpressionVariant::Literal(Literal::Numeric(n)) => {
|
||||
let implied_lit = match &*self.engines.te().get(ast_expr.return_type) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ pub enum Literal {
|
|||
Numeric(u64),
|
||||
Boolean(bool),
|
||||
B256([u8; 32]),
|
||||
Binary(Vec<u8>),
|
||||
}
|
||||
|
||||
impl Literal {
|
||||
|
|
@ -74,6 +75,10 @@ impl Hash for Literal {
|
|||
state.write_u8(8);
|
||||
x.hash(state);
|
||||
}
|
||||
Binary(x) => {
|
||||
state.write_u8(9);
|
||||
x.hash(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -90,6 +95,7 @@ impl PartialEq for Literal {
|
|||
(Self::Numeric(l0), Self::Numeric(r0)) => l0 == r0,
|
||||
(Self::Boolean(l0), Self::Boolean(r0)) => l0 == r0,
|
||||
(Self::B256(l0), Self::B256(r0)) => l0 == r0,
|
||||
(Self::Binary(l0), Self::Binary(r0)) => l0 == r0,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
@ -111,6 +117,11 @@ impl fmt::Display for Literal {
|
|||
.map(|x| x.to_string())
|
||||
.collect::<Vec<_>>()
|
||||
.join(", "),
|
||||
Literal::Binary(content) => content
|
||||
.iter()
|
||||
.map(|x| x.to_string())
|
||||
.collect::<Vec<_>>()
|
||||
.join(", "),
|
||||
};
|
||||
write!(f, "{s}")
|
||||
}
|
||||
|
|
@ -154,6 +165,7 @@ impl Literal {
|
|||
Literal::U256(_) => TypeInfo::UnsignedInteger(IntegerBits::V256),
|
||||
Literal::Boolean(_) => TypeInfo::Boolean,
|
||||
Literal::B256(_) => TypeInfo::B256,
|
||||
Literal::Binary(_) => TypeInfo::RawUntypedSlice,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,6 +180,9 @@ impl Pattern {
|
|||
Literal::Boolean(b) => Pattern::Boolean(b),
|
||||
Literal::Numeric(x) => Pattern::Numeric(Range::from_single(x)),
|
||||
Literal::String(s) => Pattern::String(s.as_str().to_string()),
|
||||
Literal::Binary(_) => {
|
||||
unreachable!("literals cannot be expressed in the language yet")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -635,6 +635,7 @@ impl ty::TyExpression {
|
|||
Literal::U256(_) => type_engine.id_of_u256(),
|
||||
Literal::Boolean(_) => type_engine.id_of_bool(),
|
||||
Literal::B256(_) => type_engine.id_of_b256(),
|
||||
Literal::Binary(_) => type_engine.id_of_raw_slice(),
|
||||
};
|
||||
ty::TyExpression {
|
||||
expression: ty::TyExpressionVariant::Literal(lit),
|
||||
|
|
|
|||
|
|
@ -533,10 +533,17 @@ pub(crate) fn type_check_method_application(
|
|||
}
|
||||
}
|
||||
|
||||
fn string_slice_literal(ident: &BaseIdent) -> Expression {
|
||||
fn method_name_literal(method_name: &BaseIdent) -> Expression {
|
||||
let method_name_str = method_name.as_str();
|
||||
let len_bytes = (method_name_str.len() as u64).to_be_bytes();
|
||||
|
||||
let mut blob = Vec::with_capacity(len_bytes.len() + method_name_str.len());
|
||||
blob.extend(len_bytes);
|
||||
blob.extend(method_name_str.as_bytes());
|
||||
|
||||
Expression {
|
||||
kind: ExpressionKind::Literal(Literal::String(ident.span())),
|
||||
span: ident.span(),
|
||||
kind: ExpressionKind::Literal(Literal::Binary(blob)),
|
||||
span: method_name.span(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -581,7 +588,7 @@ pub(crate) fn type_check_method_application(
|
|||
&mut ctx,
|
||||
span,
|
||||
method.return_type.type_id,
|
||||
string_slice_literal(&method.name),
|
||||
method_name_literal(&method.name),
|
||||
old_arguments.first().cloned().unwrap(),
|
||||
args,
|
||||
arguments.iter().map(|x| x.1.return_type).collect(),
|
||||
|
|
|
|||
|
|
@ -120,6 +120,13 @@ impl ConstantContent {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new_untyped_slice(context: &mut Context, bytes: Vec<u8>) -> Self {
|
||||
ConstantContent {
|
||||
ty: Type::new_untyped_slice(context),
|
||||
value: ConstantValue::RawUntypedSlice(bytes),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_array(context: &mut Context, elm_ty: Type, elems: Vec<ConstantContent>) -> Self {
|
||||
ConstantContent {
|
||||
ty: Type::new_array(context, elm_ty, elems.len() as u64),
|
||||
|
|
@ -181,6 +188,12 @@ impl ConstantContent {
|
|||
Value::new_constant(context, new_const)
|
||||
}
|
||||
|
||||
pub fn get_untyped_slice(context: &mut Context, value: Vec<u8>) -> Value {
|
||||
let new_const_contents = ConstantContent::new_untyped_slice(context, value);
|
||||
let new_const = Constant::unique(context, new_const_contents);
|
||||
Value::new_constant(context, new_const)
|
||||
}
|
||||
|
||||
/// `value` must be created as an array constant first, using [`Constant::new_array()`].
|
||||
pub fn get_array(context: &mut Context, value: ConstantContent) -> Value {
|
||||
assert!(value.ty.is_array(context));
|
||||
|
|
|
|||
|
|
@ -140,6 +140,10 @@ impl Type {
|
|||
Self::get_type(context, &TypeContent::Pointer).expect("create_basic_types not called")
|
||||
}
|
||||
|
||||
pub fn new_untyped_slice(context: &mut Context) -> Type {
|
||||
Self::get_or_create_unique_type(context, TypeContent::Slice)
|
||||
}
|
||||
|
||||
/// Get string type
|
||||
pub fn new_string_array(context: &mut Context, len: u64) -> Type {
|
||||
Self::get_or_create_unique_type(context, TypeContent::StringArray(len))
|
||||
|
|
|
|||
|
|
@ -5347,7 +5347,7 @@ use ::ops::*;
|
|||
|
||||
pub fn contract_call<T, TArgs>(
|
||||
contract_id: b256,
|
||||
method_name: str,
|
||||
method_name: raw_slice,
|
||||
args: TArgs,
|
||||
coins: u64,
|
||||
asset_id: b256,
|
||||
|
|
@ -5357,11 +5357,10 @@ where
|
|||
T: AbiDecode,
|
||||
TArgs: AbiEncode,
|
||||
{
|
||||
let first_parameter = encode(method_name);
|
||||
let second_parameter = encode(args);
|
||||
let params = (
|
||||
contract_id,
|
||||
asm(a: first_parameter.ptr()) {
|
||||
asm(a: method_name.ptr()) {
|
||||
a: u64
|
||||
},
|
||||
asm(a: second_parameter.ptr()) {
|
||||
|
|
|
|||
|
|
@ -1252,5 +1252,6 @@ fn literal_to_symbol_kind(value: &Literal) -> SymbolKind {
|
|||
Literal::String(..) => SymbolKind::StringLiteral,
|
||||
Literal::B256(..) => SymbolKind::ByteLiteral,
|
||||
Literal::Boolean(..) => SymbolKind::BoolLiteral,
|
||||
Literal::Binary(_) => unreachable!("literals cannot be expressed in the language yet"),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ fn literal_to_string(literal: &Literal) -> String {
|
|||
Literal::String(len) => format!("str[{}]", len.as_str().len()),
|
||||
Literal::Boolean(_) => "bool".into(),
|
||||
Literal::B256(_) => "b256".into(),
|
||||
Literal::Binary(_) => unreachable!("literals cannot be expressed in the language yet"),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,17 +8,17 @@ output:
|
|||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling library panicking_lib (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib)
|
||||
Compiling contract panicking_contract (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract)
|
||||
Finished debug [unoptimized + fuel] target(s) [8.512 KB] in ???
|
||||
Finished debug [unoptimized + fuel] target(s) [8.88 KB] in ???
|
||||
Running 12 tests, filtered 0 tests
|
||||
|
||||
tested -- panicking_contract
|
||||
|
||||
test test_panicking_in_contract_self_impl ... ok (???, 1245 gas)
|
||||
test test_panicking_in_contract_self_impl ... ok (???, 1032 gas)
|
||||
revert code: 8000000000000001
|
||||
├─ panic message: panicking in contract self impl
|
||||
├─ panicked: in <Contract as PanickingContractAbi>::panicking_in_contract_self_impl
|
||||
│ └─ at panicking_contract@1.2.3, src/main.sw:22:9
|
||||
test test_directly_panicking_method ... ok (???, 1774 gas)
|
||||
test test_directly_panicking_method ... ok (???, 1561 gas)
|
||||
revert code: 8080000000000002
|
||||
├─ panic message: Error C.
|
||||
├─ panic value: C(true)
|
||||
|
|
@ -26,7 +26,7 @@ tested -- panicking_contract
|
|||
│ └─ at panicking_contract@1.2.3, src/main.sw:28:9
|
||||
decoded log values:
|
||||
C(true), log rb: 5503570629422409978
|
||||
test test_nested_panic_inlined ... ok (???, 3470 gas)
|
||||
test test_nested_panic_inlined ... ok (???, 3257 gas)
|
||||
revert code: 830000000540a013
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }])
|
||||
|
|
@ -38,7 +38,7 @@ C(true), log rb: 5503570629422409978
|
|||
└─ at panicking_contract@1.2.3, src/main.sw:32:9
|
||||
decoded log values:
|
||||
E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978
|
||||
test test_nested_panic_inlined_same_revert_code ... ok (???, 3470 gas)
|
||||
test test_nested_panic_inlined_same_revert_code ... ok (???, 3257 gas)
|
||||
revert code: 830000000540a013
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }])
|
||||
|
|
@ -50,7 +50,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString
|
|||
└─ at panicking_contract@1.2.3, src/main.sw:32:9
|
||||
decoded log values:
|
||||
E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978
|
||||
test test_nested_panic_non_inlined ... ok (???, 3798 gas)
|
||||
test test_nested_panic_non_inlined ... ok (???, 3585 gas)
|
||||
revert code: 838000000680c818
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }])
|
||||
|
|
@ -62,7 +62,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString
|
|||
└─ at panicking_contract@1.2.3, src/main.sw:40:9
|
||||
decoded log values:
|
||||
E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978
|
||||
test test_nested_panic_non_inlined_same_revert_code ... ok (???, 3798 gas)
|
||||
test test_nested_panic_non_inlined_same_revert_code ... ok (???, 3585 gas)
|
||||
revert code: 838000000680c818
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }])
|
||||
|
|
@ -74,7 +74,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d
|
|||
└─ at panicking_contract@1.2.3, src/main.sw:40:9
|
||||
decoded log values:
|
||||
E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978
|
||||
test test_generic_panic_with_unit ... ok (???, 2469 gas)
|
||||
test test_generic_panic_with_unit ... ok (???, 2256 gas)
|
||||
revert code: 828000000000800f
|
||||
├─ panic value: ()
|
||||
├─ panicked: in panicking_lib::generic_panic
|
||||
|
|
@ -83,7 +83,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d
|
|||
└─ at panicking_contract@1.2.3, src/main.sw:48:9
|
||||
decoded log values:
|
||||
(), log rb: 3330666440490685604
|
||||
test test_generic_panic_with_unit_same_revert_code ... ok (???, 2469 gas)
|
||||
test test_generic_panic_with_unit_same_revert_code ... ok (???, 2256 gas)
|
||||
revert code: 828000000000800f
|
||||
├─ panic value: ()
|
||||
├─ panicked: in panicking_lib::generic_panic
|
||||
|
|
@ -92,7 +92,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d
|
|||
└─ at panicking_contract@1.2.3, src/main.sw:48:9
|
||||
decoded log values:
|
||||
(), log rb: 3330666440490685604
|
||||
test test_generic_panic_with_str ... ok (???, 2421 gas)
|
||||
test test_generic_panic_with_str ... ok (???, 2208 gas)
|
||||
revert code: 818000000000700d
|
||||
├─ panic message: generic panic with string
|
||||
├─ panicked: in panicking_lib::generic_panic
|
||||
|
|
@ -101,7 +101,7 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d
|
|||
└─ at panicking_contract@1.2.3, src/main.sw:56:9
|
||||
decoded log values:
|
||||
AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218
|
||||
test test_generic_panic_with_different_str_same_revert_code ... ok (???, 1962 gas)
|
||||
test test_generic_panic_with_different_str_same_revert_code ... ok (???, 1749 gas)
|
||||
revert code: 8180000000004007
|
||||
├─ panic message: generic panic with different string
|
||||
├─ panicked: in panicking_lib::generic_panic
|
||||
|
|
@ -110,7 +110,7 @@ AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218
|
|||
└─ at panicking_contract@1.2.3, src/main.sw:60:9
|
||||
decoded log values:
|
||||
AsciiString { data: "generic panic with different string" }, log rb: 10098701174489624218
|
||||
test test_generic_panic_with_error_type_enum ... ok (???, 2146 gas)
|
||||
test test_generic_panic_with_error_type_enum ... ok (???, 1933 gas)
|
||||
revert code: 8200000000005009
|
||||
├─ panic message: Error A.
|
||||
├─ panic value: A
|
||||
|
|
@ -120,7 +120,7 @@ AsciiString { data: "generic panic with different string" }, log rb: 10098701174
|
|||
└─ at panicking_contract@1.2.3, src/main.sw:64:9
|
||||
decoded log values:
|
||||
A, log rb: 5503570629422409978
|
||||
test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 2378 gas)
|
||||
test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 2165 gas)
|
||||
revert code: 820000000000600b
|
||||
├─ panic message: Error B.
|
||||
├─ panic value: B(42)
|
||||
|
|
@ -142,17 +142,17 @@ output:
|
|||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling library panicking_lib (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_lib)
|
||||
Compiling contract panicking_contract (test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract)
|
||||
Finished release [optimized + fuel] target(s) [7.024 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [7.4 KB] in ???
|
||||
Running 12 tests, filtered 0 tests
|
||||
|
||||
tested -- panicking_contract
|
||||
|
||||
test test_panicking_in_contract_self_impl ... ok (???, 869 gas)
|
||||
test test_panicking_in_contract_self_impl ... ok (???, 673 gas)
|
||||
revert code: 8000000000000000
|
||||
├─ panic message: panicking in contract self impl
|
||||
└─ panicked: in <Contract as PanickingContractAbi>::panicking_in_contract_self_impl
|
||||
└─ at panicking_contract@1.2.3, src/main.sw:22:9
|
||||
test test_directly_panicking_method ... ok (???, 1291 gas)
|
||||
test test_directly_panicking_method ... ok (???, 1095 gas)
|
||||
revert code: 8080000000000000
|
||||
├─ panic message: Error C.
|
||||
├─ panic value: C(true)
|
||||
|
|
@ -160,7 +160,7 @@ tested -- panicking_contract
|
|||
└─ at panicking_contract@1.2.3, src/main.sw:28:9
|
||||
decoded log values:
|
||||
C(true), log rb: 5503570629422409978
|
||||
test test_nested_panic_inlined ... ok (???, 2537 gas)
|
||||
test test_nested_panic_inlined ... ok (???, 2341 gas)
|
||||
revert code: 8300000000000000
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }])
|
||||
|
|
@ -168,7 +168,7 @@ C(true), log rb: 5503570629422409978
|
|||
└─ at panicking_lib, src/lib.sw:35:5
|
||||
decoded log values:
|
||||
E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978
|
||||
test test_nested_panic_inlined_same_revert_code ... ok (???, 2537 gas)
|
||||
test test_nested_panic_inlined_same_revert_code ... ok (???, 2341 gas)
|
||||
revert code: 8300000000000000
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }])
|
||||
|
|
@ -176,7 +176,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString
|
|||
└─ at panicking_lib, src/lib.sw:35:5
|
||||
decoded log values:
|
||||
E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978
|
||||
test test_nested_panic_non_inlined ... ok (???, 2767 gas)
|
||||
test test_nested_panic_non_inlined ... ok (???, 2571 gas)
|
||||
revert code: 8380000000000000
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }])
|
||||
|
|
@ -184,7 +184,7 @@ E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString
|
|||
└─ at panicking_lib, src/lib.sw:41:9
|
||||
decoded log values:
|
||||
E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978
|
||||
test test_nested_panic_non_inlined_same_revert_code ... ok (???, 2767 gas)
|
||||
test test_nested_panic_non_inlined_same_revert_code ... ok (???, 2571 gas)
|
||||
revert code: 8380000000000000
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }])
|
||||
|
|
@ -192,35 +192,35 @@ E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { d
|
|||
└─ at panicking_lib, src/lib.sw:41:9
|
||||
decoded log values:
|
||||
E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978
|
||||
test test_generic_panic_with_unit ... ok (???, 1739 gas)
|
||||
test test_generic_panic_with_unit ... ok (???, 1543 gas)
|
||||
revert code: 8280000000000000
|
||||
├─ panic value: ()
|
||||
└─ panicked: in panicking_lib::generic_panic
|
||||
└─ at panicking_lib, src/lib.sw:74:5
|
||||
decoded log values:
|
||||
(), log rb: 3330666440490685604
|
||||
test test_generic_panic_with_unit_same_revert_code ... ok (???, 1739 gas)
|
||||
test test_generic_panic_with_unit_same_revert_code ... ok (???, 1543 gas)
|
||||
revert code: 8280000000000000
|
||||
├─ panic value: ()
|
||||
└─ panicked: in panicking_lib::generic_panic
|
||||
└─ at panicking_lib, src/lib.sw:74:5
|
||||
decoded log values:
|
||||
(), log rb: 3330666440490685604
|
||||
test test_generic_panic_with_str ... ok (???, 1743 gas)
|
||||
test test_generic_panic_with_str ... ok (???, 1547 gas)
|
||||
revert code: 8180000000000000
|
||||
├─ panic message: generic panic with string
|
||||
└─ panicked: in panicking_lib::generic_panic
|
||||
└─ at panicking_lib, src/lib.sw:74:5
|
||||
decoded log values:
|
||||
AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218
|
||||
test test_generic_panic_with_different_str_same_revert_code ... ok (???, 1425 gas)
|
||||
test test_generic_panic_with_different_str_same_revert_code ... ok (???, 1229 gas)
|
||||
revert code: 8180000000000000
|
||||
├─ panic message: generic panic with different string
|
||||
└─ panicked: in panicking_lib::generic_panic
|
||||
└─ at panicking_lib, src/lib.sw:74:5
|
||||
decoded log values:
|
||||
AsciiString { data: "generic panic with different string" }, log rb: 10098701174489624218
|
||||
test test_generic_panic_with_error_type_enum ... ok (???, 1546 gas)
|
||||
test test_generic_panic_with_error_type_enum ... ok (???, 1350 gas)
|
||||
revert code: 8200000000000000
|
||||
├─ panic message: Error A.
|
||||
├─ panic value: A
|
||||
|
|
@ -228,7 +228,7 @@ AsciiString { data: "generic panic with different string" }, log rb: 10098701174
|
|||
└─ at panicking_lib, src/lib.sw:74:5
|
||||
decoded log values:
|
||||
A, log rb: 5503570629422409978
|
||||
test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 1709 gas)
|
||||
test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 1513 gas)
|
||||
revert code: 8200000000000000
|
||||
├─ panic message: Error B.
|
||||
├─ panic value: B(42)
|
||||
|
|
|
|||
|
|
@ -7,40 +7,40 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [36.248 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [35.272 KB] in ???
|
||||
Running 29 tests, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test cost_of_in_bool ... ok (???, 2279 gas)
|
||||
test cost_of_in_u8 ... ok (???, 4526 gas)
|
||||
test cost_of_in_u16 ... ok (???, 4141 gas)
|
||||
test cost_of_in_u32 ... ok (???, 4582 gas)
|
||||
test cost_of_in_u64 ... ok (???, 4589 gas)
|
||||
test cost_of_in_u256 ... ok (???, 4433 gas)
|
||||
test cost_of_in_b256 ... ok (???, 2147 gas)
|
||||
test cost_of_in_str_0 ... ok (???, 2697 gas)
|
||||
test cost_of_in_str_1 ... ok (???, 2998 gas)
|
||||
test cost_of_in_str_8 ... ok (???, 3421 gas)
|
||||
test cost_of_in_str_16 ... ok (???, 3030 gas)
|
||||
test cost_of_in_str_32 ... ok (???, 3227 gas)
|
||||
test cost_of_in_array_0 ... FAILED (???, 1285 gas)
|
||||
test cost_of_in_array_1 ... ok (???, 1779 gas)
|
||||
test cost_of_in_array_8 ... ok (???, 4382 gas)
|
||||
test cost_of_in_array_16 ... ok (???, 4753 gas)
|
||||
test cost_of_in_array_32 ... ok (???, 8079 gas)
|
||||
test cost_of_in_array_64 ... ok (???, 14545 gas)
|
||||
test cost_of_in_tuple_0 ... ok (???, 3479 gas)
|
||||
test cost_of_in_tuple_1 ... ok (???, 4050 gas)
|
||||
test cost_of_in_tuple_2 ... ok (???, 4418 gas)
|
||||
test cost_of_in_tuple_3 ... ok (???, 4761 gas)
|
||||
test cost_of_in_tuple_4 ... ok (???, 5126 gas)
|
||||
test in_struct_u64 ... ok (???, 3293 gas)
|
||||
test in_struct_u64_u64 ... ok (???, 3554 gas)
|
||||
test in_struct_u64_u64_u64 ... ok (???, 3813 gas)
|
||||
test in_enum_u64 ... ok (???, 2843 gas)
|
||||
test in_enum_u64_u64 ... ok (???, 2718 gas)
|
||||
test in_enum_u64_u64_u64 ... ok (???, 2830 gas)
|
||||
test cost_of_in_bool ... ok (???, 2082 gas)
|
||||
test cost_of_in_u8 ... ok (???, 4331 gas)
|
||||
test cost_of_in_u16 ... ok (???, 3948 gas)
|
||||
test cost_of_in_u32 ... ok (???, 4389 gas)
|
||||
test cost_of_in_u64 ... ok (???, 4397 gas)
|
||||
test cost_of_in_u256 ... ok (???, 4240 gas)
|
||||
test cost_of_in_b256 ... ok (???, 1954 gas)
|
||||
test cost_of_in_str_0 ... ok (???, 2505 gas)
|
||||
test cost_of_in_str_1 ... ok (???, 2806 gas)
|
||||
test cost_of_in_str_8 ... ok (???, 3229 gas)
|
||||
test cost_of_in_str_16 ... ok (???, 2837 gas)
|
||||
test cost_of_in_str_32 ... ok (???, 3035 gas)
|
||||
test cost_of_in_array_0 ... FAILED (???, 1095 gas)
|
||||
test cost_of_in_array_1 ... ok (???, 1589 gas)
|
||||
test cost_of_in_array_8 ... ok (???, 4192 gas)
|
||||
test cost_of_in_array_16 ... ok (???, 4563 gas)
|
||||
test cost_of_in_array_32 ... ok (???, 7889 gas)
|
||||
test cost_of_in_array_64 ... ok (???, 14352 gas)
|
||||
test cost_of_in_tuple_0 ... ok (???, 3289 gas)
|
||||
test cost_of_in_tuple_1 ... ok (???, 3860 gas)
|
||||
test cost_of_in_tuple_2 ... ok (???, 4228 gas)
|
||||
test cost_of_in_tuple_3 ... ok (???, 4571 gas)
|
||||
test cost_of_in_tuple_4 ... ok (???, 4935 gas)
|
||||
test in_struct_u64 ... ok (???, 3103 gas)
|
||||
test in_struct_u64_u64 ... ok (???, 3364 gas)
|
||||
test in_struct_u64_u64_u64 ... ok (???, 3623 gas)
|
||||
test in_enum_u64 ... ok (???, 2653 gas)
|
||||
test in_enum_u64_u64 ... ok (???, 2528 gas)
|
||||
test in_enum_u64_u64_u64 ... ok (???, 2640 gas)
|
||||
|
||||
failures:
|
||||
test cost_of_in_array_0, "test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/src/main.sw":347
|
||||
|
|
@ -62,12 +62,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.016 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.768 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_array_0 ... FAILED (???, 956 gas)
|
||||
test isolated_cost_of_in_array_0 ... FAILED (???, 795 gas)
|
||||
|
||||
failures:
|
||||
test isolated_cost_of_in_array_0, "test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/src/main.sw":175
|
||||
|
|
@ -89,12 +89,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.192 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.944 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_array_1 ... ok (???, 1185 gas)
|
||||
test isolated_cost_of_in_array_1 ... ok (???, 1025 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -109,12 +109,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.216 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.968 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_array_16 ... ok (???, 3266 gas)
|
||||
test isolated_cost_of_in_array_16 ... ok (???, 3105 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -129,12 +129,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.216 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.968 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_array_32 ... ok (???, 5471 gas)
|
||||
test isolated_cost_of_in_array_32 ... ok (???, 5311 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -149,12 +149,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.288 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [2.008 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_array_64 ... ok (???, 9914 gas)
|
||||
test isolated_cost_of_in_array_64 ... ok (???, 9745 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -169,12 +169,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.352 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [2.104 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_array_8 ... ok (???, 2728 gas)
|
||||
test isolated_cost_of_in_array_8 ... ok (???, 2568 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -189,12 +189,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.064 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.808 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_b256 ... ok (???, 1120 gas)
|
||||
test isolated_cost_of_in_b256 ... ok (???, 959 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -209,12 +209,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [1.952 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.696 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_bool ... ok (???, 1047 gas)
|
||||
test isolated_cost_of_in_bool ... ok (???, 886 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -229,12 +229,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.256 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [2.008 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test in_enum_u64 ... ok (???, 1333 gas)
|
||||
test in_enum_u64 ... ok (???, 1173 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -249,12 +249,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.408 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [2.16 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test in_enum_u64_u64 ... ok (???, 1347 gas)
|
||||
test in_enum_u64_u64 ... ok (???, 1187 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -269,12 +269,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.584 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [2.344 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test in_enum_u64_u64_u64 ... ok (???, 1350 gas)
|
||||
test in_enum_u64_u64_u64 ... ok (???, 1190 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -289,12 +289,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [1.984 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.728 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_str_0 ... ok (???, 1140 gas)
|
||||
test isolated_cost_of_in_str_0 ... ok (???, 980 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -309,12 +309,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.184 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.928 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_str_1 ... ok (???, 1237 gas)
|
||||
test isolated_cost_of_in_str_1 ... ok (???, 1076 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -329,12 +329,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.224 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.976 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_str_16 ... ok (???, 1241 gas)
|
||||
test isolated_cost_of_in_str_16 ... ok (???, 1080 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -349,12 +349,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.24 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.992 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_str_32 ... ok (???, 1242 gas)
|
||||
test isolated_cost_of_in_str_32 ... ok (???, 1082 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -369,12 +369,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.2 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.944 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_str_8 ... ok (???, 1241 gas)
|
||||
test isolated_cost_of_in_str_8 ... ok (???, 1080 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -389,12 +389,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.072 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.824 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test in_struct_u64 ... ok (???, 1113 gas)
|
||||
test in_struct_u64 ... ok (???, 953 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -409,12 +409,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.2 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.96 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test in_struct_u64_u64 ... ok (???, 1304 gas)
|
||||
test in_struct_u64_u64 ... ok (???, 1144 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -429,12 +429,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.272 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [2.032 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test in_struct_u64_u64_u64 ... ok (???, 1455 gas)
|
||||
test in_struct_u64_u64_u64 ... ok (???, 1294 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -449,12 +449,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [1.472 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.12 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_tuple_0 ... ok (???, 820 gas)
|
||||
test isolated_cost_of_in_tuple_0 ... ok (???, 626 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -469,12 +469,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.016 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.768 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_tuple_1 ... ok (???, 1090 gas)
|
||||
test isolated_cost_of_in_tuple_1 ... ok (???, 930 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -489,12 +489,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.192 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.944 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_tuple_2 ... ok (???, 1304 gas)
|
||||
test isolated_cost_of_in_tuple_2 ... ok (???, 1144 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -509,12 +509,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.264 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [2.016 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_tuple_3 ... ok (???, 1455 gas)
|
||||
test isolated_cost_of_in_tuple_3 ... ok (???, 1294 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -529,12 +529,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.328 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [2.08 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_tuple_4 ... ok (???, 1605 gas)
|
||||
test isolated_cost_of_in_tuple_4 ... ok (???, 1444 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -549,12 +549,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [1.976 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.72 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_u16 ... ok (???, 1117 gas)
|
||||
test isolated_cost_of_in_u16 ... ok (???, 956 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -569,12 +569,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.064 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.808 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_u256 ... ok (???, 1120 gas)
|
||||
test isolated_cost_of_in_u256 ... ok (???, 959 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -589,12 +589,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [2.088 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.832 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_u32 ... ok (???, 1243 gas)
|
||||
test isolated_cost_of_in_u32 ... ok (???, 1082 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -609,12 +609,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [1.88 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.624 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_u64 ... ok (???, 1025 gas)
|
||||
test isolated_cost_of_in_u64 ... ok (???, 864 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
@ -629,12 +629,12 @@ output:
|
|||
Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call
|
||||
Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core)
|
||||
Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call)
|
||||
Finished release [optimized + fuel] target(s) [1.92 KB] in ???
|
||||
Finished release [optimized + fuel] target(s) [1.664 KB] in ???
|
||||
Running 1 test, filtered 0 tests
|
||||
|
||||
tested -- const_of_contract_call
|
||||
|
||||
test isolated_cost_of_in_u8 ... ok (???, 1041 gas)
|
||||
test isolated_cost_of_in_u8 ... ok (???, 880 gas)
|
||||
|
||||
test result: OK. 1 passed; 0 failed; finished in ???
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ pub fn dynamic_contract_call(contract_id: b256) -> u64 {
|
|||
#[cfg(experimental_new_encoding = true)]
|
||||
pub fn dynamic_contract_call(contract_id: b256) -> u64 {
|
||||
contract_call::<u64, (u64, u64, u64)>(contract_id,
|
||||
"some_method_name",
|
||||
encode("some_method_name"),
|
||||
(1, 2, 3),
|
||||
0,
|
||||
0x0000000000000000000000000000000000000000000000000000000000000000,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue