Skip to content

Commit

Permalink
update types (#56)
Browse files Browse the repository at this point in the history
* update types

* linting
  • Loading branch information
Leouarz authored Mar 19, 2024
1 parent 9d5c475 commit 433d8f9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const definitions: OverrideBundleDefinition = {
],
type: 'Vec<Option<Vec<u8>>>'
},
queryDataProofV2: {
queryDataProof: {
description: 'Generate the data proof for the given `transaction_index`',
params: [
{
Expand Down Expand Up @@ -144,13 +144,6 @@ const definitions: OverrideBundleDefinition = {
mandatory: 'u32'
},
DataProof: {
root: 'H256',
proof: 'Vec<H256>',
numberOfLeaves: 'Compact<u32>',
leafIndex: 'Compact<u32>',
leaf: 'H256'
},
DataProofV2: {
dataRoot: 'H256',
blobRoot: 'H256',
bridgeRoot: 'H256',
Expand All @@ -160,24 +153,35 @@ const definitions: OverrideBundleDefinition = {
leaf: 'H256'
},
ProofResponse: {
dataProof: 'DataProofV2',
message: 'Option<Message>'
dataProof: 'DataProof',
message: 'Option<AddressedMessage>'
},
Message: {
messageType: 'MessageType',
AddressedMessage: {
message: 'Message',
from: 'H256',
to: 'H256',
originDomain: 'u32',
destinationDomain: 'u32',
data: 'Vec<u8>',
id: 'u64'
},
Message: {
_enum: {
ArbitraryMessage: 'ArbitraryMessage',
FungibleToken: 'FungibleToken'
}
},
MessageType: {
_enum: [
'ArbitraryMessage',
'FungibleToken'
]
},
FungibleToken: {
asset_id: 'H256',
amount: 'String'
},
BoundedData: 'Vec<u8>',
ArbitraryMessage: 'BoundedData',
Cell: {
row: 'BlockLengthRows',
col: 'BlockLengthColumns'
Expand Down
5 changes: 2 additions & 3 deletions packages/apps-config/src/api/spec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import aresGladios from './ares-gladios.js';
import aresParachain from './ares-parachain.js';
import astar from './astar.js';
import automata from './automata.js';
import avail from './avail.js';
import bajun from './bajun.js';
import basilisk from './basilisk.js';
import beresheet from './beresheet.js';
Expand All @@ -34,7 +35,6 @@ import crust from './crust.js';
import testPara from './cumulus-test-parachain.js';
import curio from './curio.js';
import darwinia from './darwinia.js';
import dataavail from './dataavail.js';
import datahighwayParachain from './datahighway.js';
import dockMainnet from './dock-mainnet.js';
import dockTestnet from './dock-testnet.js';
Expand Down Expand Up @@ -162,7 +162,7 @@ const spec: Record<string, OverrideBundleDefinition> = {
asgard: bifrostAsgard,
astar,
automata,
avail: dataavail,
avail,
bajun,
basilisk,
beresheet,
Expand All @@ -187,7 +187,6 @@ const spec: Record<string, OverrideBundleDefinition> = {
'cumulus-test-parachain': testPara,
'curio-mainnet': curio,
'curio-testnet': curio,
'data-avail': dataavail,
datahighway: westlake,
'datahighway-parachain': datahighwayParachain,
dawn: eave,
Expand Down
204 changes: 16 additions & 188 deletions packages/apps-config/src/api/typesBundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48603,7 +48603,7 @@ export const typesBundle = {
]
}
},
"data-avail": {
"avail": {
"rpc": {
"kate": {
"blockLength": {
Expand Down Expand Up @@ -48647,7 +48647,7 @@ export const typesBundle = {
],
"type": "Vec<Option<Vec<u8>>>"
},
"queryDataProofV2": {
"queryDataProof": {
"description": "Generate the data proof for the given `transaction_index`",
"params": [
{
Expand Down Expand Up @@ -48742,7 +48742,7 @@ export const typesBundle = {
"operational": "u32",
"mandatory": "u32"
},
"DataProofV2": {
"DataProof": {
"dataRoot": "H256",
"blobRoot": "H256",
"bridgeRoot": "H256",
Expand All @@ -48752,207 +48752,35 @@ export const typesBundle = {
"leaf": "H256"
},
"ProofResponse": {
"dataProof": "DataProofV2",
"message": "Option<Message>"
"dataProof": "DataProof",
"message": "Option<AddressedMessage>"
},
"Message": {
"messageType": "MessageType",
"AddressedMessage": {
"message": "Message",
"from": "H256",
"to": "H256",
"originDomain": "u32",
"destinationDomain": "u32",
"data": "Vec<u8>",
"id": "u64"
},
"MessageType": {
"_enum": [
"ArbitraryMessage",
"FungibleToken"
]
},
"Cell": {
"row": "BlockLengthRows",
"col": "BlockLengthColumns"
}
}
}
],
"signedExtensions": {
"CheckAppId": {
"extrinsic": {
"appId": "AppId"
},
"payload": {}
}
}
},
"avail": {
"rpc": {
"kate": {
"blockLength": {
"description": "Get Block Length",
"params": [
{
"name": "at",
"type": "Hash",
"isOptional": true
}
],
"type": "BlockLength"
},
"queryProof": {
"description": "Generate the kate proof for the given `cells`",
"params": [
{
"name": "cells",
"type": "Vec<Cell>"
},
{
"name": "at",
"type": "Hash",
"isOptional": true
}
],
"type": "Vec<(U256, [u8; 48])>"
},
"queryAppData": {
"description": "Fetches app data rows for the given app",
"params": [
{
"name": "app_id",
"type": "AppId"
},
{
"name": "at",
"type": "Hash",
"isOptional": true
}
],
"type": "Vec<Option<Vec<u8>>>"
},
"queryDataProofV2": {
"description": "Generate the data proof for the given `transaction_index`",
"params": [
{
"name": "transaction_index",
"type": "u32"
},
{
"name": "at",
"type": "Hash",
"isOptional": true
}
],
"type": "ProofResponse"
},
"queryRows": {
"description": "Query rows based on their indices",
"params": [
{
"name": "rows",
"type": "Vec<u32>"
},
{
"name": "at",
"type": "Hash",
"isOptional": true
}
],
"type": "Vec<Vec<u8>>"
}
}
},
"types": [
{
"minmax": [
0,
null
],
"types": {
"AppId": "Compact<u32>",
"DataLookupIndexItem": {
"appId": "AppId",
"start": "Compact<u32>"
},
"DataLookup": {
"size": "Compact<u32>",
"index": "Vec<DataLookupIndexItem>"
},
"KateCommitment": {
"rows": "Compact<u16>",
"cols": "Compact<u16>",
"commitment": "Vec<u8>",
"dataRoot": "H256"
},
"V3HeaderExtension": {
"appLookup": "DataLookup",
"commitment": "KateCommitment"
},
"HeaderExtension": {
"Message": {
"_enum": {
"V1": "V3HeaderExtension",
"V2": "V3HeaderExtension",
"V3": "V3HeaderExtension"
"ArbitraryMessage": "ArbitraryMessage",
"FungibleToken": "FungibleToken"
}
},
"DaHeader": {
"parentHash": "Hash",
"number": "Compact<BlockNumber>",
"stateRoot": "Hash",
"extrinsicsRoot": "Hash",
"digest": "Digest",
"extension": "HeaderExtension"
},
"Header": "DaHeader",
"CheckAppIdExtra": {
"appId": "AppId"
},
"CheckAppIdTypes": {},
"CheckAppId": {
"extra": "CheckAppIdExtra",
"types": "CheckAppIdTypes"
},
"BlockLengthColumns": "Compact<u32>",
"BlockLengthRows": "Compact<u32>",
"BlockLength": {
"max": "PerDispatchClass",
"cols": "BlockLengthColumns",
"rows": "BlockLengthRows",
"chunkSize": "Compact<u32>"
},
"PerDispatchClass": {
"normal": "u32",
"operational": "u32",
"mandatory": "u32"
},
"DataProofV2": {
"dataRoot": "H256",
"blobRoot": "H256",
"bridgeRoot": "H256",
"proof": "Vec<H256>",
"numberOfLeaves": "Compact<u32>",
"leafIndex": "Compact<u32>",
"leaf": "H256"
},
"ProofResponse": {
"dataProof": "DataProofV2",
"message": "Option<Message>"
},
"Message": {
"messageType": "MessageType",
"from": "H256",
"to": "H256",
"originDomain": "u32",
"destinationDomain": "u32",
"data": "Vec<u8>",
"id": "u64"
},
"MessageType": {
"_enum": [
"ArbitraryMessage",
"FungibleToken"
]
},
"FungibleToken": {
"asset_id": "H256",
"amount": "String"
},
"BoundedData": "Vec<u8>",
"ArbitraryMessage": "BoundedData",
"Cell": {
"row": "BlockLengthRows",
"col": "BlockLengthColumns"
Expand Down

0 comments on commit 433d8f9

Please sign in to comment.