-
Notifications
You must be signed in to change notification settings - Fork 503
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
5550/xdrill transactions #5579
base: master
Are you sure you want to change the base?
5550/xdrill transactions #5579
Conversation
…550/xdrill-transactions
// Fee charged = inclusion fee * (operation count + if(feeBumpAccount is not null, 1, 0)) | ||
// or inclusionFee = feeCharged/(operation count + if(feeBumpAccount is not null, 1, 0)) | ||
operationCount := t.OperationCount() | ||
if t.Envelope.Type == 5 { // xdr.EnvelopeTypeEnvelopeTypeTxFeeBump |
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.
if t.Envelope.Type == 5 { // xdr.EnvelopeTypeEnvelopeTypeTxFeeBump | |
if t.Envelope.Type == xdr.EnvelopeTypeEnvelopeTypeTxFeeBump { |
Why not compare against xdr.EnvelopeTypeEnvelopeTypeTxFeeBump instead of 5 ?
sourceAccount := t.Envelope.SourceAccount() | ||
providedID := sourceAccount.ToAccountId() | ||
pointerToID := &providedID | ||
|
||
return pointerToID.GetAddress() |
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.
sourceAccount := t.Envelope.SourceAccount() | |
providedID := sourceAccount.ToAccountId() | |
pointerToID := &providedID | |
return pointerToID.GetAddress() | |
sourceAccount := t.Envelope.SourceAccount().ToAccountId() | |
return sourceAccount.GetAddress() |
func (t *LedgerTransaction) Memo() string { | ||
memoObject := t.Envelope.Memo() | ||
memoContents := "" | ||
switch xdr.MemoType(memoObject.Type) { |
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.
I think you should handle all cases including MEMO_NONE and then you can add a default case which panics. That way if you forget to support a new memo case in the future the library can fail instead of mistakenly returning the empty string without errors
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.
this comment also applies to other switch cases in this file and other xdrill files
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
CHANGELOG.md
within the component folder structure. For example, if I changed horizon, then I updated (services/horizon/CHANGELOG.md. I add a new line item describing the change and reference to this PR. If I don't update a CHANGELOG, I acknowledge this PR's change may not be mentioned in future release notes.semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
What
This is a copy of chowbao#1 where this PR merges into stellar/go
#5550
xdrill functions for Transactions
Why
Helper functions for Transactions for processors/transforms from stellar-etl for history_transactions found here
Known limitations