|
5 | 5 | from peaq import utils as PeaqUtils
|
6 | 6 | PeaqUtils.DEBUG = True
|
7 | 7 |
|
8 |
| -# from scalecodec.types import U32 |
9 |
| -# from scalecodec.utils.ss58 import ss58_encode |
10 | 8 | from tools.constants import PARACHAIN_WS_URL, TOKEN_NUM_BASE, KP_GLOBAL_SUDO
|
11 | 9 | from substrateinterface import SubstrateInterface
|
12 | 10 | from substrateinterface import Keypair
|
13 | 11 | from peaq.utils import get_account_balance, show_extrinsic
|
14 | 12 | from peaq.sudo_extrinsic import fund
|
15 | 13 | from peaq.eth import calculate_evm_addr
|
16 | 14 | from peaq.utils import calculate_multi_sig
|
17 |
| -# from substrateinterface.utils import hasher |
18 | 15 |
|
19 | 16 | # Monkey patch
|
20 | 17 | from scalecodec.types import FixedLengthArray
|
@@ -466,25 +463,6 @@ def get_balance_reserve_value(substrate, account, key):
|
466 | 463 | return 0
|
467 | 464 |
|
468 | 465 |
|
469 |
| -# def get_parachain_sovereign_account(para_id, chain_type='para'): |
470 |
| -# scale_encoded = chain_type.encode().hex() |
471 |
| -# scale_encoded += U32(ScaleBytes(bytearray())).encode(para_id).to_hex()[2:] |
472 |
| -# public_key = f"0x{scale_encoded + ''.join(['0' * (64 - len(scale_encoded))])}" |
473 |
| -# print( |
474 |
| -# f'\t Account ID:\t{public_key}\n' + |
475 |
| -# f'\tSS58 Address:\t{ss58_encode(public_key)}' |
476 |
| -# ) |
477 |
| -# |
478 |
| -# |
479 |
| -# def get_sibling_chain_account(substrate, parachain_id, ss58_addr): |
480 |
| -# loc = b"SilbingChain" + bytes(str(parachain_id), 'utf-8') |
481 |
| -# # loc = b"SilbingChain" + bytes.fromhex(str(substrate.encode_scale('Compact<u32>', parachain_id))[2:]) |
482 |
| -# pk = bytes.fromhex('0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'[2:]) |
483 |
| -# loc += b"AccountId32" + pk |
484 |
| -# # loc += b"AccountId32" + Keypair(ss58_address=ss58_addr).public_key |
485 |
| -# return f'0x{hasher.blake2_256(loc).hex()}' |
486 |
| - |
487 |
| - |
488 | 466 | if __name__ == '__main__':
|
489 | 467 | data = '5F1e2nuSgxwWZiL9jTxv3jrMQHeHHhuwP7oDmU87SMp1Ncxv'
|
490 | 468 | print(calculate_evm_addr(data))
|
0 commit comments