Use latest XCM for teleport (#7033)

* Use latest XCM for teleport

* Cleanups

* CHANGELOG

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Jaco 2022-02-24 09:22:13 +01:00 committed by GitHub
parent 70f6b70368
commit ab4c82f8b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 9 deletions

View File

@ -1,5 +1,12 @@
# CHANGELOG
## master
Changes:
- Adjust teleport to only cater for latest XCM
## 0.106.1 Feb 14, 2022
Contributed:

View File

@ -77,19 +77,47 @@ function Teleport ({ onClose }: Props): React.ReactElement<Props> | null {
const params = useMemo(
() => [
{
V0: isParaTeleport
? { X1: 'Parent' }
: { X1: { ParaChain: recipientParaId } }
V1: isParaTeleport
? {
interior: 'Here',
parents: 1
}
: {
interior: {
X1: {
ParaChain: recipientParaId
}
},
parents: 0
}
},
{
V0: { X1: { AccountId32: { id: api.createType('AccountId32', recipientId).toHex(), network: 'Any' } } }
V1: {
interior: {
X1: {
AccountId32: {
id: api.createType('AccountId32', recipientId).toHex(),
network: 'Any'
}
}
},
parents: 0
}
},
{
V0: [
isParaTeleport
? { ConcreteFungible: { amount, id: { X1: 'Parent' } } }
: { ConcreteFungible: { amount } }
]
V1: [{
fun: {
Fungible: amount
},
id: {
Concrete: {
interior: 'Here',
parents: isParaTeleport
? 1
: 0
}
}
}]
},
0,
{ Unlimited: null }