Skip to content

Commit

Permalink
Update deploy branch (#76)
Browse files Browse the repository at this point in the history
* add statemine

Signed-off-by: Stepan Lavrentev <lawrentievsv@gmail.com>

* fix constraint

* ISSUE-51: Assets transfer history

* NOVA_3665: switch <action>.multi to multiQuery (#40)

* ISSUE-39: Fee calculation with withdraw (#42)

* Update polkadot api

* Check erasStakersClipped exists

* Update readme and package name

* Set extrinsic hash as optional

* Custom asset transfer

* fix deploy branch

* fix

* Transform assetTransfer to jsonfield

* upgrade polkadot/api to 7

* fix schema

* rename

* update workflows

* Fix for assettransfer checking

* add more networks in list

* add tests for promote to prod

* add new networks

* Fix transfer problem

* fix bifrost and karura

* Add failed transfer all handlers

* add promotion to prod with checks

* add more networks

* add networks and fix

* Don't create receiver history element for transferAll

* temporal --force

* remove --force

* add fix for moonbeam

* fix version for moonriver

* fix shiden

* Prepare to pull request to deploy branch

Co-authored-by: Stepan Lavrentev <lawrentievsv@gmail.com>
Co-authored-by: asmadek <alma2610@ya.ru>
Co-authored-by: Stepan Lavrentev <40560660+stepanLav@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Mar 30, 2022
1 parent 980ce23 commit 803f43d
Show file tree
Hide file tree
Showing 35 changed files with 34 additions and 85 deletions.
2 changes: 1 addition & 1 deletion networks/acala/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/altair/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/astar/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/basilisk/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/bifrost/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/bit-country/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/calamari/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/centrifuge/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/clover/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/crab/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/edgeware/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/encointer/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/integritee/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/interlay/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/karura/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/khala/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/kico/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/kilt/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/kintsugi/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/litmus/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/moonbeam/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/moonriver/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/parallel-heiko/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/parallel/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/picasso/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/quartz/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/robonomics/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/shadow/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/shiden/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/statemine/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/statemint/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/subsocial/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
2 changes: 1 addition & 1 deletion networks/zeitgeist/src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down
51 changes: 0 additions & 51 deletions schema.graphql
Original file line number Diff line number Diff line change
@@ -1,55 +1,4 @@
type Transfer @jsonField {
assetId: String,
amount: String!
to: String!
from: String!
fee: String!
eventIdx: Int!
success: Boolean!
}

type AssetTransfer @jsonField {
assetId: String!
amount: String!
to: String!
from: String!
fee: String!
eventIdx: Int!
success: Boolean!
}

type AssetTransfer @jsonField {
assetId: String!
amount: String!
to: String!
from: String!
fee: String!
eventIdx: Int!
success: Boolean!
}

type AssetTransfer @jsonField {
assetId: String!
amount: String!
to: String!
from: String!
fee: String!
eventIdx: Int!
success: Boolean!
}

type AssetTransfer @jsonField {
assetId: String!
amount: String!
to: String!
from: String!
fee: String!
eventIdx: Int!
success: Boolean!
}

type AssetTransfer @jsonField {
assetId: String!
amount: String!
to: String!
from: String!
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function extrinsicIdFromBlockAndIdx(blockNumber: number, extrinsicIdx: nu
}

export function timestamp(block: SubstrateBlock): bigint {
return BigInt(Math.round((block.timestamp.getTime() / 1000)))
return BigInt(Math.round(block.timestamp ? block.timestamp.getTime() / 1000 : -1))
}

export function calculateFeeAsString(extrinsic?: SubstrateExtrinsic): string {
Expand Down

0 comments on commit 803f43d

Please sign in to comment.