mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-01 03:07:23 +00:00
Squashed 'bridges/' content from commit 062554430
git-subtree-dir: bridges git-subtree-split: 0625544309ff299307f7e110f252f04eac383102
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
# The script generates JSON type definition files in `./deployment` directory to be used for
|
||||
# JS clients.
|
||||
#
|
||||
# It works by creating definitions for each side of the different bridge pairs we support
|
||||
# (Rialto<>Millau at the moment).
|
||||
#
|
||||
# To avoid duplication each bridge pair has a JSON file with common definitions, as well as a
|
||||
# general JSON file with common definitions regardless of the bridge pair. These files are then
|
||||
# merged with chain-specific type definitions.
|
||||
|
||||
set -eux
|
||||
|
||||
# Make sure we are in the right dir.
|
||||
cd $(dirname $(realpath $0))
|
||||
|
||||
# Create types for our supported bridge pairs (Rialto<>Millau)
|
||||
jq -s '.[0] * .[1] * .[2]' rialto-millau.json common.json rialto.json > ../types-rialto.json
|
||||
jq -s '.[0] * .[1] * .[2]' rialto-millau.json common.json millau.json > ../types-millau.json
|
||||
@@ -0,0 +1,124 @@
|
||||
{
|
||||
"--3": "Common types",
|
||||
"AccountSigner": "MultiSigner",
|
||||
"SpecVersion": "u32",
|
||||
"RelayerId": "AccountId",
|
||||
"SourceAccountId": "AccountId",
|
||||
"ImportedHeader": {
|
||||
"header": "BridgedHeader",
|
||||
"requires_justification": "bool",
|
||||
"is_finalized": "bool",
|
||||
"signal_hash": "Option<BridgedBlockHash>"
|
||||
},
|
||||
"AuthoritySet": {
|
||||
"authorities": "AuthorityList",
|
||||
"set_id": "SetId"
|
||||
},
|
||||
"Id": "[u8; 4]",
|
||||
"ChainId": "Id",
|
||||
"LaneId": "Id",
|
||||
"MessageNonce": "u64",
|
||||
"BridgeMessageId": "(Id, u64)",
|
||||
"MessageKey": {
|
||||
"lane_id": "LaneId",
|
||||
"nonce:": "MessageNonce"
|
||||
},
|
||||
"InboundRelayer": "AccountId",
|
||||
"InboundLaneData": {
|
||||
"relayers": "Vec<UnrewardedRelayer>",
|
||||
"last_confirmed_nonce": "MessageNonce"
|
||||
},
|
||||
"UnrewardedRelayer": {
|
||||
"relayer": "RelayerId",
|
||||
"messages": "DeliveredMessages"
|
||||
},
|
||||
"DeliveredMessages": {
|
||||
"begin": "MessageNonce",
|
||||
"end": "MessageNonce",
|
||||
"dispatch_results": "BitVec"
|
||||
},
|
||||
"OutboundLaneData": {
|
||||
"oldest_unpruned_nonce": "MessageNonce",
|
||||
"latest_received_nonce": "MessageNonce",
|
||||
"latest_generated_nonce": "MessageNonce"
|
||||
|
||||
},
|
||||
"MessageData": {
|
||||
"payload": "MessagePayload",
|
||||
"fee": "Fee"
|
||||
},
|
||||
"MessagePayload": "Vec<u8>",
|
||||
"BridgedOpaqueCall": "Vec<u8>",
|
||||
"OutboundMessageFee": "Fee",
|
||||
"OutboundPayload": {
|
||||
"spec_version": "SpecVersion",
|
||||
"weight": "Weight",
|
||||
"origin": "CallOrigin",
|
||||
"dispatch_fee_payment": "DispatchFeePayment",
|
||||
"call": "BridgedOpaqueCall"
|
||||
},
|
||||
"CallOrigin": {
|
||||
"_enum": {
|
||||
"SourceRoot": "()",
|
||||
"TargetAccount": "(SourceAccountId, MultiSigner, MultiSignature)",
|
||||
"SourceAccount": "SourceAccountId"
|
||||
}
|
||||
},
|
||||
"DispatchFeePayment": {
|
||||
"_enum": {
|
||||
"AtSourceChain": "()",
|
||||
"AtTargetChain": "()"
|
||||
}
|
||||
},
|
||||
"MultiSigner": {
|
||||
"_enum": {
|
||||
"Ed25519": "H256",
|
||||
"Sr25519": "H256",
|
||||
"Ecdsa": "[u8;33]"
|
||||
}
|
||||
},
|
||||
"MessagesProofOf": {
|
||||
"bridged_header_hash": "BridgedBlockHash",
|
||||
"storage_proof": "Vec<StorageProofItem>",
|
||||
"lane": "LaneId",
|
||||
"nonces_start": "MessageNonce",
|
||||
"nonces_end": "MessageNonce"
|
||||
},
|
||||
"StorageProofItem": "Vec<u8>",
|
||||
"MessagesDeliveryProofOf": {
|
||||
"bridged_header_hash": "BridgedBlockHash",
|
||||
"storage_proof": "Vec<StorageProofItem>",
|
||||
"lane": "LaneId"
|
||||
},
|
||||
"UnrewardedRelayersState": {
|
||||
"unrewarded_relayer_entries": "MessageNonce",
|
||||
"messages_in_oldest_entry": "MessageNonce",
|
||||
"total_messages": "MessageNonce"
|
||||
},
|
||||
"AncestryProof": "()",
|
||||
"MessageFeeData": {
|
||||
"lane_id": "LaneId",
|
||||
"payload": "OutboundPayload"
|
||||
},
|
||||
"Precommit": {
|
||||
"target_hash": "BridgedBlockHash",
|
||||
"target_number": "BridgedBlockNumber"
|
||||
},
|
||||
"AuthoritySignature": "[u8;64]",
|
||||
"AuthorityId": "[u8;32]",
|
||||
"SignedPrecommit": {
|
||||
"precommit": "Precommit",
|
||||
"signature": "AuthoritySignature",
|
||||
"id": "AuthorityId"
|
||||
},
|
||||
"Commit": {
|
||||
"target_hash": "BridgedBlockHash",
|
||||
"target_number": "BridgedBlockNumber",
|
||||
"precommits": "Vec<SignedPrecommit>"
|
||||
},
|
||||
"GrandpaJustification": {
|
||||
"round": "u64",
|
||||
"commit": "Commit",
|
||||
"votes_ancestries": "Vec<BridgedHeader>"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"Address": "MillauAddress",
|
||||
"LookupSource": "MillauLookupSource",
|
||||
"Fee": "MillauBalance",
|
||||
"Balance": "MillauBalance",
|
||||
"Hash": "MillauBlockHash",
|
||||
"BlockHash": "MillauBlockHash",
|
||||
"BlockNumber": "MillauBlockNumber",
|
||||
"BridgedBlockHash": "RialtoBlockHash",
|
||||
"BridgedBlockNumber": "RialtoBlockNumber",
|
||||
"BridgedHeader": "RialtoHeader",
|
||||
"Parameter": {
|
||||
"_enum": {
|
||||
"MillauToRialtoConversionRate": "u128"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"--1": "Millau Types",
|
||||
"MillauAddress": "AccountId",
|
||||
"MillauLookupSource": "AccountId",
|
||||
"MillauBalance": "u64",
|
||||
"MillauBlockHash": "H512",
|
||||
"MillauBlockNumber": "u64",
|
||||
"MillauHeader": {
|
||||
"parent_Hash": "MillauBlockHash",
|
||||
"number": "Compact<MillauBlockNumber>",
|
||||
"state_root": "MillauBlockHash",
|
||||
"extrinsics_root": "MillauBlockHash",
|
||||
"digest": "MillauDigest"
|
||||
},
|
||||
"MillauDigest": {
|
||||
"logs": "Vec<MillauDigestItem>"
|
||||
},
|
||||
"MillauDigestItem": {
|
||||
"_enum": {
|
||||
"Other": "Vec<u8>",
|
||||
"AuthoritiesChange": "Vec<AuthorityId>",
|
||||
"ChangesTrieRoot": "MillauBlockHash",
|
||||
"SealV0": "SealV0",
|
||||
"Consensus": "Consensus",
|
||||
"Seal": "Seal",
|
||||
"PreRuntime": "PreRuntime"
|
||||
}
|
||||
},
|
||||
"--2": "Rialto Types",
|
||||
"RialtoAddress": "MultiAddress",
|
||||
"RialtoLookupSource": "MultiAddress",
|
||||
"RialtoBalance": "u128",
|
||||
"RialtoBlockHash": "H256",
|
||||
"RialtoBlockNumber": "u32",
|
||||
"RialtoHeader": {
|
||||
"parent_Hash": "RialtoBlockHash",
|
||||
"number": "Compact<RialtoBlockNumber>",
|
||||
"state_root": "RialtoBlockHash",
|
||||
"extrinsics_root": "RialtoBlockHash",
|
||||
"digest": "RialtoDigest"
|
||||
},
|
||||
"RialtoDigest": {
|
||||
"logs": "Vec<RialtoDigestItem>"
|
||||
},
|
||||
"RialtoDigestItem": {
|
||||
"_enum": {
|
||||
"Other": "Vec<u8>",
|
||||
"AuthoritiesChange": "Vec<AuthorityId>",
|
||||
"ChangesTrieRoot": "RialtoBlockHash",
|
||||
"SealV0": "SealV0",
|
||||
"Consensus": "Consensus",
|
||||
"Seal": "Seal",
|
||||
"PreRuntime": "PreRuntime"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"Address": "RialtoAddress",
|
||||
"LookupSource": "RialtoLookupSource",
|
||||
"Fee": "RialtoBalance",
|
||||
"Balance": "RialtoBalance",
|
||||
"BlockHash": "RialtoBlockHash",
|
||||
"BlockNumber": "RialtoBlockNumber",
|
||||
"BridgedBlockHash": "MillauBlockHash",
|
||||
"BridgedBlockNumber": "MillauBlockNumber",
|
||||
"BridgedHeader": "MillauHeader",
|
||||
"Parameter": {
|
||||
"_enum": {
|
||||
"RialtoToMillauConversionRate": "u128"
|
||||
}
|
||||
},
|
||||
"ValidationCodeHash": "H256"
|
||||
}
|
||||
Reference in New Issue
Block a user