mirror of https://github.com/poanetwork/quorum.git
permission: increased the LRU cache size for permissions
This commit is contained in:
parent
3242dc85f7
commit
3f88b216b7
|
@ -172,7 +172,7 @@ var QIP714BlockReached = false
|
|||
var networkAdminRole string
|
||||
var orgAdminRole string
|
||||
|
||||
const defaultMapLimit = 100
|
||||
const defaultMapLimit = 1000000
|
||||
|
||||
var OrgInfoMap = NewOrgCache()
|
||||
var NodeInfoMap = NewNodeCache()
|
||||
|
|
|
@ -3,6 +3,7 @@ package types
|
|||
import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
|
@ -230,3 +231,14 @@ func TestValidateNodeForTxn_whenUsingOnlyHexNodeId(t *testing.T) {
|
|||
|
||||
testifyassert.False(t, txnAllowed)
|
||||
}
|
||||
|
||||
// test the cache limit
|
||||
func TestLRUCacheLimit(t *testing.T) {
|
||||
for i := 0; i < defaultMapLimit ; i++ {
|
||||
orgName := "ORG" + strconv.Itoa(i)
|
||||
OrgInfoMap.UpsertOrg(orgName, "", NETWORKADMIN, big.NewInt(1), OrgApproved)
|
||||
}
|
||||
|
||||
o := OrgInfoMap.GetOrg("ORG1")
|
||||
testifyassert.True(t, o != nil)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue