Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions db/migrations/12_add_new_8_chain_events.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
alter type "7a0b4cc03e" add value if not exists 'beefy' after 'validators';
alter type "7a0b4cc03e" add value if not exists 'revive' after 'beefy';

alter type "0bf3c7d4ef" add value if not exists 'self_register_did' after 'unlink_child_identity';
alter type "0bf3c7d4ef" add value if not exists 'remove_key' after 'sudo_as';
alter type "0bf3c7d4ef" add value if not exists 'set_mandatory_receiver_affirmation' after 'lock_instruction';
alter type "0bf3c7d4ef" add value if not exists 'transfer_funds' after 'set_mandatory_receiver_affirmation';
alter type "0bf3c7d4ef" add value if not exists 'unlock_instruction' after 'transfer_funds';
alter type "0bf3c7d4ef" add value if not exists 'approve_subsidy' after 'decrease_polyx_limit';
alter type "0bf3c7d4ef" add value if not exists 'revoke_subsidy' after 'approve_subsidy';
alter type "0bf3c7d4ef" add value if not exists 'accept_subsidy' after 'revoke_subsidy';
alter type "0bf3c7d4ef" add value if not exists 'remove_subsidy' after 'accept_subsidy';
alter type "0bf3c7d4ef" add value if not exists 'report_double_voting' after 'redeem_nft';

Check failure on line 13 in db/migrations/12_add_new_8_chain_events.sql

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal 3 times.

See more on https://sonarcloud.io/project/issues?id=PolymeshAssociation_polymesh-subquery&issues=AZ383nLZ9ID4nLpEF7m_&open=AZ383nLZ9ID4nLpEF7m_&pullRequest=331
alter type "0bf3c7d4ef" add value if not exists 'report_double_voting_unsigned' after 'redeem_nft';
alter type "0bf3c7d4ef" add value if not exists 'set_new_genesis' after 'redeem_nft';
alter type "0bf3c7d4ef" add value if not exists 'report_fork_voting' after 'sumbit_unsigned';
alter type "0bf3c7d4ef" add value if not exists 'report_fork_voting_unsigned' after 'report_fork_voting';
alter type "0bf3c7d4ef" add value if not exists 'report_future_block_voting' after 'report_fork_voting_unsigned';
alter type "0bf3c7d4ef" add value if not exists 'report_future_block_voting_unsigned' after 'report_future_block_voting';
alter type "0bf3c7d4ef" add value if not exists 'eth_transact' after 'report_future_block_voting_unsigned';
alter type "0bf3c7d4ef" add value if not exists 'eth_instantiate_with_code' after 'eth_transact';
alter type "0bf3c7d4ef" add value if not exists 'eth_call' after 'eth_instantiate_with_code';
alter type "0bf3c7d4ef" add value if not exists 'eth_substrate_call' after 'eth_call';
alter type "0bf3c7d4ef" add value if not exists 'map_account' after 'eth_substrate_call';
alter type "0bf3c7d4ef" add value if not exists 'unmap_account' after 'map_account';
alter type "0bf3c7d4ef" add value if not exists 'dispatch_as_fallback_account' after 'unmap_account';


alter type "8f5a39c8ee" add value if not exists 'BurnedDebt' after 'Withdraw';
alter type "8f5a39c8ee" add value if not exists 'BurnedHeld' after 'BurnedDebt';
alter type "8f5a39c8ee" add value if not exists 'Held' after 'BurnedHeld';
alter type "8f5a39c8ee" add value if not exists 'MintedCredit' after 'Held';
alter type "8f5a39c8ee" add value if not exists 'Released' after 'MintedCredit';
alter type "8f5a39c8ee" add value if not exists 'TransferAndHold' after 'Released';
alter type "8f5a39c8ee" add value if not exists 'TransferOnHold' after 'TransferAndHold';
alter type "8f5a39c8ee" add value if not exists 'Unexpected' after 'TransferOnHold';
alter type "8f5a39c8ee" add value if not exists 'RootsPruned' after 'Slashed';
alter type "8f5a39c8ee" add value if not exists 'RootStored' after 'RootsPruned';
alter type "8f5a39c8ee" add value if not exists 'NFTHoldingsUpdated' after 'NFTPortfolioUpdated';
alter type "8f5a39c8ee" add value if not exists 'NewQueued' after 'ValidatorReenabled';
alter type "8f5a39c8ee" add value if not exists 'KeyRemoved' after 'KeyChanged';
alter type "8f5a39c8ee" add value if not exists 'InstructionUnlocked' after 'VenueSignersUpdated';
alter type "8f5a39c8ee" add value if not exists 'MandatoryReceiverAffirmationSet' after 'InstructionUnlocked';
alter type "8f5a39c8ee" add value if not exists 'AcceptedSubsidy' after 'UpdatedPolyxLimit';
alter type "8f5a39c8ee" add value if not exists 'ApprovedSubsidy' after 'AcceptedSubsidy';
alter type "8f5a39c8ee" add value if not exists 'RemovedPendingSubsidy' after 'ApprovedSubsidy';
alter type "8f5a39c8ee" add value if not exists 'RemovedSubsidy' after 'RemovedPendingSubsidy';
alter type "8f5a39c8ee" add value if not exists 'SubsidyDebited' after 'RemovedSubsidy';
alter type "8f5a39c8ee" add value if not exists 'EthExtrinsicRevert' after 'RootStored';

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
NETWORK_HTTP_ENDPOINT: 'http://host.docker.internal:9933'
# Staging
# NETWORK_ENDPOINT: wss://staging-rpc.polymesh.dev/
# NETWORK_CHAIN_ID: '0x3c3183f6d701500766ff7d147b79c4f10014a095eaaa98e960dcef6b3ead50ee'
# NETWORK_CHAIN_ID: '0xd12a4b22b06f4eabaef920226b2dfb0fa9a5b99d4f2b1e72729da97e07dd374d'
# NETWORK_DICTIONARY: https://subql-dictionary.polymesh.dev
# Testnet
# NETWORK_ENDPOINT: wss://testnet-rpc.polymesh.live
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"scripts": {
"build": "subql build",
"sql": "ts-node scripts/run-sql.ts",
"run:dev": "subql-node -f=./ --batch-size=50",
"migrations": "ts-node scripts/run-migrations.ts",
"prepack": "rm -rf dist && yarn build",
"prepare": "husky install",
Expand Down Expand Up @@ -36,7 +37,7 @@
"@polkadot/api": "^16.5.2",
"@polkadot/types-support": "^16.5.2",
"@polymeshassociation/polymesh-types": "^7.2.0",
"@subql/cli": "^6.6.0",
"@subql/cli": "^6.6.3",
"@subql/types": "^3.15.0",
"@subql/types-core": "^2.2.0",
"bignumber.js": "^9.0.2",
Expand Down
3 changes: 2 additions & 1 deletion project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ const filters = {
ProposalFailedToExecute: [],
},
nft: {
NFTPortfolioUpdated: ['handleNftPortfolioUpdates'],
NFTPortfolioUpdated: ['handleNftHoldingsUpdates'],
NFTHoldingsUpdated: ['handleNftHoldingsUpdates'],
NftCollectionCreated: ['handleNftCollectionCreated'],
},
pips: {
Expand Down
84 changes: 78 additions & 6 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ enum ModuleIdEnum {
statetriemigration
electionprovidermultiphase
validators
beefy
revive

## deprecated ##
confidential @deprecated
Expand Down Expand Up @@ -125,6 +127,14 @@ enum EventIdEnum {
Unlocked
Upgraded
Withdraw
BurnedDebt
BurnedHeld
Held
MintedCredit
Released
TransferAndHold
TransferOnHold
Unexpected

## transactionpayment ##

Expand All @@ -144,11 +154,15 @@ enum EventIdEnum {
AuthorizationRejected
AuthorizationConsumed
AuthorizationRetryLimitReached
"`CddRequirementForPrimaryKeyUpdated` has been deprecated from 8.0.0 chain version"
CddRequirementForPrimaryKeyUpdated
"`CddClaimsInvalidated` has been deprecated from 8.0.0 chain version"
CddClaimsInvalidated
SecondaryKeysFrozen
SecondaryKeysUnfrozen
"`ChildDidCreated` has been deprecated from 8.0.0 chain version"
ChildDidCreated
"`ChildDidUnlinked` has been deprecated from 8.0.0 chain version"
ChildDidUnlinked

## cddserviceproviders ##
Expand All @@ -172,13 +186,14 @@ enum EventIdEnum {
ExpiresAfterUpdated
VoteThresholdUpdated

## committeemembership ##
## didRegistrars ##
MemberAdded
MemberRemoved
MemberRevoked
MembersSwapped
MembersReset
ActiveLimitChanged
"`Dummy` has been deprecated from 8.0.0 chain version"
Dummy

## technicalcommittee ##
Expand Down Expand Up @@ -332,6 +347,7 @@ enum EventIdEnum {
NewSession
ValidatorDisabled
ValidatorReenabled
NewQueued

## authoritydiscovery ##

Expand All @@ -352,6 +368,7 @@ enum EventIdEnum {
## sudo ##
Sudid
KeyChanged
KeyRemoved
SudoAsDone

## asset ##
Expand Down Expand Up @@ -526,10 +543,14 @@ enum EventIdEnum {
InstructionFailed
InstructionExecuted
VenueUnauthorized
"`SchedulingFailed` has been deprecated from 8.0.0 chain version"
SchedulingFailed
SettlementManuallyExecuted
"`InstructionRescheduled` has been deprecated from 8.0.0 chain version"
InstructionRescheduled
VenueSignersUpdated
InstructionUnlocked
MandatoryReceiverAffirmationSet

RemoveAssetAffirmationExemption
AssetAffirmationExemption
Expand Down Expand Up @@ -587,6 +608,7 @@ enum EventIdEnum {
RelayedTx

## base ##
"`UnexpectedError` has been deprecated from 8.0.0 chain version"
UnexpectedError

## externalagents ##
Expand All @@ -601,6 +623,11 @@ enum EventIdEnum {
AcceptedPayingKey
RemovedPayingKey
UpdatedPolyxLimit
AcceptedSubsidy
ApprovedSubsidy
RemovedPendingSubsidy
RemovedSubsidy
SubsidyDebited

## rewards ##
ItnRewardClaimed
Expand Down Expand Up @@ -637,7 +664,9 @@ enum EventIdEnum {
NftCollectionCreated
"`RedeemedNFT` has been deprecated from 6.0.0 chain version"
RedeemedNFT
"`NFTPortfolioUpdated` has been renamed as `NFTHoldingsUpdated` from 8.0.0 chain version"
NFTPortfolioUpdated
NFTHoldingsUpdated

## confidential assets ##
AccountCreated
Expand All @@ -664,8 +693,17 @@ enum EventIdEnum {
Slashed
# SolutionStored -> defined before in staking

## historical ##
RootsPruned
RootStored

## revive ##
# ContractEmitted (already defined in contracts)
EthExtrinsicRevert
# Instantiated (already defined in contracts)

## deprecated ##
Approval @deprecated
Approval
AssetPurchased @deprecated
AssetRuleChanged @deprecated
AssetRuleRemoved @deprecated
Expand Down Expand Up @@ -840,6 +878,7 @@ enum CallIdEnum {
create_child_identities
create_child_identity
unlink_child_identity
self_register_did

## cddserviceproviders ##
set_active_members_limit
Expand Down Expand Up @@ -1066,6 +1105,7 @@ enum CallIdEnum {
sudo_unchecked_weight
set_key
sudo_as
remove_key

## asset ##
"`register_ticker` has been renamed to `register_unique_ticker` from 7.0.0 chain version"
Expand Down Expand Up @@ -1285,6 +1325,9 @@ enum CallIdEnum {
reject_instruction_as_mediator
add_and_affirm_with_mediators
lock_instruction
set_mandatory_receiver_affirmation
transfer_funds
unlock_instruction

## statistics ##
set_active_asset_stats
Expand Down Expand Up @@ -1339,6 +1382,10 @@ enum CallIdEnum {
update_polyx_limit
increase_polyx_limit
decrease_polyx_limit
approve_subsidy
revoke_subsidy
accept_subsidy
remove_subsidy

## rewards ##
claim_itn_reward
Expand Down Expand Up @@ -1384,6 +1431,7 @@ enum CallIdEnum {
create_nft_collection
issue_nft
redeem_nft
transfer_nft

## confidential assets ##
add_mediator_account
Expand Down Expand Up @@ -1433,6 +1481,30 @@ enum CallIdEnum {
# set_commission_cap (already was defined in staking)
# update_permissioned_validator_intended_count (already was defined in staking)

### beefy ###
report_double_voting
report_double_voting_unsigned
set_new_genesis
report_fork_voting
report_fork_voting_unsigned
report_future_block_voting
report_future_block_voting_unsigned

### revive ###
eth_transact
# call (already defined in contracts)
# instantiate (already defined in contracts)
# instantiate_with_code (already defined in contracts)
eth_instantiate_with_code
eth_call
eth_substrate_call
# upload_code (already defined in contracts)
# remove_code (already defined in contracts)
# set_code (already defined in contracts)
map_account
unmap_account
dispatch_as_fallback_account

## deprecated ##
accept_authorization @deprecated
accept_master_key @deprecated
Expand Down Expand Up @@ -2084,7 +2156,7 @@ type Leg @entity {
fromAccount: String
"`fromPortfolio` is null for off chain legs"
fromPortfolio: Int
to: String! @index(unique: false)
to: String @index(unique: false)
toAccount: String
"`toPortfolio` is null for off chain legs"
toPortfolio: Int
Expand Down Expand Up @@ -2133,7 +2205,7 @@ type InstructionAffirmation @entity {
id: ID!
instruction: Instruction! @index(unique: false)
party: InstructionParty!
identity: String! @index(unique: false)
identity: String @index(unique: false)
account: String
"`portfolio` will be null for mediator affirmation and off chain affirmation"
portfolios: [Int]
Expand Down Expand Up @@ -2505,7 +2577,7 @@ Represents how much of a given Asset an Identity owns
"""
type AssetHolder @entity {
id: ID! # assetId/did
identity: Identity! @index(unique: false)
identity: Identity @index(unique: false)
asset: Asset! @index(unique: false)
amount: BigInt!
createdBlock: Block!
Expand All @@ -2517,7 +2589,7 @@ Represents what NFTs of a collection an Identity owns
"""
type NftHolder @entity {
id: ID! #assetId/did
identity: Identity! @index(unique: false)
identity: Identity @index(unique: false)
asset: Asset! @index(unique: false)
nftIds: [Int]
createdBlock: Block!
Expand Down
Loading
Loading