-
Notifications
You must be signed in to change notification settings - Fork 14
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
Update the data type of AssetType in trustline tables #268
Update the data type of AssetType in trustline tables #268
Conversation
internal/transform/trustline.go
Outdated
@@ -61,7 +61,7 @@ func TransformTrustline(ledgerChange ingest.Change, header xdr.LedgerHeaderHisto | |||
transformedTrustline := TrustlineOutput{ | |||
LedgerKey: outputLedgerKey, | |||
AccountID: outputAccountID, | |||
AssetType: int32(asset.Type), | |||
AssetType: asset.Type.String(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chowbao I am seeing values like AssetTypeAssetTypePoolShare
in the tables
Should it rather be AssetTypePoolShare
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should match how history_assets
does it which I think removes AssetTypeAssetType
.
You might need to define a new function to make the change or look for an existing if one exists
internal/transform/trustline.go
Outdated
@@ -39,12 +39,15 @@ func TransformTrustline(ledgerChange ingest.Change, header xdr.LedgerHeaderHisto | |||
return TrustlineOutput{}, errors.Wrap(err, fmt.Sprintf("could not create ledger key string for trustline with account %s and asset %s", outputAccountID, asset.ToAsset().StringCanonical())) | |||
} | |||
|
|||
var assetTypeString string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think you don't need to create a new variable and can just reuse assetType
because it is already a string variable defined on line 33
In any case this is a non blocking suggestion
PR Checklist
PR Structure
otherwise).
Thoroughness
Release planning
semver, and I've changed the name of the BRANCH to release/_ , feature/_ or patch/* .
What
This PR updates the data type of AssetType for Trustlines tables from integer to string.
Why
This is done to make AssetType consistent across all the schemas as it was mistakenly added as integer earlier.
Known limitations
None. Posted the deploy plan in jira