Adjust mempool.space fee mappings

This commit is contained in:
Martin Boehm 2024-03-15 23:23:19 +01:00
parent 9a2fe4dbe4
commit b5cfbdfde5
2 changed files with 18 additions and 12 deletions

View File

@ -86,27 +86,27 @@ func (p *mempoolSpaceFeeProvider) mempoolSpaceFeeProcessData(data *mempoolSpaceF
feePerKB: data.FastestFee * 1000, feePerKB: data.FastestFee * 1000,
} }
// HalfHourFee is for 2-5 blocks // HalfHourFee is for 2-6 blocks
p.fees[1] = alternativeFeeProviderFee{ p.fees[1] = alternativeFeeProviderFee{
blocks: 5, blocks: 6,
feePerKB: data.HalfHourFee * 1000, feePerKB: data.HalfHourFee * 1000,
} }
// HourFee is for 6-18 blocks // HourFee is for 7-36 blocks
p.fees[2] = alternativeFeeProviderFee{ p.fees[2] = alternativeFeeProviderFee{
blocks: 18, blocks: 36,
feePerKB: data.HourFee * 1000, feePerKB: data.HourFee * 1000,
} }
// EconomyFee is for 19-100 blocks // EconomyFee is for 37-200 blocks
p.fees[3] = alternativeFeeProviderFee{ p.fees[3] = alternativeFeeProviderFee{
blocks: 100, blocks: 500,
feePerKB: data.EconomyFee * 1000, feePerKB: data.EconomyFee * 1000,
} }
// MinimumFee is for over 100 blocks // MinimumFee is for over 500 blocks
p.fees[4] = alternativeFeeProviderFee{ p.fees[4] = alternativeFeeProviderFee{
blocks: 500, blocks: 1000,
feePerKB: data.MinimumFee * 1000, feePerKB: data.MinimumFee * 1000,
} }

View File

@ -24,13 +24,19 @@ func Test_mempoolSpaceFeeProvider(t *testing.T) {
{1, *big.NewInt(50000)}, {1, *big.NewInt(50000)},
{2, *big.NewInt(40000)}, {2, *big.NewInt(40000)},
{5, *big.NewInt(40000)}, {5, *big.NewInt(40000)},
{6, *big.NewInt(30000)}, {6, *big.NewInt(40000)},
{7, *big.NewInt(30000)},
{10, *big.NewInt(30000)}, {10, *big.NewInt(30000)},
{18, *big.NewInt(30000)}, {18, *big.NewInt(30000)},
{19, *big.NewInt(20000)}, {19, *big.NewInt(30000)},
{36, *big.NewInt(30000)},
{37, *big.NewInt(20000)},
{100, *big.NewInt(20000)}, {100, *big.NewInt(20000)},
{101, *big.NewInt(10000)}, {101, *big.NewInt(20000)},
{500, *big.NewInt(10000)}, {200, *big.NewInt(20000)},
{201, *big.NewInt(20000)},
{500, *big.NewInt(20000)},
{501, *big.NewInt(10000)},
{5000000, *big.NewInt(10000)}, {5000000, *big.NewInt(10000)},
} }
for _, tt := range tests { for _, tt := range tests {