Skip to content

Commit

Permalink
fix: Modify tron fee to eliminate spike due to first tx (#1439)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blazebrain authored May 9, 2024
1 parent bfb78ed commit 1fdc848
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions cw_tron/lib/tron_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ class TronClient {
final energyInSun = chainParams.getEnergyFee!;
log('Energy In Sun: $energyInSun');

log(
'Create Account Fee In System Contract for Chain: ${chainParams.getCreateNewAccountFeeInSystemContract!}',
);
log('Create Account Fee for Chain: ${chainParams.getCreateAccountFee}');

final fakeTransaction = Transaction(
rawData: rawTransaction,
signature: [Uint8List(65)],
Expand Down Expand Up @@ -185,17 +180,6 @@ class TronClient {
totalBurn += chainParams.getMemoFee!;
}

// Check if receiver's account is active
final receiverAccountInfo =
await _provider!.request(TronRequestGetAccount(address: receiverAddress));

/// Calculate the resources required to create a new account.
if (receiverAccountInfo == null) {
totalBurn += chainParams.getCreateNewAccountFeeInSystemContract!;

totalBurn += (chainParams.getCreateAccountFee! * bandWidthInSun);
}

log('Final total burn: $totalBurn');

return totalBurn;
Expand Down

0 comments on commit 1fdc848

Please sign in to comment.