Skip to content

Commit b689c44

Browse files
authored
Fix program_id to be a pubkey instead of a string (#26)
* Fix program_id to be a pubkey instead of a string * Fix dump
1 parent 76b9df0 commit b689c44

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

program_admin/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
from dataclasses import asdict
55
from pathlib import Path
6-
from typing import Dict, List, Literal, Tuple
6+
from typing import Any, Dict, List, Literal, Tuple
77

88
from loguru import logger
99
from solana import system_program
@@ -173,8 +173,8 @@ async def send_transaction(
173173
if dump_instructions:
174174
dump_output = []
175175
for instruction in instructions:
176-
instruction_output = {
177-
"program_id": instruction.program_id,
176+
instruction_output: Dict[str, Any] = {
177+
"program_id": str(instruction.program_id),
178178
"data": instruction.data.hex(),
179179
}
180180
accounts = []

program_admin/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ def set_minimum_publishers_for_price(
104104
funding_keypair = load_keypair("funding", key_dir=keys)
105105
price_keypair = load_keypair(PublicKey(price), key_dir=keys)
106106
instruction = instructions.set_minimum_publishers(
107-
program_key, funding_keypair.public_key, price_keypair.public_key, min_pub
107+
program_admin.program_key,
108+
funding_keypair.public_key,
109+
price_keypair.public_key,
110+
min_pub,
108111
)
109112

110113
asyncio.run(

tests/test_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ async def test_sync(
379379
product_accounts[0].data.first_price_account_key, key_dir=key_dir
380380
)
381381
min_pub_instruction = instructions.set_minimum_publishers(
382-
pyth_program, funding_key.public_key, price_keypair.public_key, 10
382+
program_admin.program_key, funding_key.public_key, price_keypair.public_key, 10
383383
)
384384

385385
# Test instruction print output

0 commit comments

Comments
 (0)