Skip to content

Commit

Permalink
Limit the console length on Firehose blocks #16 https://github.com/pi…
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois Blanchette committed Feb 22, 2023
1 parent 7208893 commit 5f1ffa7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions codec/antelope/v3.1/eos_to_proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ package antelope

import (
"fmt"
"math"
"sort"

"github.com/EOS-Nation/firehose-antelope/codec/antelope"
"github.com/EOS-Nation/firehose-antelope/types/pb/sf/antelope/type/v1"
pbantelope "github.com/EOS-Nation/firehose-antelope/types/pb/sf/antelope/type/v1"
"github.com/eoscanada/eos-go"
"github.com/eoscanada/eos-go/ecc"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/timestamppb"
"math"
"sort"
)

const consoleTextLimit = 10000

func TransactionReceiptToDEOS(txReceipt *TransactionReceipt) *pbantelope.TransactionReceipt {
receipt := &pbantelope.TransactionReceipt{
Status: TransactionStatusToDEOS(txReceipt.Status),
Expand Down Expand Up @@ -137,7 +140,7 @@ func ActionTraceToDEOS(in *ActionTrace, execIndex uint32, opts ...antelope.Conve
Receiver: string(in.Receiver),
Action: antelope.ActionToDEOS(in.Action),
Elapsed: int64(in.ElapsedUs),
Console: string(in.Console),
Console: string(in.Console)[0:consoleTextLimit],
TransactionId: in.TransactionID.String(),
ContextFree: in.ContextFree,
ProducerBlockId: in.ProducerBlockID.String(),
Expand Down
2 changes: 1 addition & 1 deletion proto/sf/antelope/type/v1/type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ message ActionTrace {
Action action = 2;
bool context_free = 3;
int64 elapsed = 4;
string console = 5;
string console = 5; // limited to 10000 characters
string transaction_id = 6;
uint64 block_num = 7;
string producer_block_id = 8;
Expand Down

0 comments on commit 5f1ffa7

Please sign in to comment.