Commit 6571307
committed
transaction: Add Coinbase newtype to distinguish coinbase transactions
Coinbase transactions have unique consensus rules and exceptions that
distinguish them from regular txs. We represent them using a
dedicated Coinbase(Transaction) new type
We use the transparent_newtype macro from internals for safe reference
conversion (&Transaction -> &Coinbase) without manual unsafe code
also it automatically adds #[repr(transparent)] which guarantees that
Coinbase has the exact same memory layout as Transaction1 parent f7274a5 commit 6571307
1 file changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
1157 | 1172 | | |
1158 | 1173 | | |
1159 | 1174 | | |
| |||
0 commit comments