Skip to content

Commit

Permalink
fix some tx fees and packing bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
wlawt committed Apr 25, 2024
1 parent d1411f2 commit f968344
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chain/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ func (t *Transaction) Digest() ([]byte, error) {
if len(t.digest) > 0 {
return t.digest, nil
}
size := t.Base.Size()
size := t.Base.Size() + consts.ByteLen
for _, action := range t.Actions {
size += consts.ByteLen + action.Size()
size += action.Size()
}
p := codec.NewWriter(size, consts.NetworkSizeLimit)
t.Base.Marshal(p)
Expand Down Expand Up @@ -138,8 +138,8 @@ func (t *Transaction) MaxUnits(sm StateManager, r Rules) (fees.Dimensions, error
maxComputeUnitsOp := math.NewUint64Operator(r.GetBaseComputeUnits())
for _, action := range t.Actions {
maxComputeUnitsOp.Add(action.MaxComputeUnits(r))
maxComputeUnitsOp.Add(t.Auth.ComputeUnits(r))
}
maxComputeUnitsOp.Add(t.Auth.ComputeUnits(r))
maxComputeUnits, err := maxComputeUnitsOp.Value()
if err != nil {
return fees.Dimensions{}, err
Expand Down

0 comments on commit f968344

Please sign in to comment.