From b38eef1ae6134526cdd793199469b32a3ce13b6b Mon Sep 17 00:00:00 2001 From: Artem Date: Thu, 25 Mar 2021 13:53:18 +0300 Subject: [PATCH] Fix: offchain migration --- scripts/migration/migrations/fill_tzip.go | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/migration/migrations/fill_tzip.go b/scripts/migration/migrations/fill_tzip.go index b9ce675da..6bc9a5e3a 100644 --- a/scripts/migration/migrations/fill_tzip.go +++ b/scripts/migration/migrations/fill_tzip.go @@ -94,6 +94,20 @@ func processTzipItem(ctx *config.Context, item repository.Item, inserts, updates return err } + for _, token := range model.Tokens.Static { + *inserts = append(*inserts, &tokenmetadata.TokenMetadata{ + Network: model.Network, + Contract: model.Address, + Level: 0, + Timestamp: model.Timestamp, + TokenID: token.TokenID, + Symbol: token.Symbol, + Name: token.Name, + Decimals: token.Decimals, + Extras: token.Extras, + }) + } + copyModel := tzip.TZIP{ Network: model.Network, Address: model.Address, @@ -119,19 +133,5 @@ func processTzipItem(ctx *config.Context, item repository.Item, inserts, updates *updates = append(*updates, &model.TZIP) - for _, token := range model.Tokens.Static { - *inserts = append(*inserts, &tokenmetadata.TokenMetadata{ - Network: model.Network, - Contract: model.Address, - Level: 0, - Timestamp: model.Timestamp, - TokenID: token.TokenID, - Symbol: token.Symbol, - Name: token.Name, - Decimals: token.Decimals, - Extras: token.Extras, - }) - } - return nil }