get unique authorities fix

This commit is contained in:
Nour Alharithi
2023-12-06 17:49:23 -08:00
parent 2aff4a29e2
commit 4ea2888455

View File

@@ -57,11 +57,12 @@ export function getDLOBProviderFromOrderSubscriber(
return await orderSubscriber.getDLOB(slot); return await orderSubscriber.getDLOB(slot);
}, },
getUniqueAuthorities: () => { getUniqueAuthorities: () => {
const authorities = new Set<PublicKey>(); const authorities = new Set<string>();
for (const { userAccount } of orderSubscriber.usersAccounts.values()) { for (const { userAccount } of orderSubscriber.usersAccounts.values()) {
authorities.add(userAccount.authority); authorities.add(userAccount.authority.toBase58());
} }
return Array.from(authorities.values()); const pubkeys = Array.from(authorities).map((a) => new PublicKey(a));
return pubkeys;
}, },
getUserAccounts: function* () { getUserAccounts: function* () {
for (const [ for (const [
@@ -95,11 +96,12 @@ export function getDLOBProviderFromGrpcOrderSubscriber(
return await orderSubscriber.getDLOB(slot); return await orderSubscriber.getDLOB(slot);
}, },
getUniqueAuthorities: () => { getUniqueAuthorities: () => {
const authorities = new Set<PublicKey>(); const authorities = new Set<string>();
for (const { userAccount } of orderSubscriber.usersAccounts.values()) { for (const { userAccount } of orderSubscriber.usersAccounts.values()) {
authorities.add(userAccount.authority); authorities.add(userAccount.authority.toBase58());
} }
return Array.from(authorities.values()); const pubkeys = Array.from(authorities).map((a) => new PublicKey(a));
return pubkeys;
}, },
getUserAccounts: function* () { getUserAccounts: function* () {
for (const [ for (const [