Update relaytester-test.sh log level to off and improve follows key decoding logic in ACL implementation for clarity and error handling.
This commit is contained in:
@@ -69,8 +69,10 @@ func (f *Follows) Configure(cfg ...any) (err error) {
|
|||||||
for _, admin := range f.cfg.Admins {
|
for _, admin := range f.cfg.Admins {
|
||||||
log.I.F("%s", admin)
|
log.I.F("%s", admin)
|
||||||
var adm []byte
|
var adm []byte
|
||||||
if adm, err = bech32encoding.NpubOrHexToPublicKeyBinary(admin); chk.E(err) {
|
if a, e := bech32encoding.NpubOrHexToPublicKeyBinary(admin); chk.E(e) {
|
||||||
continue
|
continue
|
||||||
|
} else {
|
||||||
|
adm = a
|
||||||
}
|
}
|
||||||
log.I.F("admin: %0x", adm)
|
log.I.F("admin: %0x", adm)
|
||||||
f.admins = append(f.admins, adm)
|
f.admins = append(f.admins, adm)
|
||||||
@@ -100,8 +102,10 @@ func (f *Follows) Configure(cfg ...any) (err error) {
|
|||||||
for _, v := range ev.Tags.GetAll([]byte("p")) {
|
for _, v := range ev.Tags.GetAll([]byte("p")) {
|
||||||
log.I.F("adding follow: %s", v.Value())
|
log.I.F("adding follow: %s", v.Value())
|
||||||
var a []byte
|
var a []byte
|
||||||
if a, err = hex.Dec(string(v.Value())); chk.E(err) {
|
if b, e := hex.Dec(string(v.Value())); chk.E(e) {
|
||||||
continue
|
continue
|
||||||
|
} else {
|
||||||
|
a = b
|
||||||
}
|
}
|
||||||
f.follows = append(f.follows, a)
|
f.follows = append(f.follows, a)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ if ! command -v "relay-tester" &> /dev/null; then
|
|||||||
echo "./scripts/relaytester-install.sh"
|
echo "./scripts/relaytester-install.sh"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
export ORLY_LOG_LEVEL=trace
|
export ORLY_LOG_LEVEL=off
|
||||||
export ORLY_LISTEN=127.0.0.1
|
export ORLY_LISTEN=127.0.0.1
|
||||||
export ORLY_PORT=3334
|
export ORLY_PORT=3334
|
||||||
export ORLY_IP_WHITELIST=127.0.0
|
export ORLY_IP_WHITELIST=127.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user