Skip to content

Commit

Permalink
all tests passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Apr 14, 2023
1 parent 081ae1e commit 80e3ce8
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions diem-move/diem-framework/DPN/sources/DiemAccount.move
Original file line number Diff line number Diff line change
Expand Up @@ -1364,10 +1364,20 @@ module DiemFramework::DiemAccount {
};


// VM can extract the withdraw token.
// let account = borrow_global_mut<DiemAccount>(payer);
// let cap = Option::extract(&mut account.withdraw_capability);
// NOTE: 0L: V6: removed the need for fetching the withdraw capability
let coin = vm_withdraw(vm, payer, amount);

// Load the payer's account and emit an event to record the withdrawal
Event::emit_event<SentPaymentEvent>(
&mut borrow_global_mut<DiemAccount>(payer).sent_events,
SentPaymentEvent {
amount,
currency_code: Diem::currency_code<Token>(),
payee,
metadata: copy metadata,
},
);


deposit<Token>(
payer,
Expand Down Expand Up @@ -3564,6 +3574,8 @@ module DiemFramework::DiemAccount {
CoreAddresses::assert_diem_root(vm);
let balance_struct = borrow_global_mut<Balance<Token>>(payer);
let coin = Diem::withdraw<Token>(&mut balance_struct.coin, amount);


coin
}

Expand Down

0 comments on commit 80e3ce8

Please sign in to comment.