Skip to content

Commit

Permalink
Log to addr when looping blocklist (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergerad authored Jan 23, 2025
1 parent 759552c commit 4012e7c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 183 deletions.

This file was deleted.

This file was deleted.

13 changes: 13 additions & 0 deletions core/txpool/immutable/accesscontrol/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ func TestImmutableAccessControl_Controller_IsAllowed(t *testing.T) {
addressToCheck: common.HexToAddress("0xabcdefabcdefabcdefabcdefabcdefabcdefabcdefab"),
expectedAllowed: true,
},
{
name: "AddressIsEmpty",
isAnAllowList: false,
providers: map[string]AddressProvider{
"list": &MockAddressProvider{
addresses: map[common.Address]struct{}{
common.HexToAddress("0x1234567890123456789012345678901234567890"): {},
},
},
},
addressToCheck: common.Address{},
expectedAllowed: true,
},
{
name: "AddressInAllowedAddresses",
isAnAllowList: true,
Expand Down
3 changes: 2 additions & 1 deletion core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ func (pool *LegacyPool) FilterWithError(tx *types.Transaction) error {
// Check for every access controllers that this transaction is allowed to go through
for _, accessControl := range pool.accessControllers {
if !accessControl.IsAllowed(from, tx) {
log.Warn("Transaction is not allowed by access control", "from", from, "tx", tx.Hash(), "isBlockList", accessControl.IsBlocklist())
log.Warn("Transaction is not allowed by access control",
"from", from, "to", tx.To(), "tx", tx.Hash(), "isBlockList", accessControl.IsBlocklist())
// If any access control doesn't allow
return txpool.ErrTxIsUnauthorized
}
Expand Down

0 comments on commit 4012e7c

Please sign in to comment.