Skip to content

Commit 6954b85

Browse files
authored
oracle.rs: hotfix: Remove stray loop break (#66)
* oracle.rs: hotfix: Remove stray loop break * test_integration.py: add a second publisher for permissions testing * nudge GitHub * nudge GitHub #2
1 parent 85d6b15 commit 6954b85

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

integration-tests/tests/test_integration.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@
4141
MAPPING_KEYPAIR = [62, 251, 237, 123, 32, 23, 77, 112, 75, 109, 141, 142, 101, 235, 231, 46, 82, 224, 124, 182, 136, 15, 157, 13, 130, 60, 8, 251, 212, 255,
4242
116, 8, 155, 81, 141, 223, 90, 30, 205, 238, 119, 249, 130, 159, 191, 87, 136, 130, 225, 86, 103, 26, 255, 105, 59, 48, 101, 66, 157, 174, 106, 186, 51, 72]
4343
# 5F1MvPpfXytDPJb7beKiFEzdMacbzc5DmKrHzvzEorH8
44-
PUBLISHER_KEYPAIR = [28, 188, 185, 140, 54, 34, 203, 52, 83, 136, 217, 69, 104, 188, 165, 215, 42, 23, 73, 14, 87, 84, 155, 47, 91, 166, 208, 129, 10,
44+
PUBLISHER_A_KEYPAIR = [28, 188, 185, 140, 54, 34, 203, 52, 83, 136, 217, 69, 104, 188, 165, 215, 42, 23, 73, 14, 87, 84, 155, 47, 91, 166, 208, 129, 10,
4545
67, 4, 72, 63, 5, 73, 112, 194, 37, 117, 20, 46, 66, 102, 78, 196, 75, 127, 90, 40, 85, 69, 209, 12, 237, 118, 39, 218, 157, 86, 251, 112, 61, 104, 235]
4646

47+
# EQjeRFrUBCk9Yt6HbCUZoShUDG8QhuX8CUh9hcD3gqZm, Second publisher for testing permissions detection
48+
PUBLISHER_B_KEYPAIR = [94,185,219,129,20,106,33,15,92,150,244,78,159,73,148,43,52,86,182,193,131,195,8,93,20,91,240,33,173,131,180,208,199,60,129,246,111,102,62,32,44,173,40,199,252,189,66,175,78,166,91,83,251,253,236,177,159,15,91,231,25,149,162,164]
49+
4750
# NOTE: Set to a value to run agent with accumulator support. Should be used with a pythnet validator, set below.
4851
USE_ACCUMULATOR = os.environ.get("USE_ACCUMULATOR") is not None
4952

@@ -258,8 +261,10 @@ def refdata_products(self, refdata_path):
258261
def refdata_publishers(self, refdata_path):
259262
path = os.path.join(refdata_path, 'publishers.json')
260263
with open(path, 'w') as f:
261-
f.write(json.dumps({"some_publisher": str(
262-
Keypair.from_secret_key(PUBLISHER_KEYPAIR).public_key)}))
264+
f.write(json.dumps({"some_publisher_a": str(
265+
Keypair.from_secret_key(PUBLISHER_A_KEYPAIR).public_key),
266+
"some_publisher_b": str(Keypair.from_secret_key(PUBLISHER_B_KEYPAIR).public_key)
267+
}))
263268
f.flush()
264269
yield f.name
265270

@@ -268,9 +273,9 @@ def refdata_permissions(self, refdata_path):
268273
path = os.path.join(refdata_path, 'permissions.json')
269274
with open(path, 'w') as f:
270275
f.write(json.dumps({
271-
"AAPL": {"price": ["some_publisher"]},
272-
"BTCUSD": {"price": ["some_publisher"]},
273-
"ETHUSD": {"price": []},
276+
"AAPL": {"price": ["some_publisher_a"]},
277+
"BTCUSD": {"price": ["some_publisher_b", "some_publisher_a"]}, # Reversed order helps ensure permission discovery works correctly for publisher A
278+
"ETHUSD": {"price": ["some_publisher_b"]},
274279
}))
275280
f.flush()
276281
yield f.name
@@ -313,7 +318,7 @@ def agent_keystore_path(self, tmp_path):
313318
def agent_publish_keypair(self, agent_keystore_path, sync_accounts):
314319
path = os.path.join(agent_keystore_path, "publish_key_pair.json")
315320
with open(path, 'w') as f:
316-
f.write(json.dumps(PUBLISHER_KEYPAIR))
321+
f.write(json.dumps(PUBLISHER_A_KEYPAIR))
317322
f.flush()
318323

319324
LOGGER.debug("Airdropping SOL to publish keypair at %s", path)
@@ -522,7 +527,7 @@ async def test_update_price_simple(self, client: PythAgentClient):
522527
async def test_update_price_simple_with_keypair_hotload(self, client_hotload: PythAgentClient):
523528

524529
# Hotload the keypair into running agent
525-
hl_request = requests.post("http://localhost:9001/primary/load_keypair", json=PUBLISHER_KEYPAIR)
530+
hl_request = requests.post("http://localhost:9001/primary/load_keypair", json=PUBLISHER_A_KEYPAIR)
526531

527532
# Verify succesful hotload
528533
assert hl_request.status_code == 200

src/agent/solana/oracle.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ impl Poller {
436436
.or_insert(HashSet::new());
437437

438438
component_pub_entry.insert(price_key.clone());
439-
break;
440439
}
441440
}
442441

0 commit comments

Comments
 (0)