File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change 4
4
from solana .publickey import PublicKey
5
5
from solana .rpc .async_api import AsyncClient
6
6
from solana .rpc .commitment import Commitment
7
- from solana .transaction import SIG_LENGTH , Transaction
8
- from solana .utils import shortvec_encoding as shortvec
7
+ from solana .transaction import Transaction
9
8
10
9
from program_admin .types import (
11
10
Network ,
@@ -35,23 +34,9 @@ async def recent_blockhash(client: AsyncClient) -> Blockhash:
35
34
def compute_transaction_size (transaction : Transaction ) -> int :
36
35
"""
37
36
Returns the total over-the-wire size of a transaction
38
-
39
- This is the same code from solana.transaction.Transaction.__serialize()
40
37
"""
41
- payload = bytearray ()
42
- signature_count = shortvec .encode_length (len (transaction .signatures ))
43
-
44
- payload .extend (signature_count )
45
-
46
- for sig_pair in transaction .signatures :
47
- if sig_pair .signature :
48
- payload .extend (sig_pair .signature )
49
- else :
50
- payload .extend (bytearray (SIG_LENGTH ))
51
-
52
- payload .extend (transaction .serialize_message ())
53
38
54
- return len (payload )
39
+ return len (transaction . serialize () )
55
40
56
41
57
42
def encode_product_metadata (data : Dict [str , str ]) -> bytes :
You can’t perform that action at this time.
0 commit comments