-
Notifications
You must be signed in to change notification settings - Fork 4
feat: 🎸 Add 8.x events and extrinsics #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
prashantasdeveloper
wants to merge
19
commits into
alpha
Choose a base branch
from
feat/8.x-integration
base: alpha
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ec0d2b3
feat: 🎸 Add 8.x events and extrinsics
prashantasdeveloper 6b87cf3
chore: 🤖 handle asset holders in nfts
prashantasdeveloper c470336
chore: 🤖 correct receiver holder param
prashantasdeveloper b914d13
feat: 🎸 Add identity fields to asset transactions and update mappings
F-OBrien 61ff855
feat: 🎸 add handler for FundsTransferred event
prashantasdeveloper 9af6b45
chore: 🤖 bump polymesh-types
prashantasdeveloper 97de260
chore: 🤖 reduce duplication
prashantasdeveloper 4700c5e
chore: 🤖 add missing transfer_nft to migration
prashantasdeveloper 9910268
chore: 🤖 fix ordering of call ids
prashantasdeveloper 5a65581
feat: 🎸 handle ElectionScore as a named struct in serializeLikeHarvester
F-OBrien a9ee005
chore: 🤖 add getOrCreateAccount for missing accounts info
prashantasdeveloper 4b29f9b
chore: 🤖 update schema CallIdEnum and EventIdEnum
F-OBrien 54962f9
refactor: 💡 refactor extracting asset holders
prashantasdeveloper 01552a7
chore: 🤖 rename sumbit_unsigned to submit_unsigned
prashantasdeveloper ab3d5d8
feat: 🎸 Add identity to PortfolioMovement entity
prashantasdeveloper 4dcc1d1
chore: 🤖 resolve PR comments
prashantasdeveloper 1e16a05
chore: 🤖 add typecast to EventRecord
prashantasdeveloper a22a19f
feat: 🎸 Add rewardDestination and RewardDestinationAccount field to …
F-OBrien 66985e1
chore: 🤖 add LegacyUnknown to old staking reward events
prashantasdeveloper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 'sumbit_unsigned'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'report_double_voting_unsigned' after 'report_double_voting'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'set_new_genesis' after 'report_double_voting_unsigned'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'report_fork_voting' after 'set_new_genesis'; | ||
| 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'; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| alter table "asset_transactions" add column if not exists "from_identity_id" text; | ||
| alter table "asset_transactions" add column if not exists "to_identity_id" text; | ||
|
|
||
| -- Backfill from portfolio IDs (format: did/portfolioNumber) | ||
| update "asset_transactions" | ||
| set "from_identity_id" = split_part("from_portfolio_id", '/', 1) | ||
| where "from_portfolio_id" is not null | ||
| and "from_identity_id" is null; | ||
|
|
||
| update "asset_transactions" | ||
| set "to_identity_id" = split_part("to_portfolio_id", '/', 1) | ||
| where "to_portfolio_id" is not null | ||
| and "to_identity_id" is null; | ||
|
|
||
| -- Backfill account-based transactions from the accounts table. | ||
| -- Note: this reflects the current identity association for the account, | ||
| -- not necessarily the identity at the time of the transaction. | ||
| update "asset_transactions" at | ||
| set "from_identity_id" = a."identity_id" | ||
| from "accounts" a | ||
| where at."from_account" = a."id" | ||
| and at."from_identity_id" is null | ||
| and a."identity_id" is not null; | ||
|
|
||
| update "asset_transactions" at | ||
| set "to_identity_id" = a."identity_id" | ||
| from "accounts" a | ||
| where at."to_account" = a."id" | ||
| and at."to_identity_id" is null | ||
| and a."identity_id" is not null; | ||
|
|
||
| create index if not exists "asset_transactions_from_identity_id" on "asset_transactions" ("from_identity_id"); | ||
| create index if not exists "asset_transactions_to_identity_id" on "asset_transactions" ("to_identity_id"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| alter type "7a0b4cc03e" add value if not exists 'didregistrars' after 'revive'; | ||
| alter type "7a0b4cc03e" add value if not exists 'polymeshtransactionpayment' after 'didregistrars'; | ||
| alter type "7a0b4cc03e" add value if not exists 'multiblockmigrations' after 'polymeshtransactionpayment'; | ||
| alter type "7a0b4cc03e" add value if not exists 'confidentialassets' after 'multiblockmigrations'; | ||
|
|
||
| alter type "0bf3c7d4ef" add value if not exists 'force_set_cursor' after 'dispatch_as_fallback_account'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'force_set_active_cursor' after 'force_set_cursor'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'force_onboard_mbms' after 'force_set_active_cursor'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'clear_historic' after 'force_onboard_mbms'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'register_accounts' after 'clear_historic'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'register_encryption_keys' after 'register_accounts'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'register_account_assets' after 'register_encryption_keys'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'mint_asset' after 'register_account_assets'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'create_settlement' after 'mint_asset'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'sender_affirmation' after 'create_settlement'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'receiver_affirmation' after 'sender_affirmation'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'mediator_affirmation' after 'receiver_affirmation'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'sender_update_counter' after 'mediator_affirmation'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'sender_revert_affirmation' after 'sender_update_counter'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'receiver_revert_affirmation' after 'sender_revert_affirmation'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'receiver_claim' after 'receiver_revert_affirmation'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'batched_settlement' after 'receiver_claim'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'register_fee_accounts' after 'batched_settlement'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'topup_fee_accounts' after 'register_fee_accounts'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'submit_batched_proofs' after 'topup_fee_accounts'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'relayer_submit_batched_proofs' after 'submit_batched_proofs'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'execute_instant_settlement' after 'relayer_submit_batched_proofs'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'instant_sender_affirmation' after 'execute_instant_settlement'; | ||
| alter type "0bf3c7d4ef" add value if not exists 'instant_receiver_affirmation' after 'instant_sender_affirmation'; | ||
|
|
||
| alter type "8f5a39c8ee" add value if not exists 'AllowanceSpent' after 'CreatedAssetTransfer'; | ||
| alter type "8f5a39c8ee" add value if not exists 'FundsTransferred' after 'TickerLinkedToAsset'; | ||
| alter type "8f5a39c8ee" add value if not exists 'AccountAssetRegistered' after 'EthExtrinsicRevert'; | ||
| alter type "8f5a39c8ee" add value if not exists 'AccountCurveTreeRootUpdated' after 'AccountAssetRegistered'; | ||
| alter type "8f5a39c8ee" add value if not exists 'AccountRegistered' after 'AccountCurveTreeRootUpdated'; | ||
| alter type "8f5a39c8ee" add value if not exists 'AccountStateLeafInserted' after 'AccountRegistered'; | ||
| alter type "8f5a39c8ee" add value if not exists 'AssetCurveTreeRootUpdated' after 'AccountStateLeafInserted'; | ||
| alter type "8f5a39c8ee" add value if not exists 'AssetMinted' after 'AssetCurveTreeRootUpdated'; | ||
| alter type "8f5a39c8ee" add value if not exists 'AssetStateLeafUpdated' after 'AssetMinted'; | ||
| alter type "8f5a39c8ee" add value if not exists 'AssetUpdated' after 'AssetStateLeafUpdated'; | ||
| alter type "8f5a39c8ee" add value if not exists 'EncryptionKeyRegistered' after 'AssetUpdated'; | ||
| alter type "8f5a39c8ee" add value if not exists 'FeeAccountCurveTreeRootUpdated' after 'EncryptionKeyRegistered'; | ||
| alter type "8f5a39c8ee" add value if not exists 'FeeAccountDeposited' after 'FeeAccountCurveTreeRootUpdated'; | ||
| alter type "8f5a39c8ee" add value if not exists 'FeeAccountStateLeafInserted' after 'FeeAccountDeposited'; | ||
| alter type "8f5a39c8ee" add value if not exists 'FeeAccountUpdated' after 'FeeAccountStateLeafInserted'; | ||
| alter type "8f5a39c8ee" add value if not exists 'FeeAccountWithdrawn' after 'FeeAccountUpdated'; | ||
| alter type "8f5a39c8ee" add value if not exists 'MediatorAffirmed' after 'FeeAccountWithdrawn'; | ||
| alter type "8f5a39c8ee" add value if not exists 'MediatorRejected' after 'MediatorAffirmed'; | ||
| alter type "8f5a39c8ee" add value if not exists 'ReceiverAffirmationReverted' after 'MediatorRejected'; | ||
| alter type "8f5a39c8ee" add value if not exists 'ReceiverAffirmed' after 'ReceiverAffirmationReverted'; | ||
| alter type "8f5a39c8ee" add value if not exists 'ReceiverClaimed' after 'ReceiverAffirmed'; | ||
| alter type "8f5a39c8ee" add value if not exists 'RelayerBatchedProofs' after 'ReceiverClaimed'; | ||
| alter type "8f5a39c8ee" add value if not exists 'SenderAffirmationReverted' after 'RelayerBatchedProofs'; | ||
| alter type "8f5a39c8ee" add value if not exists 'SenderAffirmed' after 'SenderAffirmationReverted'; | ||
| alter type "8f5a39c8ee" add value if not exists 'SenderCounterUpdated' after 'SenderAffirmed'; | ||
| alter type "8f5a39c8ee" add value if not exists 'SettlementCreated' after 'SenderCounterUpdated'; | ||
| alter type "8f5a39c8ee" add value if not exists 'SettlementStatusUpdated' after 'SettlementCreated'; | ||
| alter type "8f5a39c8ee" add value if not exists 'HistoricCleared' after 'SettlementStatusUpdated'; | ||
| alter type "8f5a39c8ee" add value if not exists 'MigrationAdvanced' after 'HistoricCleared'; | ||
| alter type "8f5a39c8ee" add value if not exists 'MigrationCompleted' after 'MigrationAdvanced'; | ||
| alter type "8f5a39c8ee" add value if not exists 'MigrationFailed' after 'MigrationCompleted'; | ||
| alter type "8f5a39c8ee" add value if not exists 'MigrationSkipped' after 'MigrationFailed'; | ||
| alter type "8f5a39c8ee" add value if not exists 'UpgradeCompleted' after 'MigrationSkipped'; | ||
| alter type "8f5a39c8ee" add value if not exists 'UpgradeFailed' after 'UpgradeCompleted'; | ||
| alter type "8f5a39c8ee" add value if not exists 'UpgradeStarted' after 'UpgradeFailed'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| alter type "0bf3c7d4ef" add value if not exists 'transfer_nft' after 'redeem_nft'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| DO $$ | ||
| BEGIN | ||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM pg_enum e | ||
| JOIN pg_type t ON e.enumtypid = t.oid | ||
| WHERE t.typname = '0bf3c7d4ef' | ||
| AND e.enumlabel = 'sumbit_unsigned' | ||
| ) THEN | ||
| ALTER TYPE "0bf3c7d4ef" RENAME VALUE 'sumbit_unsigned' TO 'submit_unsigned'; | ||
| END IF; | ||
| END $$; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| alter table "portfolio_movements" add column if not exists "identity_id" text; | ||
|
|
||
| -- Backfill from portfolio IDs (format: did/portfolioNumber) | ||
| update "portfolio_movements" | ||
| set "identity_id" = split_part("from_id", '/', 1) | ||
| where "from_id" is not null | ||
| and "identity_id" is null; | ||
|
|
||
| -- Backfill account-based transactions from the accounts table. | ||
| -- Note: this reflects the current identity association for the account, | ||
| -- not necessarily the identity at the time of the transaction. | ||
| update "portfolio_movements" at | ||
| set "identity_id" = a."identity_id" | ||
| from "accounts" a | ||
| where at."from_account" = a."id" | ||
| and at."identity_id" is null | ||
| and a."identity_id" is not null; | ||
|
|
||
| create index if not exists "portfolio_movements_identity_id" on "portfolio_movements" ("identity_id"); |
4 changes: 4 additions & 0 deletions
4
db/migrations/18_add_reward_destination_to_staking_events.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| alter table "staking_events" add column if not exists "reward_destination" text; | ||
| alter table "staking_events" add column if not exists "reward_destination_account" text; | ||
|
|
||
| update "staking_events" set reward_destination = 'LegacyUnknown' where reward_destination is null and event_id in ('Reward', 'Rewarded'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.