Skip to content

Commit 1537f23

Browse files
author
jaypan
committed
Refine
1 parent 953d3dd commit 1537f23

File tree

3 files changed

+3
-25
lines changed

3 files changed

+3
-25
lines changed

tests/bridge_xcmutils_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def setUp(self):
4444
self.setup_sibling_parachain_account()
4545

4646
# Just calculate the sibling parachain account by moonbeam's xcm-utils tool
47-
# Here is the comment but remember to change the parachain id
47+
# Here is the command but remember to change the parachain id
4848
# yarn calculate-multilocation-derivative-account --a 0x55eebfdbb6af8aecbc9664bb229c48e2fceb381ce9d93a3ed698d4177da3e8e6 --p 2000 --parents
4949
def setup_sibling_parachain_account(self):
5050
# substrate addr is 5E1NrJDAqp5R3JDBBn2JGaHpUMo5kbCNXtV2asLzaw2MZfwr
@@ -170,7 +170,7 @@ def _compose_xcm_send_message_dict(self, kp):
170170
'parents': '1',
171171
'interior': {
172172
'X1': [{
173-
'Parachain': '3000'
173+
'Parachain': str(ACA_PD_CHAIN_ID)
174174
}]
175175
},
176176
}},

tests/xcm_send_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def setUp(self):
3131
self.setup_sibling_parachain_account()
3232

3333
# Just calculate the sibling parachain account by moonbeam's xcm-utils tool
34-
# Here is the comment but remember to change the parachain id
34+
# Here is the command but remember to change the parachain id
3535
# yarn calculate-multilocation-derivative-account --a 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d --p 2000 --parents
3636
def setup_sibling_parachain_account(self):
3737
chain_spec = get_chain(self.si_peaq)

tools/utils.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55
from peaq import utils as PeaqUtils
66
PeaqUtils.DEBUG = True
77

8-
# from scalecodec.types import U32
9-
# from scalecodec.utils.ss58 import ss58_encode
108
from tools.constants import PARACHAIN_WS_URL, TOKEN_NUM_BASE, KP_GLOBAL_SUDO
119
from substrateinterface import SubstrateInterface
1210
from substrateinterface import Keypair
1311
from peaq.utils import get_account_balance, show_extrinsic
1412
from peaq.sudo_extrinsic import fund
1513
from peaq.eth import calculate_evm_addr
1614
from peaq.utils import calculate_multi_sig
17-
# from substrateinterface.utils import hasher
1815

1916
# Monkey patch
2017
from scalecodec.types import FixedLengthArray
@@ -466,25 +463,6 @@ def get_balance_reserve_value(substrate, account, key):
466463
return 0
467464

468465

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-
488466
if __name__ == '__main__':
489467
data = '5F1e2nuSgxwWZiL9jTxv3jrMQHeHHhuwP7oDmU87SMp1Ncxv'
490468
print(calculate_evm_addr(data))

0 commit comments

Comments
 (0)