Skip to content

Commit 4e0e920

Browse files
committed
updaing docs
1 parent e77cd39 commit 4e0e920

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

CONFIG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,9 @@ GasLimit controls the gas limit for transmit transactions from ocr2automation jo
12401240
FromAddress = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example
12411241
ForwarderAddress = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example
12421242
GasLimitDefault = 400_000 # Default
1243+
TxAcceptanceState = 2 # Default
1244+
PollPeriod = '2s' # Default
1245+
AcceptanceTimeout = '30s' # Default
12431246
```
12441247

12451248

@@ -1261,3 +1264,21 @@ GasLimitDefault = 400_000 # Default
12611264
```
12621265
GasLimitDefault is the default gas limit for workflow transactions.
12631266

1267+
### TxAcceptanceState
1268+
```toml
1269+
TxAcceptanceState = 2 # Default
1270+
```
1271+
TxAcceptanceState is the default acceptance state for writer DON tranmissions.
1272+
1273+
### PollPeriod
1274+
```toml
1275+
PollPeriod = '2s' # Default
1276+
```
1277+
PollPeriod is the default poll period for checking transmission state
1278+
1279+
### AcceptanceTimeout
1280+
```toml
1281+
AcceptanceTimeout = '30s' # Default
1282+
```
1283+
AcceptanceTimeout is the default timeout for a tranmission to be accepted on chain
1284+

pkg/txm/orchestrator.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,18 @@ func (o *Orchestrator[BLOCK_HASH, HEAD]) GetTransactionFee(ctx context.Context,
353353
}
354354

355355
func (o *Orchestrator[BLOCK_HASH, HEAD]) CalculateFee(feeParts txmgr.FeeParts) *big.Int {
356-
return big.NewInt(0)
356+
totalFee := new(big.Int)
357+
358+
gasUsed := new(big.Int).SetUint64(feeParts.GasUsed)
359+
price := feeParts.EffectiveGasPrice
360+
if price != nil {
361+
totalFee.Mul(gasUsed, price)
362+
}
363+
l1Fee := feeParts.L1Fee
364+
if l1Fee != nil {
365+
totalFee.Add(totalFee, l1Fee)
366+
}
367+
return totalFee
357368
}
358369

359370
func (o *Orchestrator[BLOCK_HASH, HEAD]) GetTransactionReceipt(ctx context.Context, transactionID string) (receipt *txmgrtypes.ChainReceipt[BLOCK_HASH, BLOCK_HASH], err error) {

0 commit comments

Comments
 (0)