Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/aptos-framework-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Install cargo-nextest
uses: taiki-e/install-action@nextest

- name: Setup SSH access
run: |
mkdir -p ~/.ssh
Expand All @@ -53,7 +56,7 @@ jobs:
run: cargo test --release -p aptos-framework -- --skip prover

- name: Run language e2e tests
run: RUST_MIN_STACK=104857600 cargo test run -p language-e2e-testsuite --no-fail-fast
run: RUST_MIN_STACK=104857600 cargo nextest run -p language-e2e-testsuite --no-fail-fast

- name: Run move e2e tests
run: RUST_MIN_STACK=104857600 cargo test run -p e2e-move-tests --no-fail-fast
run: RUST_MIN_STACK=104857600 cargo nextest run -p e2e-move-tests --no-fail-fast
3 changes: 0 additions & 3 deletions aptos-move/aptos-vm/src/aptos_vm_viewer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

// Copyright (c) 2024 Supra.
// SPDX-License-Identifier: Apache-2.0

Expand Down
3 changes: 0 additions & 3 deletions aptos-move/aptos-vm/src/automated_transaction_processor.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

// Copyright (c) 2024 Supra.
// SPDX-License-Identifier: Apache-2.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

// Copyright (c) 2025 Supra.
// SPDX-License-Identifier: Apache-2.0

Expand Down
7 changes: 4 additions & 3 deletions aptos-move/e2e-tests/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,9 @@ impl FakeExecutor {
/// Executes the transaction as a singleton block and applies the resulting write set to the
/// data store. Panics if execution fails
pub fn execute_and_apply_transaction(&mut self, transaction: Transaction) -> TransactionOutput {
let mut outputs = self.execute_transaction_block(vec![transaction]).unwrap();
let mut outputs = self.execute_transaction_block(vec![transaction.clone()]).unwrap();
assert_eq!(outputs.len(), 1, "transaction outputs size mismatch");
println!("transaction execution output: {:#?} : {:#?}", outputs, transaction);
let output = outputs.pop().unwrap();
match output.status() {
TransactionStatus::Keep(status) => {
Expand All @@ -522,8 +523,8 @@ impl FakeExecutor {
assert_eq!(
status,
&ExecutionStatus::Success,
"transaction failed with {:?}",
status
"transaction failed with {:?}, {:?}",
status, transaction
);
output
},
Expand Down
5 changes: 1 addition & 4 deletions aptos-move/e2e-testsuite/src/tests/automated_transactions.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

// Copyright (c) 2024 Supra.
// SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -106,7 +103,7 @@ fn check_automated_transaction_successful_execution() {
let payload =
aptos_framework_sdk_builder::supra_account_transfer(dest_account.address().clone(), 100);
let gas_price = 100;
let max_gas_amount = 100;
let max_gas_amount = 1000;
let automation_fee_cap = 100_000;

// Register automation task
Expand Down
17 changes: 10 additions & 7 deletions aptos-move/e2e-testsuite/src/tests/automation_registration.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

// Copyright (c) 2024 Supra.
// SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -51,6 +48,8 @@ const HAS_SENDER_ACTIVE_TASK_WITH_ID: &str =
"0x1::automation_registry::has_sender_active_task_with_id";
const GET_TASK_IDS: &str = "0x1::automation_registry::get_task_ids";

const MAX_GAS_AMOUNT_REGISTRATION: u64 = 500_000_000;

struct MultisigAccountData {
multisig_address: AccountAddress,
owners: Vec<AccountData>,
Expand Down Expand Up @@ -111,8 +110,8 @@ impl AutomationRegistrationTestContext {

fn create_multisig_account_data(executor: &mut FakeExecutor) -> MultisigAccountData {
// Prepare multisig_account for system task registration
let multisig_owner1 = executor.create_raw_account_data(1_000_000_000, 0);
let multisig_owner2 = executor.create_raw_account_data(1_000_000_000, 0);
let multisig_owner1 = executor.create_raw_account_data(1_000_000_000_000, 0);
let multisig_owner2 = executor.create_raw_account_data(1_000_000_000_000, 0);
executor.add_account_data(&multisig_owner1);
executor.add_account_data(&multisig_owner2);
let multisig_address = create_multisig_account_address(
Expand All @@ -129,7 +128,7 @@ impl AutomationRegistrationTestContext {
let account_create_txn = multisig_owner1
.account()
.transaction()
.max_gas_amount(1_000_000)
.max_gas_amount(5_000_000)
.gas_unit_price(100)
.payload(create_multisig_payload)
.sequence_number(0)
Expand All @@ -139,7 +138,7 @@ impl AutomationRegistrationTestContext {
let transfer_txn = multisig_owner1
.account()
.transaction()
.max_gas_amount(1000)
.max_gas_amount(5_000_000)
.payload(aptos_stdlib::supra_account_transfer(
multisig_address,
10_000_000,
Expand Down Expand Up @@ -233,6 +232,7 @@ impl AutomationRegistrationTestContext {
.payload(automation_txn)
.sequence_number(seq_num)
.gas_unit_price(1)
.max_gas_amount(MAX_GAS_AMOUNT_REGISTRATION)
.sign()
}

Expand Down Expand Up @@ -262,6 +262,7 @@ impl AutomationRegistrationTestContext {
.payload(automation_txn)
.sequence_number(seq_num)
.gas_unit_price(1)
.max_gas_amount(MAX_GAS_AMOUNT_REGISTRATION)
.sign()
}

Expand All @@ -286,6 +287,7 @@ impl AutomationRegistrationTestContext {
.payload(automation_txn)
.sequence_number(seq_num)
.gas_unit_price(1)
.max_gas_amount(MAX_GAS_AMOUNT_REGISTRATION)
.sign()
}

Expand All @@ -303,6 +305,7 @@ impl AutomationRegistrationTestContext {
))
.sequence_number(seq_num)
.gas_unit_price(1)
.max_gas_amount(MAX_GAS_AMOUNT_REGISTRATION)
.sign()
}

Expand Down
3 changes: 0 additions & 3 deletions aptos-move/e2e-testsuite/src/tests/vm_viewer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

// Copyright (c) 2024 Supra.
// SPDX-License-Identifier: Apache-2.0

Expand Down
29 changes: 29 additions & 0 deletions aptos-move/framework/aptos-stdlib/doc/any.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Function `pack`](#0x1_any_pack)
- [Function `unpack`](#0x1_any_unpack)
- [Function `type_name`](#0x1_any_type_name)
- [Function `is_empty`](#0x1_any_is_empty)
- [Specification](#@Specification_1)
- [Function `pack`](#@Specification_1_pack)
- [Function `unpack`](#@Specification_1_unpack)
Expand All @@ -22,6 +23,7 @@
<b>use</b> <a href="from_bcs.md#0x1_from_bcs">0x1::from_bcs</a>;
<b>use</b> <a href="../../move-stdlib/doc/string.md#0x1_string">0x1::string</a>;
<b>use</b> <a href="type_info.md#0x1_type_info">0x1::type_info</a>;
<b>use</b> <a href="../../move-stdlib/doc/vector.md#0x1_vector">0x1::vector</a>;
</code></pre>


Expand Down Expand Up @@ -191,6 +193,33 @@ Returns the type name of this Any



</details>

<a id="0x1_any_is_empty"></a>

## Function `is_empty`

Returns true if the BCS-encoded data payload is empty.
An Any value with an empty data vector cannot be decoded and should
be treated as invalid by callers.


<pre><code><b>public</b> <b>fun</b> <a href="any.md#0x1_any_is_empty">is_empty</a>(x: &<a href="any.md#0x1_any_Any">any::Any</a>): bool
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="any.md#0x1_any_is_empty">is_empty</a>(x: &<a href="any.md#0x1_any_Any">Any</a>): bool {
std::vector::is_empty(&x.data)
}
</code></pre>



</details>

<a id="@Specification_1"></a>
Expand Down
63 changes: 63 additions & 0 deletions aptos-move/framework/aptos-stdlib/doc/copyable_any.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
- [Struct `Any`](#0x1_copyable_any_Any)
- [Constants](#@Constants_0)
- [Function `pack`](#0x1_copyable_any_pack)
- [Function `new`](#0x1_copyable_any_new)
- [Function `unpack`](#0x1_copyable_any_unpack)
- [Function `type_name`](#0x1_copyable_any_type_name)
- [Function `is_empty`](#0x1_copyable_any_is_empty)
- [Specification](#@Specification_1)
- [Function `pack`](#@Specification_1_pack)
- [Function `unpack`](#@Specification_1_unpack)
Expand All @@ -21,6 +23,7 @@
<b>use</b> <a href="from_bcs.md#0x1_from_bcs">0x1::from_bcs</a>;
<b>use</b> <a href="../../move-stdlib/doc/string.md#0x1_string">0x1::string</a>;
<b>use</b> <a href="type_info.md#0x1_type_info">0x1::type_info</a>;
<b>use</b> <a href="../../move-stdlib/doc/vector.md#0x1_vector">0x1::vector</a>;
</code></pre>


Expand Down Expand Up @@ -101,6 +104,39 @@ also required from <code>T</code>.



</details>

<a id="0x1_copyable_any_new"></a>

## Function `new`

Construct an <code><a href="copyable_any.md#0x1_copyable_any_Any">Any</a></code> directly from a pre-known type-name string and
already-BCS-encoded data bytes. Use this only when the type name is
obtained from a trusted source (e.g. <code><a href="type_info.md#0x1_type_info_type_name">type_info::type_name</a>&lt;T&gt;()</code> or a
constant produced by the same) and the data bytes are the BCS encoding
of a value of that type. Prefer <code><a href="copyable_any.md#0x1_copyable_any_pack">pack</a>&lt;T&gt;</code> whenever the concrete type
is statically known at the call site, as it is safer and self-validating.

This constructor exists primarily for genesis and governance scripts that
receive pre-serialised values from the Rust layer.


<pre><code><b>public</b> <b>fun</b> <a href="copyable_any.md#0x1_copyable_any_new">new</a>(type_name: <a href="../../move-stdlib/doc/string.md#0x1_string_String">string::String</a>, data: <a href="../../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;): <a href="copyable_any.md#0x1_copyable_any_Any">copyable_any::Any</a>
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="copyable_any.md#0x1_copyable_any_new">new</a>(type_name: String, data: <a href="../../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;): <a href="copyable_any.md#0x1_copyable_any_Any">Any</a> {
<a href="copyable_any.md#0x1_copyable_any_Any">Any</a> { type_name, data }
}
</code></pre>



</details>

<a id="0x1_copyable_any_unpack"></a>
Expand Down Expand Up @@ -152,6 +188,33 @@ Returns the type name of this Any



</details>

<a id="0x1_copyable_any_is_empty"></a>

## Function `is_empty`

Returns true if the BCS-encoded data payload is empty.
An Any value with an empty data vector cannot be decoded and should
be treated as invalid by callers.


<pre><code><b>public</b> <b>fun</b> <a href="copyable_any.md#0x1_copyable_any_is_empty">is_empty</a>(x: &<a href="copyable_any.md#0x1_copyable_any_Any">copyable_any::Any</a>): bool
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="copyable_any.md#0x1_copyable_any_is_empty">is_empty</a>(x: &<a href="copyable_any.md#0x1_copyable_any_Any">Any</a>): bool {
std::vector::is_empty(&x.data)
}
</code></pre>



</details>

<a id="@Specification_1"></a>
Expand Down
7 changes: 7 additions & 0 deletions aptos-move/framework/aptos-stdlib/sources/any.move
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ module aptos_std::any {
&x.type_name
}

/// Returns true if the BCS-encoded data payload is empty.
/// An Any value with an empty data vector cannot be decoded and should
/// be treated as invalid by callers.
public fun is_empty(x: &Any): bool {
std::vector::is_empty(&x.data)
}

#[test_only]
struct S has store, drop { x: u64 }

Expand Down
20 changes: 20 additions & 0 deletions aptos-move/framework/aptos-stdlib/sources/copyable_any.move
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ module aptos_std::copyable_any {
}
}

/// Construct an `Any` directly from a pre-known type-name string and
/// already-BCS-encoded data bytes. Use this only when the type name is
/// obtained from a trusted source (e.g. `type_info::type_name<T>()` or a
/// constant produced by the same) and the data bytes are the BCS encoding
/// of a value of that type. Prefer `pack<T>` whenever the concrete type
/// is statically known at the call site, as it is safer and self-validating.
///
/// This constructor exists primarily for genesis and governance scripts that
/// receive pre-serialised values from the Rust layer.
public fun new(type_name: String, data: vector<u8>): Any {
Any { type_name, data }
}

/// Unpack a value from the `Any` representation. This aborts if the value has not the expected type `T`.
public fun unpack<T>(x: Any): T {
assert!(type_info::type_name<T>() == x.type_name, error::invalid_argument(ETYPE_MISMATCH));
Expand All @@ -34,6 +47,13 @@ module aptos_std::copyable_any {
&x.type_name
}

/// Returns true if the BCS-encoded data payload is empty.
/// An Any value with an empty data vector cannot be decoded and should
/// be treated as invalid by callers.
public fun is_empty(x: &Any): bool {
std::vector::is_empty(&x.data)
}

#[test_only]
struct S has store, drop, copy { x: u64 }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

// Copyright (c) 2025 Supra.
// SPDX-License-Identifier: Apache-2.0
use aptos_native_interface::{SafeNativeBuilder, SafeNativeContext, SafeNativeResult};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

// Copyright (c) 2024 Supra.

use crate::natives::cryptography::bulletproofs::abort_codes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

// Copyright (c) 2024 Supra.

use aptos_gas_schedule::gas_params::natives::aptos_framework::{
Expand Down
3 changes: 0 additions & 3 deletions aptos-move/framework/src/natives/cryptography/eth_trie.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

// Copyright (c) 2024 Supra.

use aptos_gas_schedule::gas_params::natives::aptos_framework::{
Expand Down
3 changes: 0 additions & 3 deletions aptos-move/framework/src/natives/rlp.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright (c) Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

// Copyright (c) 2024 Supra.

use aptos_gas_schedule::gas_params::natives::aptos_framework::{
Expand Down
Loading
Loading