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(IWorld)
Mortgage the fee from the sender of the transaction.
Declaration
IWorld Mortgage(IWorld world)
Parameters
Type | Name | Description |
---|---|---|
IWorld | world | The state of the account. |
Returns
Type | Description |
---|---|
IWorld | 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(IWorld)
Refund the fee to the sender of the transaction.
Declaration
IWorld Refund(IWorld world)
Parameters
Type | Name | Description |
---|---|---|
IWorld | world | The state of the account after the action is executed. |
Returns
Type | Description |
---|---|
IWorld | The state of the account after the fee is refunded. |
Reward(IWorld)
Reward the proposer of the block.
Declaration
IWorld Reward(IWorld world)
Parameters
Type | Name | Description |
---|---|---|
IWorld | world | The state of the account after the fee is refunded. |
Returns
Type | Description |
---|---|
IWorld | The state of the account after the proposer is rewarded. |