Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed Feb 1, 2024
1 parent ea58e09 commit 72d6014
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/authn/transport_authentication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (

sampleAuthReq002 = testCase{
peerID: "QmfNjjEotVgJThmd8TKkKVMDHJ1BFvS99vaHdHsLk5Xhsy",
walletAddr: "0x9997a0890Dad1E14d1E4F278d8Fde501eD21b94F",
walletAddr: "0x9997a0890dad1E14d1E4f278d8Fde501ed21b94f",
reqBytes: "0abf020a4c08bebb8f8096301a430a4104d04d4cc9588d98039db2ab046649edc4239832c6659040f1e15030c61b54e95887a64cae48a1fc47285ec07ac460444ededc38d41be98941829b57c8b84ea84312440a420a406bd28720cadc85f397d8a81459d8c5ef0d7d840127e15b3e8e9d7e030d71fedd130f4fe6d7fda9ddac3250ccae31a029ffe3c7b07fdd7f10bf6f6d2a02c8d5f21a630a2a307839393937613038393044616431453134643145344632373864384664653530316544323162393446122e516d664e6a6a456f7456674a54686d6438544b6b4b564d44484a314246765339397661486448734c6b355868737918c7bd8f80963022440a420a40d896755b06fdaad912ef1e58ad197e6ce68c00afd3c9fd8f0eaf3ea49b9027632c22c7d3aa168875eead1fbde1ca3810be18ee22b4fa19cf9fde643c74f30a49",
}
)
Expand Down
7 changes: 7 additions & 0 deletions pkg/authz/wallet_allow_lister_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"os"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -67,15 +68,21 @@ func TestPermissionCheck(t *testing.T) {
for _, wallet := range wallets {
expectedValue := wallet.Permission
isAllowed := allowLister.IsAllowListed(wallet.WalletAddress)
isAllowedLower := allowLister.IsAllowListed(strings.ToLower(wallet.WalletAddress))
isDenied := allowLister.IsDenyListed(wallet.WalletAddress)
isDeniedLower := allowLister.IsDenyListed(strings.ToLower(wallet.WalletAddress))
permission := allowLister.GetPermissions(wallet.WalletAddress)
if expectedValue == "allow" {
require.Equal(t, isAllowed, true)
require.Equal(t, isAllowedLower, true)
require.Equal(t, isDenied, false)
require.Equal(t, isDeniedLower, false)
require.Equal(t, permission, Allowed)
} else {
require.Equal(t, isAllowed, false)
require.Equal(t, isAllowedLower, false)
require.Equal(t, isDenied, true)
require.Equal(t, isDeniedLower, true)
require.Equal(t, permission, Denied)
}
}
Expand Down

0 comments on commit 72d6014

Please sign in to comment.