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

Commit 9a6324f

Browse files
authored
Merge pull request #168 from ethereumjs/new-release-2.1.0
New release: v2.1.0
2 parents 343ea82 + c33ff1f commit 9a6324f

10 files changed

+111
-87
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
dist/
22
.idea/
33
test-build/
4+
package-lock.json
45

56
# Created by https://www.gitignore.io/api/osx,node
67

CHANGELOG.md

+23
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
(modification: no type change headlines) and this project adheres to
77
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
88

9+
## [2.1.0] - 2018-06-28
10+
11+
**Using testnets and custom/private networks is now easier**
12+
13+
This release is focused on making this library easier to use in chains other than `mainnet`.
14+
15+
Using standard testnets can be as easy as passing their names to the `Transaction` constructor. For
16+
example, `new Transaction(rawTx, {chain: 'ropsten', hardfork: 'byzantium'})` is enough to use this
17+
library with Ropsten on Byzantium.
18+
19+
If you are using a custom network, you can take advantage of [ethereumjs-common](https://github.com/ethereumjs/ethereumjs-common),
20+
which contains all the network parameters. In this version of `ethereumjs-tx` you can use its new
21+
`Common.forCustomNetwork` to create a `Common` instance based on a standard network with some
22+
parameters changed. You can see an example of how to do this [here](https://github.com/ethereumjs/ethereumjs-common/blob/9e624f86107cea904d8171524130d92c99bf9302/src/index.ts).
23+
24+
List of changes:
25+
26+
- Upgraded [ethereumjs-common](https://github.com/ethereumjs/ethereumjs-common) to `^1.3.0`
27+
- Added more documentation and examples on how to create transactions for public testnets and
28+
custom networks.
29+
30+
[2.1.0]: https://github.com/ethereumjs/ethereumjs-tx/compare/v2.0.0...v2.1.0
31+
932
## [2.0.0] - 2019-06-03
1033

1134
**TypeScript / Module Import / Node Support**

docs/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
**Ƭ BufferLike**: _`Buffer` \| [TransformableToBuffer](interfaces/transformabletobuffer.md) \| [PrefixedHexString](#prefixedhexstring) \| `number`_
3131

32-
_Defined in [types.ts:19](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/types.ts#L19)_
32+
_Defined in [types.ts:19](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/types.ts#L19)_
3333

3434
A Buffer, hex string prefixed with `0x`, Number, or an object with a toBuffer method such as BN.
3535

@@ -41,7 +41,7 @@ A Buffer, hex string prefixed with `0x`, Number, or an object with a toBuffer me
4141

4242
**Ƭ PrefixedHexString**: _`string`_
4343

44-
_Defined in [types.ts:14](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/types.ts#L14)_
44+
_Defined in [types.ts:14](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/types.ts#L14)_
4545

4646
A hex string prefixed with `0x`.
4747

docs/classes/faketransaction.md

+28-28
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ _**see**_: Transaction
6565

6666
_Overrides [Transaction](transaction.md).[constructor](transaction.md#constructor)_
6767

68-
_Defined in [fake.ts:22](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/fake.ts#L22)_
68+
_Defined in [fake.ts:22](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/fake.ts#L22)_
6969

7070
**Parameters:**
7171

@@ -88,7 +88,7 @@ _Defined in [fake.ts:22](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca
8888

8989
_Inherited from [Transaction](transaction.md).[\_from](transaction.md#_from)_
9090

91-
_Defined in [transaction.ts:37](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L37)_
91+
_Defined in [transaction.ts:37](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L37)_
9292

9393
---
9494

@@ -100,7 +100,7 @@ _Defined in [transaction.ts:37](https://github.com/ethereumjs/ethereumjs-tx/blob
100100

101101
_Inherited from [Transaction](transaction.md).[data](transaction.md#data)_
102102

103-
_Defined in [transaction.ts:30](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L30)_
103+
_Defined in [transaction.ts:30](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L30)_
104104

105105
---
106106

@@ -110,7 +110,7 @@ _Defined in [transaction.ts:30](https://github.com/ethereumjs/ethereumjs-tx/blob
110110

111111
**● from**: _`Buffer`_
112112

113-
_Defined in [fake.ts:22](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/fake.ts#L22)_
113+
_Defined in [fake.ts:22](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/fake.ts#L22)_
114114

115115
Set from address to bypass transaction signing. This is not an optional property, as its getter never returns undefined.
116116

@@ -124,7 +124,7 @@ Set from address to bypass transaction signing. This is not an optional property
124124

125125
_Inherited from [Transaction](transaction.md).[gasLimit](transaction.md#gaslimit)_
126126

127-
_Defined in [transaction.ts:26](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L26)_
127+
_Defined in [transaction.ts:26](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L26)_
128128

129129
---
130130

@@ -136,7 +136,7 @@ _Defined in [transaction.ts:26](https://github.com/ethereumjs/ethereumjs-tx/blob
136136

137137
_Inherited from [Transaction](transaction.md).[gasPrice](transaction.md#gasprice)_
138138

139-
_Defined in [transaction.ts:27](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L27)_
139+
_Defined in [transaction.ts:27](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L27)_
140140

141141
---
142142

@@ -148,7 +148,7 @@ _Defined in [transaction.ts:27](https://github.com/ethereumjs/ethereumjs-tx/blob
148148

149149
_Inherited from [Transaction](transaction.md).[nonce](transaction.md#nonce)_
150150

151-
_Defined in [transaction.ts:25](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L25)_
151+
_Defined in [transaction.ts:25](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L25)_
152152

153153
---
154154

@@ -160,7 +160,7 @@ _Defined in [transaction.ts:25](https://github.com/ethereumjs/ethereumjs-tx/blob
160160

161161
_Inherited from [Transaction](transaction.md).[r](transaction.md#r)_
162162

163-
_Defined in [transaction.ts:32](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L32)_
163+
_Defined in [transaction.ts:32](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L32)_
164164

165165
---
166166

@@ -172,7 +172,7 @@ _Defined in [transaction.ts:32](https://github.com/ethereumjs/ethereumjs-tx/blob
172172

173173
_Inherited from [Transaction](transaction.md).[raw](transaction.md#raw)_
174174

175-
_Defined in [transaction.ts:24](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L24)_
175+
_Defined in [transaction.ts:24](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L24)_
176176

177177
---
178178

@@ -184,7 +184,7 @@ _Defined in [transaction.ts:24](https://github.com/ethereumjs/ethereumjs-tx/blob
184184

185185
_Inherited from [Transaction](transaction.md).[s](transaction.md#s)_
186186

187-
_Defined in [transaction.ts:33](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L33)_
187+
_Defined in [transaction.ts:33](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L33)_
188188

189189
---
190190

@@ -196,7 +196,7 @@ _Defined in [transaction.ts:33](https://github.com/ethereumjs/ethereumjs-tx/blob
196196

197197
_Inherited from [Transaction](transaction.md).[to](transaction.md#to)_
198198

199-
_Defined in [transaction.ts:28](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L28)_
199+
_Defined in [transaction.ts:28](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L28)_
200200

201201
---
202202

@@ -208,7 +208,7 @@ _Defined in [transaction.ts:28](https://github.com/ethereumjs/ethereumjs-tx/blob
208208

209209
_Inherited from [Transaction](transaction.md).[v](transaction.md#v)_
210210

211-
_Defined in [transaction.ts:31](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L31)_
211+
_Defined in [transaction.ts:31](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L31)_
212212

213213
---
214214

@@ -220,7 +220,7 @@ _Defined in [transaction.ts:31](https://github.com/ethereumjs/ethereumjs-tx/blob
220220

221221
_Inherited from [Transaction](transaction.md).[value](transaction.md#value)_
222222

223-
_Defined in [transaction.ts:29](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L29)_
223+
_Defined in [transaction.ts:29](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L29)_
224224

225225
---
226226

@@ -234,7 +234,7 @@ _Defined in [transaction.ts:29](https://github.com/ethereumjs/ethereumjs-tx/blob
234234

235235
_Inherited from [Transaction](transaction.md).[getBaseFee](transaction.md#getbasefee)_
236236

237-
_Defined in [transaction.ts:296](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L296)_
237+
_Defined in [transaction.ts:296](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L296)_
238238

239239
the minimum amount of gas the tx must have (DataFee + TxFee + Creation Fee)
240240

@@ -250,7 +250,7 @@ the minimum amount of gas the tx must have (DataFee + TxFee + Creation Fee)
250250

251251
_Inherited from [Transaction](transaction.md).[getChainId](transaction.md#getchainid)_
252252

253-
_Defined in [transaction.ts:202](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L202)_
253+
_Defined in [transaction.ts:202](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L202)_
254254

255255
returns chain ID
256256

@@ -266,7 +266,7 @@ returns chain ID
266266

267267
_Inherited from [Transaction](transaction.md).[getDataFee](transaction.md#getdatafee)_
268268

269-
_Defined in [transaction.ts:282](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L282)_
269+
_Defined in [transaction.ts:282](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L282)_
270270

271271
The amount of gas paid for the data in this tx
272272

@@ -282,7 +282,7 @@ The amount of gas paid for the data in this tx
282282

283283
_Inherited from [Transaction](transaction.md).[getSenderAddress](transaction.md#getsenderaddress)_
284284

285-
_Defined in [transaction.ts:209](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L209)_
285+
_Defined in [transaction.ts:209](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L209)_
286286

287287
returns the sender's address
288288

@@ -298,7 +298,7 @@ returns the sender's address
298298

299299
_Inherited from [Transaction](transaction.md).[getSenderPublicKey](transaction.md#getsenderpublickey)_
300300

301-
_Defined in [transaction.ts:221](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L221)_
301+
_Defined in [transaction.ts:221](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L221)_
302302

303303
returns the public key of the sender
304304

@@ -314,7 +314,7 @@ returns the public key of the sender
314314

315315
_Inherited from [Transaction](transaction.md).[getUpfrontCost](transaction.md#getupfrontcost)_
316316

317-
_Defined in [transaction.ts:307](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L307)_
317+
_Defined in [transaction.ts:307](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L307)_
318318

319319
the up front amount that an account must have for this transaction to be valid
320320

@@ -330,7 +330,7 @@ the up front amount that an account must have for this transaction to be valid
330330

331331
_Overrides [Transaction](transaction.md).[hash](transaction.md#hash)_
332332

333-
_Defined in [fake.ts:53](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/fake.ts#L53)_
333+
_Defined in [fake.ts:53](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/fake.ts#L53)_
334334

335335
Computes a sha3-256 hash of the serialized tx, using the sender address to generate a fake signature.
336336

@@ -352,7 +352,7 @@ Computes a sha3-256 hash of the serialized tx, using the sender address to gener
352352

353353
_Inherited from [Transaction](transaction.md).[serialize](transaction.md#serialize)_
354354

355-
_Defined in [transaction.ts:337](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L337)_
355+
_Defined in [transaction.ts:337](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L337)_
356356

357357
Returns the rlp encoding of the transaction
358358

@@ -368,7 +368,7 @@ Returns the rlp encoding of the transaction
368368

369369
_Inherited from [Transaction](transaction.md).[sign](transaction.md#sign)_
370370

371-
_Defined in [transaction.ts:262](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L262)_
371+
_Defined in [transaction.ts:262](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L262)_
372372

373373
sign a transaction with a given private key
374374

@@ -390,7 +390,7 @@ sign a transaction with a given private key
390390

391391
_Inherited from [Transaction](transaction.md).[toCreationAddress](transaction.md#tocreationaddress)_
392392

393-
_Defined in [transaction.ts:169](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L169)_
393+
_Defined in [transaction.ts:169](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L169)_
394394

395395
If the tx's `to` is to the creation address
396396

@@ -406,7 +406,7 @@ If the tx's `to` is to the creation address
406406

407407
_Inherited from [Transaction](transaction.md).[toJSON](transaction.md#tojson)_
408408

409-
_Defined in [transaction.ts:346](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L346)_
409+
_Defined in [transaction.ts:346](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L346)_
410410

411411
Returns the transaction in JSON format
412412

@@ -434,15 +434,15 @@ _**see**_: [ethereumjs-util](https://github.com/ethereumjs/ethereumjs-util/blob/
434434

435435
_Inherited from [Transaction](transaction.md).[validate](transaction.md#validate)_
436436

437-
_Defined in [transaction.ts:314](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L314)_
437+
_Defined in [transaction.ts:314](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L314)_
438438

439439
Validates the signature and checks to see if it has enough gas.
440440

441441
**Returns:** `boolean`
442442

443443
_Inherited from [Transaction](transaction.md).[validate](transaction.md#validate)_
444444

445-
_Defined in [transaction.ts:315](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L315)_
445+
_Defined in [transaction.ts:315](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L315)_
446446

447447
**Parameters:**
448448

@@ -454,7 +454,7 @@ _Defined in [transaction.ts:315](https://github.com/ethereumjs/ethereumjs-tx/blo
454454

455455
_Inherited from [Transaction](transaction.md).[validate](transaction.md#validate)_
456456

457-
_Defined in [transaction.ts:316](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L316)_
457+
_Defined in [transaction.ts:316](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L316)_
458458

459459
**Parameters:**
460460

@@ -474,7 +474,7 @@ _Defined in [transaction.ts:316](https://github.com/ethereumjs/ethereumjs-tx/blo
474474

475475
_Inherited from [Transaction](transaction.md).[verifySignature](transaction.md#verifysignature)_
476476

477-
_Defined in [transaction.ts:233](https://github.com/ethereumjs/ethereumjs-tx/blob/5b72ca6/src/transaction.ts#L233)_
477+
_Defined in [transaction.ts:233](https://github.com/ethereumjs/ethereumjs-tx/blob/5c81b38/src/transaction.ts#L233)_
478478

479479
Determines if the signature is valid
480480

0 commit comments

Comments
 (0)