Skip to content

Commit ec6191f

Browse files
committed
fix: revert to signer from &signer.
1 parent 340b72e commit ec6191f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

aptos-move/framework/aptos-framework/sources/aptos_coin.move

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ module aptos_framework::aptos_coin {
116116

117117
/// Only callable in tests and testnets where the core resources account exists.
118118
/// Create delegated token for the address so the account could claim MintCapability later.
119-
public entry fun delegate_mint_capability(account: &signer, to: address) acquires Delegations {
120-
system_addresses::assert_aptos_framework(account);
119+
public entry fun delegate_mint_capability(account: signer, to: address) acquires Delegations {
120+
system_addresses::assert_aptos_framework(&account);
121121
let delegations = &mut borrow_global_mut<Delegations>(@aptos_framework).inner;
122-
if (!exists<Delegations>(signer::address_of(account))) {
123-
move_to(account, Delegations { inner: vector[] });
122+
if (!exists<Delegations>(signer::address_of(&account))) {
123+
move_to(&account, Delegations { inner: vector[] });
124124
};
125125
vector::for_each_ref(delegations, |element| {
126126
let element: &DelegatedMintCapability = element;
@@ -231,8 +231,11 @@ module aptos_framework::aptos_coin {
231231
// initialize the `aptos_coin`
232232
let (burn_cap, mint_cap) = initialize_for_test(aptos_framework);
233233

234+
// get a copy of the framework signer for test
235+
let aptos_framework_delegate = account::create_signer_for_test(signer::address_of(aptos_framework));
236+
234237
// delegate and claim the mint capability
235-
delegate_mint_capability(aptos_framework, signer::address_of(destination));
238+
delegate_mint_capability(aptos_framework_delegate, signer::address_of(destination));
236239
claim_mint_capability(destination);
237240

238241
// destroy the mint Capability

0 commit comments

Comments
 (0)