From 196bf0a3e8672679662193303259bbbe06d3f3e7 Mon Sep 17 00:00:00 2001 From: 0xzoz Date: Thu, 24 Nov 2022 10:21:12 -0800 Subject: [PATCH 1/4] Remove slow wallet check for community wallet transfer in tx script --- .../DPN/sources/0L_transaction_scripts/ol_transfer.move | 6 ------ 1 file changed, 6 deletions(-) diff --git a/diem-move/diem-framework/DPN/sources/0L_transaction_scripts/ol_transfer.move b/diem-move/diem-framework/DPN/sources/0L_transaction_scripts/ol_transfer.move index 0d3d5a354e..597ffc862a 100644 --- a/diem-move/diem-framework/DPN/sources/0L_transaction_scripts/ol_transfer.move +++ b/diem-move/diem-framework/DPN/sources/0L_transaction_scripts/ol_transfer.move @@ -43,12 +43,6 @@ module TransferScripts { let sender_addr = Signer::address_of(&sender); assert!(Wallet::is_comm(sender_addr), 30001); - // confirm the destination account has a slow wallet - // TODO: this check only happens in this script since there's - // a circular dependecy issue with DiemAccount and Wallet which impedes - // checking in Wallet module - assert!(DiemAccount::is_slow(destination), 30002); - let uid = Wallet::new_timed_transfer(&sender, destination, value, memo); assert!(Wallet::transfer_is_proposed(uid), 30003); } From aaf2aa91c0b0ed382b2e577d4617dae799e20c9e Mon Sep 17 00:00:00 2001 From: 0xzoz Date: Thu, 24 Nov 2022 10:24:32 -0800 Subject: [PATCH 2/4] Removal of set slow wallet in test --- .../0L/diem_account/transfer_community_wallet_script.move | 2 -- 1 file changed, 2 deletions(-) diff --git a/diem-move/diem-framework/core/transactional-tests/0L/diem_account/transfer_community_wallet_script.move b/diem-move/diem-framework/core/transactional-tests/0L/diem_account/transfer_community_wallet_script.move index ecc687eb31..36a415f154 100644 --- a/diem-move/diem-framework/core/transactional-tests/0L/diem_account/transfer_community_wallet_script.move +++ b/diem-move/diem-framework/core/transactional-tests/0L/diem_account/transfer_community_wallet_script.move @@ -14,8 +14,6 @@ script { fun main(_dr: signer, bob: signer) { // Genesis creates 6 validators by default which are already slow wallets, - // adding Bob - DiemAccount::set_slow(&bob); let list = DiemAccount::get_slow_list(); assert!(Vector::length
(&list) == 7, 735701); } From 36439a7064b3f0bc3b5cad0641aac17e88884224 Mon Sep 17 00:00:00 2001 From: 0xzoz Date: Thu, 24 Nov 2022 10:27:21 -0800 Subject: [PATCH 3/4] Removal of redundant commenting related to changes --- diem-move/diem-framework/DPN/sources/0L/Wallet.move | 5 ----- 1 file changed, 5 deletions(-) diff --git a/diem-move/diem-framework/DPN/sources/0L/Wallet.move b/diem-move/diem-framework/DPN/sources/0L/Wallet.move index 17bd768929..0f48915b96 100644 --- a/diem-move/diem-framework/DPN/sources/0L/Wallet.move +++ b/diem-move/diem-framework/DPN/sources/0L/Wallet.move @@ -124,11 +124,6 @@ module Wallet { public fun new_timed_transfer( sender: &signer, payee: address, value: u64, description: vector ): u64 acquires CommunityTransfers, CommunityWalletList { - // firstly check if payee is a slow wallet - // TODO: This function should check if the account is a slow wallet before sending - // but there's a circular dependency with DiemAccount which has the slow wallet struct. - // curretly we move that check to the transaction script to initialize the payment. - // assert!(DiemAccount::is_slow(payee), EIS_NOT_SLOW_WALLET); let sender_addr = Signer::address_of(sender); let list = get_comm_list(); From 038e6495639740934711f635d6c3a172b6e5cbf2 Mon Sep 17 00:00:00 2001 From: 0xzoz Date: Fri, 2 Dec 2022 14:12:06 -0800 Subject: [PATCH 4/4] Rectify tests to pass --- .../0L/diem_account/transfer_community_wallet_script.move | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/diem-move/diem-framework/core/transactional-tests/0L/diem_account/transfer_community_wallet_script.move b/diem-move/diem-framework/core/transactional-tests/0L/diem_account/transfer_community_wallet_script.move index 36a415f154..77ee202f5f 100644 --- a/diem-move/diem-framework/core/transactional-tests/0L/diem_account/transfer_community_wallet_script.move +++ b/diem-move/diem-framework/core/transactional-tests/0L/diem_account/transfer_community_wallet_script.move @@ -2,20 +2,20 @@ // Alice, Jim: validators with 10M GAS // Bob, Carol: non-validators with 1M GAS -// Bob, the slow wallet +// Bob, the recipient wallet // Carol, the community wallet -// Community wallets cannot use the slow wallet transfer scripts //# run --admin-script --signers DiemRoot Bob script { use DiemFramework::DiemAccount; use Std::Vector; - fun main(_dr: signer, bob: signer) { + fun main(_dr: signer, _bob: signer) { // Genesis creates 6 validators by default which are already slow wallets, let list = DiemAccount::get_slow_list(); - assert!(Vector::length
(&list) == 7, 735701); + //verify bob is not in the slow list + assert!(Vector::length
(&list) == 6, 735701); } }