Skip to content
This repository was archived by the owner on Apr 11, 2021. It is now read-only.

types: fix enums to match batch submitter #145

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions core/state_transition_ovm.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func asOvmMessage(tx *types.Transaction, signer types.Signer, decompressor commo
// inserting into Geth so we can make transactions easily parseable. However, this means that
// we need to re-encode the transactions before executing them.
var data = new(bytes.Buffer)
data.WriteByte(getSignatureType(msg)) // 1 byte: 00 == EIP 155, 02 == ETH Sign Message
data.WriteByte(uint8(msg.SignatureHashType())) // 1 byte: 00 == EIP 155, 01 == ETH Sign Message
data.Write(fillBytes(r, 32)) // 32 bytes: Signature `r` parameter
data.Write(fillBytes(s, 32)) // 32 bytes: Signature `s` parameter
data.Write(fillBytes(v, 1)) // 1 byte: Signature `v` parameter
Expand Down Expand Up @@ -180,18 +180,6 @@ func modMessage(
return outmsg, nil
}

func getSignatureType(
msg Message,
) uint8 {
if msg.SignatureHashType() == 0 {
return 0
} else if msg.SignatureHashType() == 1 {
return 2
} else {
return 1
}
}

func getQueueOrigin(
queueOrigin *big.Int,
) (types.QueueOrigin, error) {
Expand Down
4 changes: 2 additions & 2 deletions rollup/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ type CTCTransactionType uint8

const (
CTCTransactionTypeEIP155 CTCTransactionType = 0
CTCTransactionTypeEOA CTCTransactionType = 1
CTCTransactionTypeEthSign CTCTransactionType = 2
CTCTransactionTypeEthSign CTCTransactionType = 1
CTCTransactionTypeEOA CTCTransactionType = 2
)

type CTCTransaction struct {
Expand Down