Skip to content

Commit

Permalink
[AptosFramework] good bye DPN
Browse files Browse the repository at this point in the history
  • Loading branch information
zekun000 authored and aptos-bot committed Apr 1, 2022
1 parent de9405b commit 682f9f2
Show file tree
Hide file tree
Showing 445 changed files with 649 additions and 84,179 deletions.
18 changes: 1 addition & 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 @@ -15,7 +15,6 @@ members = [
"aptos-move/e2e-tests-replay",
"aptos-move/e2e-testsuite",
"aptos-move/framework",
"aptos-move/framework/DPN/releases",
"aptos-move/framework/cached-packages",
"aptos-move/framework/releases",
"aptos-move/genesis-viewer",
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"type": "block_metadata_transaction",
"version": "1",
"hash": "0xa8fc186c28fc0f95b8233651438093e8e215a51dcd16475f5e68c0a421f6305c",
"state_root_hash": "0x260c8c3b9ce32452ba499c23b8cb132ad02bd32f74a88fd51e9fcfb5482dbb56",
"state_root_hash": "0x29e9c6d014aa79241348b977de481f6f35152247a0e89a6783f587f84f5598b2",
"event_root_hash": "0xd62c85b93234824cf825e9c028c3bcc59b06926039721bd7edd76b56ae9fcecf",
"gas_used": "0",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xef8f5f105d1ef2102e6e276a8e5b5fff426bd1a4e1358258ecc87f5a47d19146",
"accumulator_root_hash": "0xc8853f0ecf86bca145a136258545e8476e51942ee2986b461692ba5916d5ee27",
"id": "0xf44b581f23222c10916b17a369b4da039d075952b58036f2a7b561446592403c",
"round": "1",
"previous_block_votes": [],
Expand All @@ -19,12 +19,12 @@
"type": "user_transaction",
"version": "2",
"hash": "0x7ecd26dfe2d314f8fc5b5e5ecd0fb64dfd341755f025759e8bb5226441068523",
"state_root_hash": "0x20779ec9e76b24da9433a196cdfdabdfab32cf861440ebcf09341a5c73ea6852",
"state_root_hash": "0x64d80c05170b9ca40afd106f5496f507a747890c95b61044d27848f956ea074e",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "98",
"success": true,
"vm_status": "Executed successfully",
"accumulator_root_hash": "0xeee38e54c3bf6e80b057b72e41e46a491d8bddde340447b9e1a73a7c73d931cd",
"accumulator_root_hash": "0xccc6fdd8f39e1fc22a86d3e3fd7eb21c398662058f6419bcca3b353ab8e30404",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"type": "user_transaction",
"version": "2",
"hash": "0x94ea91ca86dabbe323c8d6ce9dccaa981e713dee84ef5b649a519a11f0688efb",
"state_root_hash": "0x20d6af29e82eb8c4df8203959ba851fb99ea9f77456a7cd97e24dd8b3c5ccf23",
"state_root_hash": "0x51ba1c728c430e54e202b85565b4e90617e9cad5bc178c389038eb834dab5b71",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x206a9d0c01274dd91e967f6bf379939a163e986c04205e82e893eb8b5df7624f",
"accumulator_root_hash": "0x29ee006a99f70cb667a228acf161075abbbc92d132ce3d8f80c22a6901dc92d1",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"type": "user_transaction",
"version": "2",
"hash": "0xf041614384c1fa1041c41d09e03165de1894c9d0fd4a0bef27aa74d5c5e1edf7",
"state_root_hash": "0x20d6af29e82eb8c4df8203959ba851fb99ea9f77456a7cd97e24dd8b3c5ccf23",
"state_root_hash": "0x51ba1c728c430e54e202b85565b4e90617e9cad5bc178c389038eb834dab5b71",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x0a41212d9ce0ae41a2f5b48610059ffbd1596e15c920a1424fba241436a1ca4a",
"accumulator_root_hash": "0xdd8dfcb60b898f001624a5ff871a4eccc9d9e294a5a70925ed3a82b4fb8e378c",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"type": "user_transaction",
"version": "2",
"hash": "0xcb16d12010be8372e54b392756d4b8f586a6817de83d6fe5b17cf04ee9e184ea",
"state_root_hash": "0x20d6af29e82eb8c4df8203959ba851fb99ea9f77456a7cd97e24dd8b3c5ccf23",
"state_root_hash": "0x51ba1c728c430e54e202b85565b4e90617e9cad5bc178c389038eb834dab5b71",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x2b5e38e26180869877d42324a3043ac6dcc9dc38829d911985129b0e271a716d",
"accumulator_root_hash": "0xc9e971183b3fb1f96a16120f8007beb9789a6c8caa98c3bdb98b5f94d41cc2fd",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"type": "user_transaction",
"version": "2",
"hash": "0x7e7cce0816c8893b387ee9df6639b76057b451fa2ee7fad79b150d1e5ab39972",
"state_root_hash": "0x20d6af29e82eb8c4df8203959ba851fb99ea9f77456a7cd97e24dd8b3c5ccf23",
"state_root_hash": "0x51ba1c728c430e54e202b85565b4e90617e9cad5bc178c389038eb834dab5b71",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x9dc5c9e5b89bc657027df43c0afaabaf7a1f775ba0267a6845f4bb9e1b14ec7d",
"accumulator_root_hash": "0xfea22ea71dc0b2c5278289298e92cd0fc5faaff1888935e760208a09a2e365f9",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"type": "user_transaction",
"version": "2",
"hash": "0x2d05462ffbbe304c481df68b280819469adb3ccc88573121ce445c867a4a5e5a",
"state_root_hash": "0x20d6af29e82eb8c4df8203959ba851fb99ea9f77456a7cd97e24dd8b3c5ccf23",
"state_root_hash": "0x51ba1c728c430e54e202b85565b4e90617e9cad5bc178c389038eb834dab5b71",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0xd31b0b94dd6f113b374a7f457f134f2168b0958d81b6eb7c62c3de6ca798f800",
"accumulator_root_hash": "0xdff70169d8da5c91e091bf51370b379af450c4d47a5dd047339b6134b4673341",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"type": "user_transaction",
"version": "2",
"hash": "0x1b45f833770dcd1bb69fb586b8367e459708e2cd4ba162110f8520b54794ab0f",
"state_root_hash": "0x20d6af29e82eb8c4df8203959ba851fb99ea9f77456a7cd97e24dd8b3c5ccf23",
"state_root_hash": "0x51ba1c728c430e54e202b85565b4e90617e9cad5bc178c389038eb834dab5b71",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0xdfca8c4f8f2692e4f6fcaddb63cabdb7e5ffc171108a943fcc96c133a3d7e282",
"accumulator_root_hash": "0x8749699ca9163bac914f821c083dbe1dce945afdb2cb49e30c201e4b9c22018a",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"type": "user_transaction",
"version": "2",
"hash": "0x7d70c809eaed055de23cd99cc946954ebc3905e20dd1db0b6634dab13a3046f6",
"state_root_hash": "0x20d6af29e82eb8c4df8203959ba851fb99ea9f77456a7cd97e24dd8b3c5ccf23",
"state_root_hash": "0x51ba1c728c430e54e202b85565b4e90617e9cad5bc178c389038eb834dab5b71",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "1",
"success": false,
"vm_status": "Move bytecode deserialization / verification failed, including script function not found or invalid arguments",
"accumulator_root_hash": "0x58aca32d0cf8579b13c41c47de4f9dbc83decabca1e839f3ae1279f14d0a423b",
"accumulator_root_hash": "0x484af11a9b12ec38c66e251d89e8ac1083ffb27db81ff09e9bf523928dc55d16",
"sender": "0xa550c18",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"type": "user_transaction",
"version": "4",
"hash": "0x02dbb80ed580f1c272fb0e41d18e4c5367c03f4bfad5b711d297037beda71f97",
"state_root_hash": "0xc89e39a9916c9cd4fac2d20111d790d2fc6cb90c11dca2a5e9719b864c124e3c",
"state_root_hash": "0xecab0fd2f7520176a95900ccd923bde90cd750393608201ebfe16430c7f8fb39",
"event_root_hash": "0x414343554d554c41544f525f504c414345484f4c4445525f4841534800000000",
"gas_used": "26",
"success": false,
"vm_status": "Move abort by LIMIT_EXCEEDED - EINSUFFICIENT_BALANCE\n A limit on an amount, e.g. a currency, is exceeded. Example: withdrawal of money after account limits window\n is exhausted.\n Error codes",
"accumulator_root_hash": "0xc2b49a932adb00934187e62b58ba940414f1487f6b44944c4e044057d79987ed",
"accumulator_root_hash": "0x3315ecf6b255acbe96f78c5508b930fd229abf554abc06828524110d56ba2b96",
"sender": "0xe60912ecb0a8c365d163d258f3b9f1b62f8f9148c207643864d7ed4a2b23159",
"sequence_number": "0",
"max_gas_amount": "1000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use move_core_types::{
account_address::AccountAddress,
gas_schedule::{GasAlgebra, GasConstants},
identifier::{IdentStr, Identifier},
language_storage::{ModuleId, ResourceKey, StructTag, TypeTag},
language_storage::{ModuleId, ResourceKey, TypeTag},
move_resource::MoveStructType,
transaction_argument::{convert_txn_args, TransactionArgument},
};
Expand Down Expand Up @@ -564,11 +564,11 @@ impl<'a> AptosTestAdapter<'a> {

validator_private_key: Ed25519PrivateKey,
validator_account_addr: AccountAddress,
validator_auth_key_prefix: Vec<u8>,
_validator_auth_key_prefix: Vec<u8>,

operator_private_key: Ed25519PrivateKey,
operator_account_addr: AccountAddress,
operator_auth_key_prefix: Vec<u8>,
_operator_auth_key_prefix: Vec<u8>,
) {
// Step 1. Create validator account.
let parameters = self
Expand All @@ -577,10 +577,8 @@ impl<'a> AptosTestAdapter<'a> {
let txn = RawTransaction::new(
aptos_root_address(),
parameters.sequence_number,
aptos_transaction_builder::stdlib::encode_create_validator_account_script_function(
0,
aptos_transaction_builder::aptos_stdlib::encode_create_validator_account_script_function(
validator_account_addr,
validator_auth_key_prefix,
validator_name.as_bytes().into(),
),
parameters.max_gas_amount,
Expand All @@ -602,10 +600,8 @@ impl<'a> AptosTestAdapter<'a> {
let txn = RawTransaction::new(
aptos_root_address(),
parameters.sequence_number,
aptos_transaction_builder::stdlib::encode_create_validator_operator_account_script_function(
0,
aptos_transaction_builder::aptos_stdlib::encode_create_validator_operator_account_script_function(
operator_account_addr,
operator_auth_key_prefix,
validator_name.as_bytes().into(),
),
parameters.max_gas_amount,
Expand All @@ -627,7 +623,7 @@ impl<'a> AptosTestAdapter<'a> {
let txn = RawTransaction::new(
validator_account_addr,
parameters.sequence_number,
aptos_transaction_builder::stdlib::encode_set_validator_operator_script_function(
aptos_transaction_builder::aptos_stdlib::encode_set_validator_operator_script_function(
validator_name.as_bytes().into(),
operator_account_addr,
),
Expand All @@ -650,7 +646,7 @@ impl<'a> AptosTestAdapter<'a> {
let txn = RawTransaction::new(
operator_account_addr,
parameters.sequence_number,
aptos_transaction_builder::stdlib::encode_register_validator_config_script_function(
aptos_transaction_builder::aptos_stdlib::encode_register_validator_config_script_function(
validator_account_addr,
validator_private_key.public_key().to_bytes().to_vec(),
vec![],
Expand All @@ -675,9 +671,7 @@ impl<'a> AptosTestAdapter<'a> {
let txn = RawTransaction::new(
aptos_root_address(),
parameters.sequence_number,
aptos_transaction_builder::stdlib::encode_add_validator_and_reconfigure_script_function(
0,
validator_name.as_bytes().into(),
aptos_transaction_builder::aptos_stdlib::encode_add_validator_script_function(
validator_account_addr,
),
parameters.max_gas_amount,
Expand All @@ -699,10 +693,10 @@ impl<'a> AptosTestAdapter<'a> {
/// That needs to be done separately.
fn create_parent_vasp_account(
&mut self,
validator_name: Identifier,
auth_key_prefix: Vec<u8>,
_validator_name: Identifier,
_auth_key_prefix: Vec<u8>,
account_addr: AccountAddress,
currency_type_name: TypeName,
_currency_type_name: TypeName,
) {
let parameters = self
.fetch_transaction_parameters(
Expand All @@ -715,28 +709,11 @@ impl<'a> AptosTestAdapter<'a> {
)
.unwrap();

let currency_type_tag = {
let address = self
.compiled_state()
.resolve_address(&currency_type_name.address);
TypeTag::Struct(StructTag {
address,
module: currency_type_name.module_name,
name: currency_type_name.type_name,
type_params: vec![],
})
};

let txn = RawTransaction::new(
treasury_compliance_account_address(),
parameters.sequence_number,
aptos_transaction_builder::stdlib::encode_create_parent_vasp_account_script_function(
currency_type_tag,
0,
aptos_transaction_builder::aptos_stdlib::encode_create_account_script_function(
account_addr,
auth_key_prefix,
validator_name.as_bytes().into(),
false,
),
parameters.max_gas_amount,
parameters.gas_unit_price,
Expand Down
36 changes: 4 additions & 32 deletions aptos-move/e2e-tests/src/common_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@
//! Support for encoding transactions for common situations.
use crate::account::Account;
use aptos_transaction_builder::{
aptos_stdlib::{
encode_create_account_script_function, encode_rotate_authentication_key_script_function,
encode_transfer_script_function,
},
stdlib::encode_peer_to_peer_by_signers_script_function,
use aptos_transaction_builder::aptos_stdlib::{
encode_create_account_script_function, encode_rotate_authentication_key_script_function,
encode_transfer_script_function,
};
use aptos_types::{
account_config,
transaction::{
RawTransaction, Script, SignedTransaction, TransactionArgument, TransactionPayload,
},
transaction::{RawTransaction, Script, SignedTransaction, TransactionArgument},
};
use move_core_types::language_storage::TypeTag;
use move_ir_compiler::Compiler;
Expand Down Expand Up @@ -214,25 +209,6 @@ pub fn multi_agent_swap_txn(
}

/// Returns a multi-agent p2p transaction.
pub fn multi_agent_p2p_txn(
payer: &Account,
payee: &Account,
seq_num: u64,
amount: u64,
) -> SignedTransaction {
// get a SignedTransaction
payer
.transaction()
.secondary_signers(vec![payee.clone()])
.payload(encode_peer_to_peer_by_signers_script_function(
account_config::xus_tag(),
amount,
vec![],
))
.sequence_number(seq_num)
.sign_multi_agent()
}

/// Returns a transaction to mint coins from TC to DD to VASP.
pub fn multi_agent_mint_txn(
tc_account: &Account,
Expand Down Expand Up @@ -288,10 +264,6 @@ pub fn multi_agent_swap_script(xus_amount: u64, xdx_amount: u64) -> Script {
Script::new(MULTI_AGENT_SWAP_SCRIPT.to_vec(), vec![], args)
}

pub fn multi_agent_p2p_script_function(amount: u64) -> TransactionPayload {
encode_peer_to_peer_by_signers_script_function(account_config::xus_tag(), amount, vec![])
}

pub fn multi_agent_mint_script(mint_amount: u64, tier_index: u64) -> Script {
let args: Vec<TransactionArgument> = vec![
TransactionArgument::U64(mint_amount),
Expand Down
14 changes: 0 additions & 14 deletions aptos-move/framework/DPN/Move.toml

This file was deleted.

Loading

0 comments on commit 682f9f2

Please sign in to comment.