@arkecosystem/typescript-crypto 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/enums/index.d.ts +0 -1
- package/dist/enums/index.d.ts.map +1 -1
- package/dist/enums/index.js +0 -1
- package/dist/identities/PrivateKey.d.ts.map +1 -1
- package/dist/identities/PrivateKey.js +3 -4
- package/dist/index.js +32 -45
- package/dist/transactions/Deserializer.d.ts.map +1 -1
- package/dist/transactions/Deserializer.js +18 -16
- package/dist/transactions/builders/AbstractTransactionBuilder.d.ts +1 -2
- package/dist/transactions/builders/AbstractTransactionBuilder.d.ts.map +1 -1
- package/dist/transactions/builders/AbstractTransactionBuilder.js +7 -13
- package/dist/transactions/types/AbstractTransaction.d.ts.map +1 -1
- package/dist/transactions/types/AbstractTransaction.js +4 -6
- package/dist/types.d.ts +2 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/TransactionUtils.d.ts.map +1 -1
- package/dist/utils/TransactionUtils.js +14 -12
- package/package.json +1 -1
- package/src/enums/index.ts +0 -1
- package/src/identities/PrivateKey.ts +3 -4
- package/src/transactions/Deserializer.ts +22 -19
- package/src/transactions/builders/AbstractTransactionBuilder.ts +7 -15
- package/src/transactions/types/AbstractTransaction.ts +4 -6
- package/src/types.ts +2 -4
- package/src/utils/TransactionUtils.ts +11 -8
- package/tests/fixtures/identity.json +2 -1
- package/tests/fixtures/message-sign.json +1 -1
- package/tests/fixtures/sign-compact.json +1 -1
- package/tests/fixtures/transactions/evm-sign.json +7 -7
- package/tests/fixtures/transactions/multipayment-empty.json +7 -7
- package/tests/fixtures/transactions/multipayment-single.json +7 -7
- package/tests/fixtures/transactions/multipayment.json +7 -7
- package/tests/fixtures/transactions/transfer-0.json +7 -7
- package/tests/fixtures/transactions/transfer-large-amount.json +7 -7
- package/tests/fixtures/transactions/transfer-legacy-second-signature.json +8 -8
- package/tests/fixtures/transactions/transfer.json +7 -7
- package/tests/fixtures/transactions/unvote.json +7 -7
- package/tests/fixtures/transactions/username-registration.json +7 -7
- package/tests/fixtures/transactions/username-resignation.json +7 -7
- package/tests/fixtures/transactions/validator-registration.json +8 -8
- package/tests/fixtures/transactions/validator-resignation.json +7 -7
- package/tests/fixtures/transactions/vote.json +7 -7
- package/tests/unit/identities/PublicKey.test.ts +3 -4
- package/tests/unit/transactions/Deserializer.test.ts +12 -11
- package/tests/unit/transactions/Serializer.test.ts +5 -6
- package/tests/unit/transactions/builders/EvmCallBuilder.test.ts +7 -14
- package/tests/unit/transactions/builders/MultipaymentBuilder.test.ts +15 -29
- package/tests/unit/transactions/builders/TransferBuilder.test.ts +15 -29
- package/tests/unit/transactions/builders/UnvoteBuilder.test.ts +7 -14
- package/tests/unit/transactions/builders/UsernameRegistrationBuilder.test.ts +8 -15
- package/tests/unit/transactions/builders/UsernameResignationBuilder.test.ts +7 -14
- package/tests/unit/transactions/builders/ValidatorRegistrationBuilder.test.ts +9 -18
- package/tests/unit/transactions/builders/ValidatorResignationBuilder.test.ts +7 -14
- package/tests/unit/transactions/builders/VoteBuilder.test.ts +7 -14
- package/tests/unit/transactions/types/AbstractTransaction.test.ts +6 -8
- package/tests/unit/utils/TransactionUtils.test.ts +5 -7
- package/dist/enums/Constants.d.ts +0 -5
- package/dist/enums/Constants.d.ts.map +0 -1
- package/dist/enums/Constants.js +0 -5
- package/src/enums/Constants.ts +0 -4
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Deserializer } from "@/transactions/Deserializer";
|
|
2
1
|
import {
|
|
3
2
|
EvmCall,
|
|
4
3
|
Multipayment,
|
|
@@ -9,6 +8,8 @@ import {
|
|
|
9
8
|
ValidatorResignation,
|
|
10
9
|
Vote,
|
|
11
10
|
} from "@/transactions/types";
|
|
11
|
+
|
|
12
|
+
import { Deserializer } from "@/transactions/Deserializer";
|
|
12
13
|
import { Transfer } from "@/transactions/types/Transfer";
|
|
13
14
|
import fixtureTransfer from "@tests/fixtures/transactions/transfer.json";
|
|
14
15
|
|
|
@@ -40,7 +41,7 @@ it("should deserialize transfer", () => {
|
|
|
40
41
|
"hash",
|
|
41
42
|
"nonce",
|
|
42
43
|
"gasPrice",
|
|
43
|
-
"
|
|
44
|
+
"gasLimit",
|
|
44
45
|
"value",
|
|
45
46
|
"v",
|
|
46
47
|
"r",
|
|
@@ -54,7 +55,7 @@ it("should deserialize transfer", () => {
|
|
|
54
55
|
it("should deserialize a transfer signed with a passphrase", async () => {
|
|
55
56
|
const fixture = await getFixture("transfer");
|
|
56
57
|
|
|
57
|
-
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "
|
|
58
|
+
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "gasLimit", "value", "v", "r", "s"]);
|
|
58
59
|
|
|
59
60
|
expect(transaction).toBeInstanceOf(Transfer);
|
|
60
61
|
});
|
|
@@ -62,7 +63,7 @@ it("should deserialize a transfer signed with a passphrase", async () => {
|
|
|
62
63
|
it("should deserialize a transfer signed with a passphrase with 0 value", async () => {
|
|
63
64
|
const fixture = await getFixture("transfer-0");
|
|
64
65
|
|
|
65
|
-
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "
|
|
66
|
+
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "gasLimit", "value", "v", "r", "s"]);
|
|
66
67
|
|
|
67
68
|
expect(transaction).toBeInstanceOf(EvmCall);
|
|
68
69
|
});
|
|
@@ -70,7 +71,7 @@ it("should deserialize a transfer signed with a passphrase with 0 value", async
|
|
|
70
71
|
it("should deserialize a vote signed with a passphrase", async () => {
|
|
71
72
|
const fixture = await getFixture("vote");
|
|
72
73
|
|
|
73
|
-
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "
|
|
74
|
+
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "gasLimit", "value", "v", "r", "s"]);
|
|
74
75
|
|
|
75
76
|
expect(transaction.data["vote"]).toEqual("0xC3bBE9B1CeE1ff85Ad72b87414B0E9B7F2366763");
|
|
76
77
|
|
|
@@ -82,7 +83,7 @@ it("should deserialize a vote signed with a passphrase", async () => {
|
|
|
82
83
|
it("should deserialize a unvote signed with a passphrase", async () => {
|
|
83
84
|
const fixture = await getFixture("unvote");
|
|
84
85
|
|
|
85
|
-
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "
|
|
86
|
+
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "gasLimit", "value", "v", "r", "s"]);
|
|
86
87
|
|
|
87
88
|
expect(transaction).toBeInstanceOf(Unvote);
|
|
88
89
|
});
|
|
@@ -90,7 +91,7 @@ it("should deserialize a unvote signed with a passphrase", async () => {
|
|
|
90
91
|
it("should deserialize a validator registration signed with a passphrase", async () => {
|
|
91
92
|
const fixture = await getFixture("validator-registration");
|
|
92
93
|
|
|
93
|
-
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "
|
|
94
|
+
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "gasLimit", "value", "v", "r", "s"]);
|
|
94
95
|
|
|
95
96
|
expect(transaction).toBeInstanceOf(ValidatorRegistration);
|
|
96
97
|
});
|
|
@@ -98,7 +99,7 @@ it("should deserialize a validator registration signed with a passphrase", async
|
|
|
98
99
|
it("should deserialize a validator resignation signed with a passphrase", async () => {
|
|
99
100
|
const fixture = await getFixture("validator-resignation");
|
|
100
101
|
|
|
101
|
-
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "
|
|
102
|
+
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "gasLimit", "value", "v", "r", "s"]);
|
|
102
103
|
|
|
103
104
|
expect(transaction).toBeInstanceOf(ValidatorResignation);
|
|
104
105
|
});
|
|
@@ -106,7 +107,7 @@ it("should deserialize a validator resignation signed with a passphrase", async
|
|
|
106
107
|
it("should deserialize a username registration signed with a passphrase", async () => {
|
|
107
108
|
const fixture = await getFixture("username-registration");
|
|
108
109
|
|
|
109
|
-
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "
|
|
110
|
+
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "gasLimit", "value", "v", "r", "s"]);
|
|
110
111
|
|
|
111
112
|
expect(transaction).toBeInstanceOf(UsernameRegistration);
|
|
112
113
|
});
|
|
@@ -114,7 +115,7 @@ it("should deserialize a username registration signed with a passphrase", async
|
|
|
114
115
|
it("should deserialize a username resignation signed with a passphrase", async () => {
|
|
115
116
|
const fixture = await getFixture("username-resignation");
|
|
116
117
|
|
|
117
|
-
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "
|
|
118
|
+
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "gasLimit", "value", "v", "r", "s"]);
|
|
118
119
|
|
|
119
120
|
expect(transaction).toBeInstanceOf(UsernameResignation);
|
|
120
121
|
});
|
|
@@ -122,7 +123,7 @@ it("should deserialize a username resignation signed with a passphrase", async (
|
|
|
122
123
|
it("should deserialize a multipayment signed with a passphrase", async () => {
|
|
123
124
|
const fixture = await getFixture("multipayment");
|
|
124
125
|
|
|
125
|
-
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "
|
|
126
|
+
const transaction = assertDeserialized(fixture, ["hash", "nonce", "gasPrice", "gasLimit", "value", "v", "r", "s"]);
|
|
126
127
|
|
|
127
128
|
expect(transaction).toBeInstanceOf(Multipayment);
|
|
128
129
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import fixtureTransfer from "@tests/fixtures/transactions/transfer.json";
|
|
2
|
-
|
|
3
|
-
import { Transfer } from "@/transactions/types/Transfer";
|
|
4
1
|
import { Serializer } from "../../../src/transactions/Serializer";
|
|
2
|
+
import { Transfer } from "@/transactions/types/Transfer";
|
|
3
|
+
import fixtureTransfer from "@tests/fixtures/transactions/transfer.json";
|
|
5
4
|
|
|
6
5
|
it("should serialize a transfer transaction", () => {
|
|
7
6
|
const transaction = new Transfer(fixtureTransfer.data);
|
|
@@ -12,8 +11,8 @@ it("should serialize a transfer transaction", () => {
|
|
|
12
11
|
it("should serialize a transfer transaction without a signature", () => {
|
|
13
12
|
const transaction = new Transfer(fixtureTransfer.data);
|
|
14
13
|
|
|
15
|
-
// We slice the first few bytes because the serialization is different when the transaction is signed
|
|
16
|
-
expect(new Serializer(transaction).serialize(true).toString("hex").slice(4)).toEqual(
|
|
17
|
-
fixtureTransfer["serialized"].slice(6,
|
|
14
|
+
// We slice the first few bytes and last bytes (dummy signature) because the serialization is different when the transaction is signed
|
|
15
|
+
expect(new Serializer(transaction).serialize(true).toString("hex").slice(4, 78)).toEqual(
|
|
16
|
+
fixtureTransfer["serialized"].slice(6, 80),
|
|
18
17
|
);
|
|
19
18
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { EvmCallBuilder } from "@/transactions/builders/EvmCallBuilder";
|
|
1
2
|
import fixture from "@tests/fixtures/transactions/evm-sign.json";
|
|
2
3
|
import identityFixture from "@tests/fixtures/identity.json";
|
|
3
4
|
|
|
4
|
-
import { EvmCallBuilder } from "@/transactions/builders/EvmCallBuilder";
|
|
5
|
-
|
|
6
5
|
it("should build a transaction", async () => {
|
|
7
6
|
const transaction = (
|
|
8
7
|
await EvmCallBuilder.new()
|
|
@@ -10,15 +9,13 @@ it("should build a transaction", async () => {
|
|
|
10
9
|
.to(fixture.data.to)
|
|
11
10
|
.nonce(fixture.data.nonce)
|
|
12
11
|
.gasPrice(fixture.data.gasPrice)
|
|
13
|
-
.
|
|
14
|
-
.network(fixture.data.network)
|
|
12
|
+
.gasLimit(fixture.data.gasLimit)
|
|
15
13
|
.sign(identityFixture.passphrase)
|
|
16
14
|
).transaction;
|
|
17
15
|
|
|
18
16
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
19
17
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
20
|
-
expect(transaction.data.
|
|
21
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
18
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
22
19
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
23
20
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
24
21
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -35,8 +32,7 @@ it("should sign a transaction", async () => {
|
|
|
35
32
|
|
|
36
33
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
37
34
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
38
|
-
expect(transaction.data.
|
|
39
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
35
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
40
36
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
41
37
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
42
38
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -62,8 +58,7 @@ it("should convert to an array", async () => {
|
|
|
62
58
|
to: fixture.data.to,
|
|
63
59
|
value: fixture.data.value,
|
|
64
60
|
gasPrice: fixture.data.gasPrice,
|
|
65
|
-
|
|
66
|
-
network: fixture.data.network,
|
|
61
|
+
gasLimit: fixture.data.gasLimit,
|
|
67
62
|
nonce: fixture.data.nonce,
|
|
68
63
|
v: fixture.data.v,
|
|
69
64
|
r: fixture.data.r,
|
|
@@ -79,9 +74,8 @@ it("should convert to json", async () => {
|
|
|
79
74
|
expect(transaction.toJson()).toEqual(
|
|
80
75
|
JSON.stringify({
|
|
81
76
|
gasPrice: fixture.data.gasPrice,
|
|
82
|
-
network: fixture.data.network,
|
|
83
77
|
hash: fixture.data.hash,
|
|
84
|
-
|
|
78
|
+
gasLimit: fixture.data.gasLimit,
|
|
85
79
|
nonce: fixture.data.nonce,
|
|
86
80
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
87
81
|
to: fixture.data.to,
|
|
@@ -100,9 +94,8 @@ it("should convert to string", async () => {
|
|
|
100
94
|
expect(transaction.toString()).toEqual(
|
|
101
95
|
JSON.stringify({
|
|
102
96
|
gasPrice: fixture.data.gasPrice,
|
|
103
|
-
network: fixture.data.network,
|
|
104
97
|
hash: fixture.data.hash,
|
|
105
|
-
|
|
98
|
+
gasLimit: fixture.data.gasLimit,
|
|
106
99
|
nonce: fixture.data.nonce,
|
|
107
100
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
108
101
|
to: fixture.data.to,
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
+
import { MultipaymentBuilder } from "@/transactions/builders/MultipaymentBuilder";
|
|
2
|
+
import { UnitConverter } from "@/utils/UnitConverter";
|
|
1
3
|
import fixture from "@tests/fixtures/transactions/multipayment.json";
|
|
2
4
|
import fixtureEmpty from "@tests/fixtures/transactions/multipayment-empty.json";
|
|
3
5
|
import fixtureSingle from "@tests/fixtures/transactions/multipayment-single.json";
|
|
4
6
|
import identityFixture from "@tests/fixtures/identity.json";
|
|
5
7
|
|
|
6
|
-
import { MultipaymentBuilder } from "@/transactions/builders/MultipaymentBuilder";
|
|
7
|
-
import { UnitConverter } from "@/utils/UnitConverter";
|
|
8
|
-
|
|
9
8
|
it("should build a transaction", async () => {
|
|
10
9
|
const transaction = (
|
|
11
10
|
await MultipaymentBuilder.new()
|
|
12
11
|
.pay("0x6F0182a0cc707b055322CcF6d4CB6a5Aff1aEb22", "100000")
|
|
13
12
|
.pay("0xc3bbe9b1cee1ff85ad72b87414b0e9b7f2366763", "200000")
|
|
14
13
|
.gasPrice(fixture.data.gasPrice)
|
|
15
|
-
.
|
|
16
|
-
.network(fixture.data.network)
|
|
14
|
+
.gasLimit(fixture.data.gasLimit)
|
|
17
15
|
.sign(identityFixture.passphrase)
|
|
18
16
|
).transaction;
|
|
19
17
|
|
|
20
18
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
21
19
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
22
|
-
expect(transaction.data.
|
|
23
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
20
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
24
21
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
25
22
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
26
23
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -38,8 +35,7 @@ it("should sign a transaction", async () => {
|
|
|
38
35
|
|
|
39
36
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
40
37
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
41
|
-
expect(transaction.data.
|
|
42
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
38
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
43
39
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
44
40
|
expect(transaction.data.value).toBe(BigInt(fixture.data.value));
|
|
45
41
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -56,15 +52,13 @@ it("should build a transaction with a single payment", async () => {
|
|
|
56
52
|
await MultipaymentBuilder.new()
|
|
57
53
|
.pay("0x6F0182a0cc707b055322CcF6d4CB6a5Aff1aEb22", "100000")
|
|
58
54
|
.gasPrice(fixtureSingle.data.gasPrice)
|
|
59
|
-
.
|
|
60
|
-
.network(fixtureSingle.data.network)
|
|
55
|
+
.gasLimit(fixtureSingle.data.gasLimit)
|
|
61
56
|
.sign(identityFixture.passphrase)
|
|
62
57
|
).transaction;
|
|
63
58
|
|
|
64
59
|
expect(transaction.data.gasPrice).toBe(fixtureSingle.data.gasPrice);
|
|
65
60
|
expect(transaction.data.nonce).toBe(fixtureSingle.data.nonce);
|
|
66
|
-
expect(transaction.data.
|
|
67
|
-
expect(transaction.data.gas).toBe(fixtureSingle.data.gas);
|
|
61
|
+
expect(transaction.data.gasLimit).toBe(fixtureSingle.data.gasLimit);
|
|
68
62
|
expect(transaction.data.to).toBe(fixtureSingle.data.to);
|
|
69
63
|
expect(transaction.data.value).toBe(fixtureSingle.data.value);
|
|
70
64
|
expect(transaction.data.v).toBe(fixtureSingle.data.v);
|
|
@@ -80,15 +74,13 @@ it("should build a transaction with an empty payment", async () => {
|
|
|
80
74
|
const transaction = (
|
|
81
75
|
await MultipaymentBuilder.new()
|
|
82
76
|
.gasPrice(fixtureEmpty.data.gasPrice)
|
|
83
|
-
.
|
|
84
|
-
.network(fixtureEmpty.data.network)
|
|
77
|
+
.gasLimit(fixtureEmpty.data.gasLimit)
|
|
85
78
|
.sign(identityFixture.passphrase)
|
|
86
79
|
).transaction;
|
|
87
80
|
|
|
88
81
|
expect(transaction.data.gasPrice).toBe(fixtureEmpty.data.gasPrice);
|
|
89
82
|
expect(transaction.data.nonce).toBe(fixtureEmpty.data.nonce);
|
|
90
|
-
expect(transaction.data.
|
|
91
|
-
expect(transaction.data.gas).toBe(fixtureEmpty.data.gas);
|
|
83
|
+
expect(transaction.data.gasLimit).toBe(fixtureEmpty.data.gasLimit);
|
|
92
84
|
expect(transaction.data.to).toBe(fixtureEmpty.data.to);
|
|
93
85
|
expect(transaction.data.value).toBe(fixtureEmpty.data.value);
|
|
94
86
|
expect(transaction.data.v).toBe(fixtureEmpty.data.v);
|
|
@@ -106,15 +98,13 @@ it("should handle bignumber values", async () => {
|
|
|
106
98
|
.pay("0x6F0182a0cc707b055322CcF6d4CB6a5Aff1aEb22", UnitConverter.parseUnits("100000", "wei"))
|
|
107
99
|
.pay("0xc3bbe9b1cee1ff85ad72b87414b0e9b7f2366763", UnitConverter.parseUnits("200000", "wei"))
|
|
108
100
|
.gasPrice(UnitConverter.parseUnits(fixture.data.gasPrice, "wei"))
|
|
109
|
-
.
|
|
110
|
-
.network(fixture.data.network)
|
|
101
|
+
.gasLimit(UnitConverter.parseUnits(fixture.data.gasLimit, "wei"))
|
|
111
102
|
.sign(identityFixture.passphrase)
|
|
112
103
|
).transaction;
|
|
113
104
|
|
|
114
105
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
115
106
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
116
|
-
expect(transaction.data.
|
|
117
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
107
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
118
108
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
119
109
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
120
110
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -129,8 +119,7 @@ it("should handle bignumber values", async () => {
|
|
|
129
119
|
it("should track value correctly on pay when initially not set", async () => {
|
|
130
120
|
const builder = await MultipaymentBuilder.new()
|
|
131
121
|
.gasPrice(fixtureSingle.data.gasPrice)
|
|
132
|
-
.
|
|
133
|
-
.network(fixtureSingle.data.network);
|
|
122
|
+
.gasLimit(fixtureSingle.data.gasLimit);
|
|
134
123
|
|
|
135
124
|
builder.transaction.data.value = undefined;
|
|
136
125
|
|
|
@@ -153,8 +142,7 @@ it("should convert to an array", async () => {
|
|
|
153
142
|
to: fixture.data.to,
|
|
154
143
|
value: fixture.data.value,
|
|
155
144
|
gasPrice: fixture.data.gasPrice,
|
|
156
|
-
|
|
157
|
-
network: fixture.data.network,
|
|
145
|
+
gasLimit: fixture.data.gasLimit,
|
|
158
146
|
nonce: fixture.data.nonce,
|
|
159
147
|
v: fixture.data.v,
|
|
160
148
|
r: fixture.data.r,
|
|
@@ -170,9 +158,8 @@ it("should convert to json", async () => {
|
|
|
170
158
|
expect(transaction.toJson()).toEqual(
|
|
171
159
|
JSON.stringify({
|
|
172
160
|
gasPrice: fixture.data.gasPrice,
|
|
173
|
-
network: fixture.data.network,
|
|
174
161
|
hash: fixture.data.hash,
|
|
175
|
-
|
|
162
|
+
gasLimit: fixture.data.gasLimit,
|
|
176
163
|
nonce: fixture.data.nonce,
|
|
177
164
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
178
165
|
to: fixture.data.to,
|
|
@@ -191,9 +178,8 @@ it("should convert to string", async () => {
|
|
|
191
178
|
expect(transaction.toString()).toEqual(
|
|
192
179
|
JSON.stringify({
|
|
193
180
|
gasPrice: fixture.data.gasPrice,
|
|
194
|
-
network: fixture.data.network,
|
|
195
181
|
hash: fixture.data.hash,
|
|
196
|
-
|
|
182
|
+
gasLimit: fixture.data.gasLimit,
|
|
197
183
|
nonce: fixture.data.nonce,
|
|
198
184
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
199
185
|
to: fixture.data.to,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { TransferBuilder } from "@/transactions/builders/TransferBuilder";
|
|
2
|
+
import { UnitConverter } from "@/utils/UnitConverter";
|
|
1
3
|
import fixture from "@tests/fixtures/transactions/transfer.json";
|
|
2
4
|
import legacySecondSignatureFixture from "@tests/fixtures/transactions/transfer-legacy-second-signature.json";
|
|
3
5
|
import fixtureTransferLargeAmount from "@tests/fixtures/transactions/transfer-large-amount.json";
|
|
4
6
|
import identityFixture from "@tests/fixtures/identity.json";
|
|
5
7
|
|
|
6
|
-
import { TransferBuilder } from "@/transactions/builders/TransferBuilder";
|
|
7
|
-
import { UnitConverter } from "@/utils/UnitConverter";
|
|
8
|
-
|
|
9
8
|
it("should build a transaction", async () => {
|
|
10
9
|
const transaction = (
|
|
11
10
|
await TransferBuilder.new()
|
|
@@ -13,15 +12,13 @@ it("should build a transaction", async () => {
|
|
|
13
12
|
.to(fixture.data.to)
|
|
14
13
|
.nonce(fixture.data.nonce)
|
|
15
14
|
.gasPrice(fixture.data.gasPrice)
|
|
16
|
-
.
|
|
17
|
-
.network(fixture.data.network)
|
|
15
|
+
.gasLimit(fixture.data.gasLimit)
|
|
18
16
|
.sign(identityFixture.passphrase)
|
|
19
17
|
).transaction;
|
|
20
18
|
|
|
21
19
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
22
20
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
23
|
-
expect(transaction.data.
|
|
24
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
21
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
25
22
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
26
23
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
27
24
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -38,8 +35,7 @@ it("should sign a transaction", async () => {
|
|
|
38
35
|
|
|
39
36
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
40
37
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
41
|
-
expect(transaction.data.
|
|
42
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
38
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
43
39
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
44
40
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
45
41
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -58,22 +54,19 @@ it("should build a transaction using legacy second signature", async () => {
|
|
|
58
54
|
.to(legacySecondSignatureFixture.data.to)
|
|
59
55
|
.nonce(legacySecondSignatureFixture.data.nonce)
|
|
60
56
|
.gasPrice(legacySecondSignatureFixture.data.gasPrice)
|
|
61
|
-
.
|
|
62
|
-
.
|
|
63
|
-
.legacySecondSign(identityFixture.passphrase, identityFixture.passphrase)
|
|
57
|
+
.gasLimit(legacySecondSignatureFixture.data.gasLimit)
|
|
58
|
+
.legacySecondSign(identityFixture.passphrase, identityFixture.secondPassphrase)
|
|
64
59
|
).transaction;
|
|
65
60
|
|
|
66
61
|
expect(transaction.data.gasPrice).toBe(legacySecondSignatureFixture.data.gasPrice);
|
|
62
|
+
expect(transaction.data.gasLimit).toBe(legacySecondSignatureFixture.data.gasLimit);
|
|
67
63
|
expect(transaction.data.nonce).toBe(legacySecondSignatureFixture.data.nonce);
|
|
68
|
-
expect(transaction.data.network).toBe(legacySecondSignatureFixture.data.network);
|
|
69
|
-
expect(transaction.data.gas).toBe(legacySecondSignatureFixture.data.gas);
|
|
70
64
|
expect(transaction.data.to).toBe(legacySecondSignatureFixture.data.to);
|
|
71
65
|
expect(transaction.data.value).toBe(legacySecondSignatureFixture.data.value);
|
|
72
66
|
expect(transaction.data.v).toBe(legacySecondSignatureFixture.data.v);
|
|
73
67
|
expect(transaction.data.r).toBe(legacySecondSignatureFixture.data.r);
|
|
74
68
|
expect(transaction.data.s).toBe(legacySecondSignatureFixture.data.s);
|
|
75
69
|
expect(transaction.data.hash).toBe(legacySecondSignatureFixture.data.hash);
|
|
76
|
-
expect(transaction.data.hash).toBe(legacySecondSignatureFixture.data.hash);
|
|
77
70
|
expect(transaction.data.legacySecondSignature).toBe(legacySecondSignatureFixture.data.legacySecondSignature);
|
|
78
71
|
|
|
79
72
|
expect(transaction.serialize().toString("hex")).toEqual(legacySecondSignatureFixture.serialized);
|
|
@@ -87,15 +80,13 @@ it("should handle large amounts", async () => {
|
|
|
87
80
|
.to(fixtureTransferLargeAmount.data.to)
|
|
88
81
|
.nonce(fixtureTransferLargeAmount.data.nonce)
|
|
89
82
|
.gasPrice(fixtureTransferLargeAmount.data.gasPrice)
|
|
90
|
-
.
|
|
91
|
-
.network(fixtureTransferLargeAmount.data.network)
|
|
83
|
+
.gasLimit(fixtureTransferLargeAmount.data.gasLimit)
|
|
92
84
|
.sign(identityFixture.passphrase)
|
|
93
85
|
).transaction;
|
|
94
86
|
|
|
95
87
|
expect(transaction.data.gasPrice).toBe(fixtureTransferLargeAmount.data.gasPrice);
|
|
96
88
|
expect(transaction.data.nonce).toBe(fixtureTransferLargeAmount.data.nonce);
|
|
97
|
-
expect(transaction.data.
|
|
98
|
-
expect(transaction.data.gas).toBe(fixtureTransferLargeAmount.data.gas);
|
|
89
|
+
expect(transaction.data.gasLimit).toBe(fixtureTransferLargeAmount.data.gasLimit);
|
|
99
90
|
expect(transaction.data.to).toBe(fixtureTransferLargeAmount.data.to);
|
|
100
91
|
expect(transaction.data.value).toBe(fixtureTransferLargeAmount.data.value);
|
|
101
92
|
expect(transaction.data.v).toBe(fixtureTransferLargeAmount.data.v);
|
|
@@ -114,15 +105,13 @@ it("should handle a bignumber value", async () => {
|
|
|
114
105
|
.to(fixture.data.to)
|
|
115
106
|
.nonce(fixture.data.nonce)
|
|
116
107
|
.gasPrice(UnitConverter.parseUnits(fixture.data.gasPrice, "wei"))
|
|
117
|
-
.
|
|
118
|
-
.network(fixture.data.network)
|
|
108
|
+
.gasLimit(UnitConverter.parseUnits(fixture.data.gasLimit, "wei"))
|
|
119
109
|
.sign(identityFixture.passphrase)
|
|
120
110
|
).transaction;
|
|
121
111
|
|
|
122
112
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
123
113
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
124
|
-
expect(transaction.data.
|
|
125
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
114
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
126
115
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
127
116
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
128
117
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -148,8 +137,7 @@ it("should convert to an array", async () => {
|
|
|
148
137
|
to: fixture.data.to,
|
|
149
138
|
value: fixture.data.value,
|
|
150
139
|
gasPrice: fixture.data.gasPrice,
|
|
151
|
-
|
|
152
|
-
network: fixture.data.network,
|
|
140
|
+
gasLimit: fixture.data.gasLimit,
|
|
153
141
|
nonce: fixture.data.nonce,
|
|
154
142
|
v: fixture.data.v,
|
|
155
143
|
r: fixture.data.r,
|
|
@@ -165,9 +153,8 @@ it("should convert to json", async () => {
|
|
|
165
153
|
expect(transaction.toJson()).toEqual(
|
|
166
154
|
JSON.stringify({
|
|
167
155
|
gasPrice: fixture.data.gasPrice,
|
|
168
|
-
network: fixture.data.network,
|
|
169
156
|
hash: fixture.data.hash,
|
|
170
|
-
|
|
157
|
+
gasLimit: fixture.data.gasLimit,
|
|
171
158
|
nonce: fixture.data.nonce,
|
|
172
159
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
173
160
|
to: fixture.data.to,
|
|
@@ -186,9 +173,8 @@ it("should convert to string", async () => {
|
|
|
186
173
|
expect(transaction.toString()).toEqual(
|
|
187
174
|
JSON.stringify({
|
|
188
175
|
gasPrice: fixture.data.gasPrice,
|
|
189
|
-
network: fixture.data.network,
|
|
190
176
|
hash: fixture.data.hash,
|
|
191
|
-
|
|
177
|
+
gasLimit: fixture.data.gasLimit,
|
|
192
178
|
nonce: fixture.data.nonce,
|
|
193
179
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
194
180
|
to: fixture.data.to,
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
+
import { UnvoteBuilder } from "@/transactions/builders/UnvoteBuilder";
|
|
1
2
|
import fixture from "@tests/fixtures/transactions/unvote.json";
|
|
2
3
|
import identityFixture from "@tests/fixtures/identity.json";
|
|
3
4
|
|
|
4
|
-
import { UnvoteBuilder } from "@/transactions/builders/UnvoteBuilder";
|
|
5
|
-
|
|
6
5
|
it("should build a transaction", async () => {
|
|
7
6
|
const transaction = (
|
|
8
7
|
await UnvoteBuilder.new()
|
|
9
8
|
.nonce(fixture.data.nonce)
|
|
10
9
|
.gasPrice(fixture.data.gasPrice)
|
|
11
|
-
.
|
|
12
|
-
.network(fixture.data.network)
|
|
10
|
+
.gasLimit(fixture.data.gasLimit)
|
|
13
11
|
.sign(identityFixture.passphrase)
|
|
14
12
|
).transaction;
|
|
15
13
|
|
|
16
14
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
17
15
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
18
|
-
expect(transaction.data.
|
|
19
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
16
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
20
17
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
21
18
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
22
19
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -33,8 +30,7 @@ it("should sign a transaction", async () => {
|
|
|
33
30
|
|
|
34
31
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
35
32
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
36
|
-
expect(transaction.data.
|
|
37
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
33
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
38
34
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
39
35
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
40
36
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -60,8 +56,7 @@ it("should convert to an array", async () => {
|
|
|
60
56
|
to: fixture.data.to,
|
|
61
57
|
value: fixture.data.value,
|
|
62
58
|
gasPrice: fixture.data.gasPrice,
|
|
63
|
-
|
|
64
|
-
network: fixture.data.network,
|
|
59
|
+
gasLimit: fixture.data.gasLimit,
|
|
65
60
|
nonce: fixture.data.nonce,
|
|
66
61
|
v: fixture.data.v,
|
|
67
62
|
r: fixture.data.r,
|
|
@@ -77,9 +72,8 @@ it("should convert to json", async () => {
|
|
|
77
72
|
expect(transaction.toJson()).toEqual(
|
|
78
73
|
JSON.stringify({
|
|
79
74
|
gasPrice: fixture.data.gasPrice,
|
|
80
|
-
network: fixture.data.network,
|
|
81
75
|
hash: fixture.data.hash,
|
|
82
|
-
|
|
76
|
+
gasLimit: fixture.data.gasLimit,
|
|
83
77
|
nonce: fixture.data.nonce,
|
|
84
78
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
85
79
|
to: fixture.data.to,
|
|
@@ -98,9 +92,8 @@ it("should convert to string", async () => {
|
|
|
98
92
|
expect(transaction.toString()).toEqual(
|
|
99
93
|
JSON.stringify({
|
|
100
94
|
gasPrice: fixture.data.gasPrice,
|
|
101
|
-
network: fixture.data.network,
|
|
102
95
|
hash: fixture.data.hash,
|
|
103
|
-
|
|
96
|
+
gasLimit: fixture.data.gasLimit,
|
|
104
97
|
nonce: fixture.data.nonce,
|
|
105
98
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
106
99
|
to: fixture.data.to,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import fixture from "@tests/fixtures/transactions/username-registration.json";
|
|
2
|
-
import identityFixture from "@tests/fixtures/identity.json";
|
|
3
|
-
|
|
4
1
|
import { InvalidUsernameException } from "@/exceptions/InvalidUsernameException";
|
|
5
2
|
import { UsernameRegistrationBuilder } from "@/transactions/builders/UsernameRegistrationBuilder";
|
|
3
|
+
import fixture from "@tests/fixtures/transactions/username-registration.json";
|
|
4
|
+
import identityFixture from "@tests/fixtures/identity.json";
|
|
6
5
|
|
|
7
6
|
it("should build a transaction", async () => {
|
|
8
7
|
const transaction = (
|
|
@@ -10,15 +9,13 @@ it("should build a transaction", async () => {
|
|
|
10
9
|
.username("fixture")
|
|
11
10
|
.nonce(fixture.data.nonce)
|
|
12
11
|
.gasPrice(fixture.data.gasPrice)
|
|
13
|
-
.
|
|
14
|
-
.network(fixture.data.network)
|
|
12
|
+
.gasLimit(fixture.data.gasLimit)
|
|
15
13
|
.sign(identityFixture.passphrase)
|
|
16
14
|
).transaction;
|
|
17
15
|
|
|
18
16
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
19
17
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
20
|
-
expect(transaction.data.
|
|
21
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
18
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
22
19
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
23
20
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
24
21
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -36,8 +33,7 @@ it("should sign a transaction", async () => {
|
|
|
36
33
|
|
|
37
34
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
38
35
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
39
|
-
expect(transaction.data.
|
|
40
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
36
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
41
37
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
42
38
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
43
39
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -67,8 +63,7 @@ it("should convert to an array", async () => {
|
|
|
67
63
|
to: fixture.data.to,
|
|
68
64
|
value: fixture.data.value,
|
|
69
65
|
gasPrice: fixture.data.gasPrice,
|
|
70
|
-
|
|
71
|
-
network: fixture.data.network,
|
|
66
|
+
gasLimit: fixture.data.gasLimit,
|
|
72
67
|
nonce: fixture.data.nonce,
|
|
73
68
|
v: fixture.data.v,
|
|
74
69
|
r: fixture.data.r,
|
|
@@ -84,9 +79,8 @@ it("should convert to json", async () => {
|
|
|
84
79
|
expect(transaction.toJson()).toEqual(
|
|
85
80
|
JSON.stringify({
|
|
86
81
|
gasPrice: fixture.data.gasPrice,
|
|
87
|
-
network: fixture.data.network,
|
|
88
82
|
hash: fixture.data.hash,
|
|
89
|
-
|
|
83
|
+
gasLimit: fixture.data.gasLimit,
|
|
90
84
|
nonce: fixture.data.nonce,
|
|
91
85
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
92
86
|
to: fixture.data.to,
|
|
@@ -105,9 +99,8 @@ it("should convert to string", async () => {
|
|
|
105
99
|
expect(transaction.toString()).toEqual(
|
|
106
100
|
JSON.stringify({
|
|
107
101
|
gasPrice: fixture.data.gasPrice,
|
|
108
|
-
network: fixture.data.network,
|
|
109
102
|
hash: fixture.data.hash,
|
|
110
|
-
|
|
103
|
+
gasLimit: fixture.data.gasLimit,
|
|
111
104
|
nonce: fixture.data.nonce,
|
|
112
105
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
113
106
|
to: fixture.data.to,
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
+
import { UsernameResignationBuilder } from "@/transactions/builders/UsernameResignationBuilder";
|
|
1
2
|
import fixture from "@tests/fixtures/transactions/username-resignation.json";
|
|
2
3
|
import identityFixture from "@tests/fixtures/identity.json";
|
|
3
4
|
|
|
4
|
-
import { UsernameResignationBuilder } from "@/transactions/builders/UsernameResignationBuilder";
|
|
5
|
-
|
|
6
5
|
it("should build a transaction", async () => {
|
|
7
6
|
const transaction = (
|
|
8
7
|
await UsernameResignationBuilder.new()
|
|
9
8
|
.nonce(fixture.data.nonce)
|
|
10
9
|
.gasPrice(fixture.data.gasPrice)
|
|
11
|
-
.
|
|
12
|
-
.network(fixture.data.network)
|
|
10
|
+
.gasLimit(fixture.data.gasLimit)
|
|
13
11
|
.sign(identityFixture.passphrase)
|
|
14
12
|
).transaction;
|
|
15
13
|
|
|
16
14
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
17
15
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
18
|
-
expect(transaction.data.
|
|
19
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
16
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
20
17
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
21
18
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
22
19
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -34,8 +31,7 @@ it("should sign a transaction", async () => {
|
|
|
34
31
|
|
|
35
32
|
expect(transaction.data.gasPrice).toBe(fixture.data.gasPrice);
|
|
36
33
|
expect(transaction.data.nonce).toBe(fixture.data.nonce);
|
|
37
|
-
expect(transaction.data.
|
|
38
|
-
expect(transaction.data.gas).toBe(fixture.data.gas);
|
|
34
|
+
expect(transaction.data.gasLimit).toBe(fixture.data.gasLimit);
|
|
39
35
|
expect(transaction.data.to).toBe(fixture.data.to);
|
|
40
36
|
expect(transaction.data.value).toBe(fixture.data.value);
|
|
41
37
|
expect(transaction.data.v).toBe(fixture.data.v);
|
|
@@ -61,8 +57,7 @@ it("should convert to an array", async () => {
|
|
|
61
57
|
to: fixture.data.to,
|
|
62
58
|
value: fixture.data.value,
|
|
63
59
|
gasPrice: fixture.data.gasPrice,
|
|
64
|
-
|
|
65
|
-
network: fixture.data.network,
|
|
60
|
+
gasLimit: fixture.data.gasLimit,
|
|
66
61
|
nonce: fixture.data.nonce,
|
|
67
62
|
v: fixture.data.v,
|
|
68
63
|
r: fixture.data.r,
|
|
@@ -78,9 +73,8 @@ it("should convert to json", async () => {
|
|
|
78
73
|
expect(transaction.toJson()).toEqual(
|
|
79
74
|
JSON.stringify({
|
|
80
75
|
gasPrice: fixture.data.gasPrice,
|
|
81
|
-
network: fixture.data.network,
|
|
82
76
|
hash: fixture.data.hash,
|
|
83
|
-
|
|
77
|
+
gasLimit: fixture.data.gasLimit,
|
|
84
78
|
nonce: fixture.data.nonce,
|
|
85
79
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
86
80
|
to: fixture.data.to,
|
|
@@ -99,9 +93,8 @@ it("should convert to string", async () => {
|
|
|
99
93
|
expect(transaction.toString()).toEqual(
|
|
100
94
|
JSON.stringify({
|
|
101
95
|
gasPrice: fixture.data.gasPrice,
|
|
102
|
-
network: fixture.data.network,
|
|
103
96
|
hash: fixture.data.hash,
|
|
104
|
-
|
|
97
|
+
gasLimit: fixture.data.gasLimit,
|
|
105
98
|
nonce: fixture.data.nonce,
|
|
106
99
|
senderPublicKey: fixture.data.senderPublicKey,
|
|
107
100
|
to: fixture.data.to,
|