-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from uniworld-io/fixTokenFeeOnNonExistAccount
Fix token fee on non exist account
- Loading branch information
Showing
5 changed files
with
63 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/org/unichain/core/db/BandwidthProcessorV3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.unichain.core.db; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.unichain.core.capsule.AccountCapsule; | ||
import org.unichain.core.exception.AccountResourceInsufficientException; | ||
import org.unichain.core.exception.ContractValidateException; | ||
import org.unichain.protos.Protocol.Transaction.Contract; | ||
|
||
/** | ||
* With block v3: create new account while transferring token to non-exist account | ||
* charged on owner account. | ||
*/ | ||
@Slf4j(topic = "DB") | ||
public class BandwidthProcessorV3 extends BandwidthProcessorV2 { | ||
|
||
public BandwidthProcessorV3(Manager manager) { | ||
super(manager); | ||
} | ||
|
||
@Override | ||
protected void consumeForCreateNewAccountIfTokenTransfer(AccountCapsule ownerAccountCapsule, Contract contract, TransactionTrace trace) throws AccountResourceInsufficientException, ContractValidateException { | ||
consumeForCreateNewAccount(ownerAccountCapsule, trace); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters