Skip to content

Commit

Permalink
[framework] Remove experimental framework
Browse files Browse the repository at this point in the history
As there is no active development in this space and it conflicts a bit
with the direction we're taking the rest of the framework, let's remove
this for now. Once we have established an Aptos framework, we can
determine if it makes sense to bring back an experimental framework.
  • Loading branch information
davidiw authored and aptos-bot committed Mar 29, 2022
1 parent b66a167 commit b3b55fd
Show file tree
Hide file tree
Showing 268 changed files with 39 additions and 34,602 deletions.
17 changes: 0 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ members = [
"aptos-move/framework",
"aptos-move/framework/DPN/releases",
"aptos-move/framework/aptos-framework/releases",
"aptos-move/framework/experimental/releases",
"aptos-move/framework/releases",
"aptos-move/genesis-viewer",
"aptos-move/move-examples",
Expand Down
3 changes: 0 additions & 3 deletions aptos-move/e2e-tests/src/data_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ pub static GENESIS_CHANGE_SET: Lazy<ChangeSet> =
pub static GENESIS_CHANGE_SET_FRESH: Lazy<ChangeSet> =
Lazy::new(|| generate_genesis_change_set_for_testing(GenesisOptions::Fresh));

pub static GENESIS_CHANGE_SET_EXPERIMENTAL: Lazy<ChangeSet> =
Lazy::new(|| generate_genesis_change_set_for_testing(GenesisOptions::Experimental));

/// An in-memory implementation of [`StateView`] and [`RemoteCache`] for the VM.
///
/// Tests use this to set up state, and pass in a reference to the cache whenever a `StateView` or
Expand Down
8 changes: 1 addition & 7 deletions aptos-move/e2e-tests/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ use std::{
use crate::{
account::{Account, AccountData},
data_store::{
FakeDataStore, GENESIS_CHANGE_SET, GENESIS_CHANGE_SET_EXPERIMENTAL,
GENESIS_CHANGE_SET_FRESH,
FakeDataStore, GENESIS_CHANGE_SET, GENESIS_CHANGE_SET_FRESH,
},
golden_outputs::GoldenOutputs,
};
Expand Down Expand Up @@ -114,11 +113,6 @@ impl FakeExecutor {
Self::from_genesis(GENESIS_CHANGE_SET_FRESH.clone().write_set())
}

/// Creates an executor using the experimental genesis.
pub fn from_experimental_genesis() -> Self {
Self::from_genesis(GENESIS_CHANGE_SET_EXPERIMENTAL.clone().write_set())
}

pub fn allowlist_genesis() -> Self {
Self::custom_genesis(
current_module_blobs(),
Expand Down
63 changes: 0 additions & 63 deletions aptos-move/e2e-testsuite/src/tests/experimental.rs

This file was deleted.

1 change: 0 additions & 1 deletion aptos-move/e2e-testsuite/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ mod crsn;
mod data_store;
mod emergency_admin_script;
mod execution_strategies;
mod experimental;
mod failed_transaction_tests;
mod genesis;
mod genesis_initializations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ compiled_package_info:
? address: "00000000000000000000000000000001"
name: Version
: CoreFramework
source_digest: 83B580762EF6AE996B07C11CD90735B1DC9CE50D675851846CA698E8ECB0D6AF
source_digest: F524E3052EC3A7154F9CD0F89F9F655F12E0E6837437B1F8B871D965411C0DBD
build_flags:
dev_mode: false
test_mode: false
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Module `0x1::AptosAccount`

The <code><a href="AptosAccount.md#0x1_AptosAccount">AptosAccount</a></code> module manages experimental accounts.
The <code><a href="AptosAccount.md#0x1_AptosAccount">AptosAccount</a></code> module manages Aptos accounts.
It also defines the prolog and epilog that run before and after every
transaction in addition to the core prologue and epilogue.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ This module provides the foundation for transferring of Tokens
&<b>mut</b> <b>borrow_global_mut</b>&lt;<a href="TokenTransfers.md#0x1_TokenTransfers">TokenTransfers</a>&lt;TokenType&gt;&gt;(sender).pending_transfers;
<b>let</b> pending_tokens = <a href="Table.md#0x1_Table_borrow_mut">Table::borrow_mut</a>(pending_transfers, &receiver_addr);
<b>let</b> (_id, token) = <a href="Table.md#0x1_Table_remove">Table::remove</a>(pending_tokens, token_id);

<b>if</b> (<a href="Table.md#0x1_Table_count">Table::count</a>(pending_tokens) == 0) {
<b>let</b> (_id, real_pending_transfers) = <a href="Table.md#0x1_Table_remove">Table::remove</a>(pending_transfers, &receiver_addr);
<a href="Table.md#0x1_Table_destroy_empty">Table::destroy_empty</a>(real_pending_transfers)
};

<a href="Token.md#0x1_Token_deposit_token">Token::deposit_token</a>(receiver, token)
}
</code></pre>
Expand Down Expand Up @@ -182,6 +188,12 @@ This module provides the foundation for transferring of Tokens
&<b>mut</b> <b>borrow_global_mut</b>&lt;<a href="TokenTransfers.md#0x1_TokenTransfers">TokenTransfers</a>&lt;TokenType&gt;&gt;(sender_addr).pending_transfers;
<b>let</b> pending_tokens = <a href="Table.md#0x1_Table_borrow_mut">Table::borrow_mut</a>(pending_transfers, &receiver);
<b>let</b> (_id, token) = <a href="Table.md#0x1_Table_remove">Table::remove</a>(pending_tokens, token_id);

<b>if</b> (<a href="Table.md#0x1_Table_count">Table::count</a>(pending_tokens) == 0) {
<b>let</b> (_id, real_pending_transfers) = <a href="Table.md#0x1_Table_remove">Table::remove</a>(pending_transfers, &receiver);
<a href="Table.md#0x1_Table_destroy_empty">Table::destroy_empty</a>(real_pending_transfers)
};

<a href="Token.md#0x1_Token_deposit_token">Token::deposit_token</a>(sender, token)
}
</code></pre>
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// The `AptosAccount` module manages experimental accounts.
/// The `AptosAccount` module manages Aptos accounts.
/// It also defines the prolog and epilog that run before and after every
/// transaction in addition to the core prologue and epilogue.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ module AptosFramework::TokenTransfers {
&mut borrow_global_mut<TokenTransfers<TokenType>>(sender).pending_transfers;
let pending_tokens = Table::borrow_mut(pending_transfers, &receiver_addr);
let (_id, token) = Table::remove(pending_tokens, token_id);

if (Table::count(pending_tokens) == 0) {
let (_id, real_pending_transfers) = Table::remove(pending_transfers, &receiver_addr);
Table::destroy_empty(real_pending_transfers)
};

Token::deposit_token(receiver, token)
}

Expand All @@ -68,6 +74,12 @@ module AptosFramework::TokenTransfers {
&mut borrow_global_mut<TokenTransfers<TokenType>>(sender_addr).pending_transfers;
let pending_tokens = Table::borrow_mut(pending_transfers, &receiver);
let (_id, token) = Table::remove(pending_tokens, token_id);

if (Table::count(pending_tokens) == 0) {
let (_id, real_pending_transfers) = Table::remove(pending_transfers, &receiver);
Table::destroy_empty(real_pending_transfers)
};

Token::deposit_token(sender, token)
}

Expand Down Expand Up @@ -99,10 +111,16 @@ module AptosFramework::TokenTransfers {
let owner0_addr = Signer::address_of(&owner0);
let owner1_addr = Signer::address_of(&owner1);

assert!(Table::count(&borrow_global<TokenTransfers<u64>>(creator_addr).pending_transfers) == 0, 0);

transfer_to<u64>(&creator, owner0_addr, &token_id, 1);
assert!(Table::count(&borrow_global<TokenTransfers<u64>>(creator_addr).pending_transfers) == 1, 1);
transfer_to<u64>(&creator, owner1_addr, &token_id, 1);
assert!(Table::count(&borrow_global<TokenTransfers<u64>>(creator_addr).pending_transfers) == 2, 2);
receive_from<u64>(&owner0, creator_addr, &token_id);
assert!(Table::count(&borrow_global<TokenTransfers<u64>>(creator_addr).pending_transfers) == 1, 3);
receive_from<u64>(&owner1, creator_addr, &token_id);
assert!(Table::count(&borrow_global<TokenTransfers<u64>>(creator_addr).pending_transfers) == 0, 4);

initialize_token_transfers<u64>(&owner0);
transfer_to<u64>(&owner0, owner1_addr, &token_id, 1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// The `AptosAccount` module manages experimental accounts.
/// The `AptosAccount` module manages Aptos accounts.
/// It also defines the prolog and epilog that run before and after every
/// transaction in addition to the core prologue and epilogue.
Expand Down
2 changes: 1 addition & 1 deletion aptos-move/framework/core/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
This folder contains a Move package consisting of core Move modules defining functionalities needed by
any Diem-based blockchains. To start your own Diem-based blockchain, you can create a Move package that
depends on this core package and write your own wrapper modules for the account module as well as the
on-chain configuration modules. [`experimental` folder](../experimental) provides an example of such
on-chain configuration modules. [`aptos-framework` folder](../aptos-framework) provides an example of such
Move package.

Next we briefly describe how to write the wrapper modules and how Move's powerful type system can provide flexibility
Expand Down
Binary file not shown.
Loading

0 comments on commit b3b55fd

Please sign in to comment.