Skip to content

Commit

Permalink
Chore: Rename tx to txn for eth transaction obj (part 2/n) (#10833)
Browse files Browse the repository at this point in the history
We gradually shift to using `txn` to mean blockchain/ethereum
transactions
  • Loading branch information
somnathb1 authored Jun 21, 2024
1 parent 39b75b2 commit 269bd3d
Show file tree
Hide file tree
Showing 50 changed files with 319 additions and 324 deletions.
4 changes: 2 additions & 2 deletions accounts/abi/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const (
// If the method is `Const` no transaction needs to be created for this
// particular Method call. It can easily be simulated using a local VM.
// For example a `Balance()` method only needs to retrieve something
// from the storage and therefore requires no Tx to be sent to the
// network. A method such as `Transact` does require a Tx and thus will
// from the storage and therefore requires no Txn to be sent to the
// network. A method such as `Transact` does require a Txn and thus will
// be flagged `false`.
// Input specifies the required input parameters for this gives method.
type Method struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/devnet/transactions/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func txHashInBlock(client *rpc.Client, hashmap map[libcommon.Hash]bool, blockNum
// check if txn is in the hash set and remove it from the set if it is present
if _, ok := hashmap[txnHash]; ok {
numFound++
logger.Info("SUCCESS => Tx included into block", "txHash", txnHash, "blockNum", blockNumber)
logger.Info("SUCCESS => Txn included into block", "txHash", txnHash, "blockNum", blockNumber)
// add the block number as an entry to the map
txToBlockMap[txnHash] = devnetutils.HexToInt(blockNumber)
delete(hashmap, txnHash)
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ The transaction tool is used to perform static validity checks on transactions s
* intrinsic gas calculation
* max values on integers
* fee semantics, such as `maxFeePerGas < maxPriorityFeePerGas`
* newer tx types on old forks
* newer txn types on old forks

### Examples

Expand Down
2 changes: 1 addition & 1 deletion cmd/integration/commands/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func withStartTx(cmd *cobra.Command) {
}

func withTraceFromTx(cmd *cobra.Command) {
cmd.Flags().Uint64Var(&traceFromTx, "txtrace.from", 0, "start tracing from tx number")
cmd.Flags().Uint64Var(&traceFromTx, "txtrace.from", 0, "start tracing from txn number")
}

func withOutputCsvFile(cmd *cobra.Command) {
Expand Down
12 changes: 6 additions & 6 deletions cmd/state/commands/opcode_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ func (ot *opcodeTracer) CaptureTxEnd(restGas uint64) {}
func (ot *opcodeTracer) captureStartOrEnter(from, to libcommon.Address, create bool, input []byte) {
//fmt.Fprint(ot.summary, ot.lastLine)

// When a CaptureStart is called, a Tx is starting. Create its entry in our list and initialize it with the partial data available
//calculate the "address" of the Tx in its tree
// When a CaptureStart is called, a Txn is starting. Create its entry in our list and initialize it with the partial data available
//calculate the "address" of the Txn in its tree
ltid := len(ot.txsInDepth)
if ltid-1 != ot.depth {
panic(fmt.Sprintf("Wrong addr slice depth: d=%d, slice len=%d", ot.depth, ltid))
Expand Down Expand Up @@ -208,15 +208,15 @@ func (ot *opcodeTracer) CaptureEnter(typ vm.OpCode, from libcommon.Address, to l
}

func (ot *opcodeTracer) captureEndOrExit(err error) {
// When a CaptureEnd is called, a Tx has finished. Pop our stack
// When a CaptureEnd is called, a Txn has finished. Pop our stack
ls := len(ot.stack)
currentEntry := ot.stack[ls-1]
ot.stack = ot.stack[:ls-1]
ot.txsInDepth = ot.txsInDepth[:ot.depth+1]

// sanity check: depth of stack == depth reported by system
if ls-1 != ot.depth || ot.depth != currentEntry.Depth {
panic(fmt.Sprintf("End of Tx at d=%d but stack has d=%d and entry has d=%d", ot.depth, ls, currentEntry.Depth))
panic(fmt.Sprintf("End of Txn at d=%d but stack has d=%d and entry has d=%d", ot.depth, ls, currentEntry.Depth))
}

// Close the last bblock
Expand Down Expand Up @@ -269,9 +269,9 @@ func (ot *opcodeTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64,
panic(fmt.Sprintf("Depth should be the same but isn't: current tx's %d, current entry's %d", currentTxDepth, currentEntry.Depth))
}

// is the Tx entry still not fully initialized?
// is the txn entry still not fully initialized?
if currentEntry.TxHash == nil {
// CaptureStart creates the entry for a new Tx, but doesn't have access to EVM data, like the Tx Hash
// CaptureStart creates the entry for a new Tx, but doesn't have access to EVM data, like the txn Hash
// here we ASSUME that the txn entry was recently created by CaptureStart
// AND that this is the first CaptureState that has happened since then
// AND that both Captures are for the same transaction
Expand Down
Loading

0 comments on commit 269bd3d

Please sign in to comment.