Skip to content

Commit 4012e7c

Browse files
authored
Log to addr when looping blocklist (#28)
1 parent 759552c commit 4012e7c

File tree

4 files changed

+15
-183
lines changed

4 files changed

+15
-183
lines changed

core/txpool/immutable/accesscontrol/contract_creation_controller.go

Lines changed: 0 additions & 77 deletions
This file was deleted.

core/txpool/immutable/accesscontrol/contract_creation_controller_test.go

Lines changed: 0 additions & 105 deletions
This file was deleted.

core/txpool/immutable/accesscontrol/controller_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@ func TestImmutableAccessControl_Controller_IsAllowed(t *testing.T) {
8181
addressToCheck: common.HexToAddress("0xabcdefabcdefabcdefabcdefabcdefabcdefabcdefab"),
8282
expectedAllowed: true,
8383
},
84+
{
85+
name: "AddressIsEmpty",
86+
isAnAllowList: false,
87+
providers: map[string]AddressProvider{
88+
"list": &MockAddressProvider{
89+
addresses: map[common.Address]struct{}{
90+
common.HexToAddress("0x1234567890123456789012345678901234567890"): {},
91+
},
92+
},
93+
},
94+
addressToCheck: common.Address{},
95+
expectedAllowed: true,
96+
},
8497
{
8598
name: "AddressInAllowedAddresses",
8699
isAnAllowList: true,

core/txpool/legacypool/legacypool.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ func (pool *LegacyPool) FilterWithError(tx *types.Transaction) error {
324324
// Check for every access controllers that this transaction is allowed to go through
325325
for _, accessControl := range pool.accessControllers {
326326
if !accessControl.IsAllowed(from, tx) {
327-
log.Warn("Transaction is not allowed by access control", "from", from, "tx", tx.Hash(), "isBlockList", accessControl.IsBlocklist())
327+
log.Warn("Transaction is not allowed by access control",
328+
"from", from, "to", tx.To(), "tx", tx.Hash(), "isBlockList", accessControl.IsBlocklist())
328329
// If any access control doesn't allow
329330
return txpool.ErrTxIsUnauthorized
330331
}

0 commit comments

Comments
 (0)