Skip to content

Commit

Permalink
[Address32][2/3] replace script with script function
Browse files Browse the repository at this point in the history
  • Loading branch information
areshand authored and aptos-bot committed Mar 25, 2022
1 parent f470223 commit d4b58d5
Show file tree
Hide file tree
Showing 19 changed files with 358 additions and 438 deletions.
5 changes: 4 additions & 1 deletion aptos-move/e2e-tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ pub fn upgrade_df(
executor.execute_and_apply(
dr_account
.transaction()
.script(encode_update_diem_version_script(0, version_number))
.payload(encode_update_diem_version_script_function(
0,
version_number,
))
.sequence_number(*dr_seqno)
.sign(),
);
Expand Down
52 changes: 26 additions & 26 deletions aptos-move/e2e-testsuite/src/tests/account_limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ fn account_limits() {
executor.execute_and_apply(
blessed
.transaction()
.script(encode_create_parent_vasp_account_script(
.payload(encode_create_parent_vasp_account_script_function(
account_config::xus_tag(),
0,
*vasp_a.address(),
Expand All @@ -185,7 +185,7 @@ fn account_limits() {
executor.execute_and_apply(
blessed
.transaction()
.script(encode_create_parent_vasp_account_script(
.payload(encode_create_parent_vasp_account_script_function(
account_config::xus_tag(),
0,
*vasp_b.address(),
Expand All @@ -202,7 +202,7 @@ fn account_limits() {
executor.execute_and_apply(
vasp_a
.transaction()
.script(encode_create_child_vasp_account_script(
.payload(encode_create_child_vasp_account_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
vasp_a_child.auth_key_prefix(),
Expand All @@ -216,7 +216,7 @@ fn account_limits() {
executor.execute_and_apply(
vasp_b
.transaction()
.script(encode_create_child_vasp_account_script(
.payload(encode_create_child_vasp_account_script_function(
account_config::xus_tag(),
*vasp_b_child.address(),
vasp_b_child.auth_key_prefix(),
Expand Down Expand Up @@ -247,7 +247,7 @@ fn account_limits() {
// mint money to both vasp A & B
executor.execute_and_apply(
dd.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a.address(),
2 * mint_amount,
Expand All @@ -260,7 +260,7 @@ fn account_limits() {
);
executor.execute_and_apply(
dd.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_b.address(),
2 * mint_amount,
Expand Down Expand Up @@ -310,7 +310,7 @@ fn account_limits() {
let output = executor.execute_transaction(
vasp_b
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a.address(),
mint_amount + 1,
Expand All @@ -329,7 +329,7 @@ fn account_limits() {
let output = executor.execute_transaction(
vasp_b
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
mint_amount + 1,
Expand All @@ -347,7 +347,7 @@ fn account_limits() {
executor.execute_and_apply(
vasp_a
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
mint_amount + 1,
Expand All @@ -363,7 +363,7 @@ fn account_limits() {
executor.execute_and_apply(
vasp_a_child
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_b_child.address(),
mint_amount + 1,
Expand All @@ -379,7 +379,7 @@ fn account_limits() {
executor.execute_and_apply(
vasp_b_child
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
mint_amount,
Expand All @@ -395,7 +395,7 @@ fn account_limits() {
// DD deposit fails since vasp A is at inflow limit
let output = executor.execute_transaction(
dd.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
1,
Expand All @@ -416,7 +416,7 @@ fn account_limits() {
// DD deposit now succeeds since window is reset
let output = executor.execute_transaction(
dd.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
1,
Expand Down Expand Up @@ -454,7 +454,7 @@ fn account_limits() {
executor.execute_and_apply(
vasp_a
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
1001,
Expand All @@ -470,7 +470,7 @@ fn account_limits() {
executor.execute_and_apply(
vasp_a_child
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_b_child.address(),
1000,
Expand All @@ -487,7 +487,7 @@ fn account_limits() {
let output = executor.execute_transaction(
vasp_a
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_b.address(),
1,
Expand All @@ -506,7 +506,7 @@ fn account_limits() {
let output = executor.execute_transaction(
vasp_a_child
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_b_child.address(),
1,
Expand All @@ -525,7 +525,7 @@ fn account_limits() {
let output = executor.execute_transaction(
vasp_a_child
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*dd.address(),
1,
Expand All @@ -546,7 +546,7 @@ fn account_limits() {
let output = executor.execute_transaction(
vasp_a_child
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*dd.address(),
1,
Expand Down Expand Up @@ -610,7 +610,7 @@ fn account_limits() {
let output = executor.execute_transaction(
vasp_b
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
1,
Expand All @@ -628,7 +628,7 @@ fn account_limits() {
executor.execute_and_apply(
vasp_a
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_b_child.address(),
10,
Expand All @@ -644,7 +644,7 @@ fn account_limits() {
executor.execute_and_apply(
vasp_b
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
10,
Expand All @@ -661,7 +661,7 @@ fn account_limits() {
let output = executor.execute_transaction(
vasp_b
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
1,
Expand All @@ -679,7 +679,7 @@ fn account_limits() {
executor.execute_and_apply(
vasp_a_child
.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a.address(),
1100,
Expand All @@ -695,7 +695,7 @@ fn account_limits() {
// DD deposit fails since vasp A is at holding limit
let output = executor.execute_transaction(
dd.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
1,
Expand All @@ -717,7 +717,7 @@ fn account_limits() {
// and because holdings are not reset from one window to the next.
let output = executor.execute_transaction(
dd.transaction()
.script(encode_peer_to_peer_with_metadata_script(
.payload(encode_peer_to_peer_with_metadata_script_function(
account_config::xus_tag(),
*vasp_a_child.address(),
1,
Expand Down
20 changes: 10 additions & 10 deletions aptos-move/e2e-testsuite/src/tests/emergency_admin_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn validator_batch_remove() {
executor.execute_and_apply(
aptos_root_account
.transaction()
.script(encode_create_validator_account_script(
.payload(encode_create_validator_account_script_function(
0,
*validator_account_0.address(),
validator_account_0.auth_key_prefix(),
Expand All @@ -47,7 +47,7 @@ fn validator_batch_remove() {
executor.execute_and_apply(
aptos_root_account
.transaction()
.script(encode_create_validator_operator_account_script(
.payload(encode_create_validator_operator_account_script_function(
0,
*operator_account.address(),
operator_account.auth_key_prefix(),
Expand All @@ -60,7 +60,7 @@ fn validator_batch_remove() {
executor.execute_and_apply(
validator_account_0
.transaction()
.script(encode_set_validator_operator_script(
.payload(encode_set_validator_operator_script_function(
b"operator".to_vec(),
*operator_account.address(),
))
Expand All @@ -74,7 +74,7 @@ fn validator_batch_remove() {
executor.execute_and_apply(
operator_account
.transaction()
.script(encode_register_validator_config_script(
.payload(encode_register_validator_config_script_function(
*validator_account_0.address(),
[
0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, 0xd3, 0xc9,
Expand All @@ -93,7 +93,7 @@ fn validator_batch_remove() {
executor.execute_and_apply(
aptos_root_account
.transaction()
.script(encode_add_validator_and_reconfigure_script(
.payload(encode_add_validator_and_reconfigure_script_function(
2,
b"validator_0".to_vec(),
*validator_account_0.address(),
Expand All @@ -107,7 +107,7 @@ fn validator_batch_remove() {
executor.execute_and_apply(
aptos_root_account
.transaction()
.script(encode_create_validator_account_script(
.payload(encode_create_validator_account_script_function(
0,
*validator_account_1.address(),
validator_account_1.auth_key_prefix(),
Expand All @@ -120,7 +120,7 @@ fn validator_batch_remove() {
executor.execute_and_apply(
validator_account_1
.transaction()
.script(encode_set_validator_operator_script(
.payload(encode_set_validator_operator_script_function(
b"operator".to_vec(),
*operator_account.address(),
))
Expand All @@ -133,7 +133,7 @@ fn validator_batch_remove() {
executor.execute_and_apply(
operator_account
.transaction()
.script(encode_register_validator_config_script(
.payload(encode_register_validator_config_script_function(
*validator_account_1.address(),
[
0xd7, 0x5a, 0x98, 0x01, 0x82, 0xb1, 0x0a, 0xb7, 0xd5, 0x4b, 0xfe, 0xd3, 0xc9,
Expand All @@ -152,7 +152,7 @@ fn validator_batch_remove() {
executor.execute_and_apply(
aptos_root_account
.transaction()
.script(encode_add_validator_and_reconfigure_script(
.payload(encode_add_validator_and_reconfigure_script_function(
3,
b"validator_1".to_vec(),
*validator_account_1.address(),
Expand Down Expand Up @@ -258,7 +258,7 @@ fn halt_network() {
executor.execute_and_apply(
aptos_root_account
.transaction()
.script(encode_rotate_authentication_key_script(auth_key))
.payload(encode_rotate_authentication_key_script_function(auth_key))
.sequence_number(test_env.dr_sequence_number)
.sign(),
);
Expand Down
14 changes: 7 additions & 7 deletions aptos-move/e2e-testsuite/src/tests/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn tiered_mint_designated_dealer() {
executor.execute_and_apply(
blessed
.transaction()
.script(encode_create_designated_dealer_script(
.payload(encode_create_designated_dealer_script_function(
account_config::xus_tag(),
0,
*dd.address(),
Expand All @@ -40,7 +40,7 @@ fn tiered_mint_designated_dealer() {
executor.execute_and_apply(
blessed
.transaction()
.script(encode_tiered_mint_script(
.payload(encode_tiered_mint_script_function(
account_config::xus_tag(),
1,
*dd.address(),
Expand All @@ -65,7 +65,7 @@ fn tiered_mint_designated_dealer() {
executor.execute_and_apply(
blessed
.transaction()
.script(encode_tiered_mint_script(
.payload(encode_tiered_mint_script_function(
account_config::xus_tag(),
2,
*dd.address(),
Expand Down Expand Up @@ -98,7 +98,7 @@ fn mint_to_existing_not_dd() {
executor.execute_and_apply(
blessed
.transaction()
.script(encode_create_parent_vasp_account_script(
.payload(encode_create_parent_vasp_account_script_function(
account_config::xus_tag(),
0,
*receiver.address(),
Expand All @@ -114,7 +114,7 @@ fn mint_to_existing_not_dd() {
let output = executor.execute_transaction(
blessed
.transaction()
.script(encode_tiered_mint_script(
.payload(encode_tiered_mint_script_function(
account_config::xus_tag(),
0,
*receiver.address(),
Expand Down Expand Up @@ -151,7 +151,7 @@ fn mint_to_new_account() {
let mint_amount = TXN_RESERVED;
let output = executor.execute_transaction(
tc.transaction()
.script(encode_tiered_mint_script(
.payload(encode_tiered_mint_script_function(
account_config::xus_tag(),
0,
*new_account.address(),
Expand Down Expand Up @@ -184,7 +184,7 @@ fn tiered_update_exchange_rate() {
executor.execute_and_apply(
blessed
.transaction()
.script(encode_update_exchange_rate_script(
.payload(encode_update_exchange_rate_script_function(
account_config::xus_tag(),
0,
123,
Expand Down
Loading

0 comments on commit d4b58d5

Please sign in to comment.