Interface IFeeCollector
Represents a fee collector. A fee collector is a class that collects fees from the sender of the transaction. The fee collector is called three times in a single block. The first call is to collect the fee from the sender of the transaction. The second call is to refund the fee to the sender of the transaction. The third call is to reward the proposer of the block. The fee collector is called only when the transaction is collectible.
Namespace: Libplanet.Action
Assembly: Libplanet.Action.dll
Syntax
public interface IFeeCollector
Methods
| Improve this Doc View SourceMortgage(IAccount)
Mortgage the fee from the sender of the transaction.
Declaration
IAccount Mortgage(IAccount state)
Parameters
Type | Name | Description |
---|---|---|
IAccount | state | The state of the account. |
Returns
Type | Description |
---|---|
IAccount | The state of the account after the fee is mortgaged. |
Next(IActionContext)
Change the action context and return the next fee collector.
Declaration
IFeeCollector Next(IActionContext context)
Parameters
Type | Name | Description |
---|---|---|
IActionContext | context | The context of the action. |
Returns
Type | Description |
---|---|
IFeeCollector | The next fee collector. |
Refund(IAccount)
Refund the fee to the sender of the transaction.
Declaration
IAccount Refund(IAccount state)
Parameters
Type | Name | Description |
---|---|---|
IAccount | state | The state of the account after the action is executed. |
Returns
Type | Description |
---|---|
IAccount | The state of the account after the fee is refunded. |
Reward(IAccount)
Reward the proposer of the block.
Declaration
IAccount Reward(IAccount state)
Parameters
Type | Name | Description |
---|---|---|
IAccount | state | The state of the account after the fee is refunded. |
Returns
Type | Description |
---|---|
IAccount | The state of the account after the proposer is rewarded. |