@@ -92,6 +92,38 @@ void main() {
92
92
);
93
93
});
94
94
95
+ test ('EIP-1559 transactions' , () async {
96
+ final firstAddress = await first.extractAddress ();
97
+ final secondAddress = await second.extractAddress ();
98
+
99
+ final balanceOfFirst = await client.getBalance (firstAddress);
100
+ final balanceOfSecond = await client.getBalance (secondAddress);
101
+ final value = BigInt .from (1337 );
102
+
103
+ final hash = await client.sendTransaction (
104
+ first,
105
+ Transaction (
106
+ to: secondAddress,
107
+ value: EtherAmount .inWei (value),
108
+ maxFeePerGas: EtherAmount .inWei (BigInt .one),
109
+ maxPriorityFeePerGas: EtherAmount .inWei (BigInt .two),
110
+ ),
111
+ );
112
+
113
+ expect ((await client.getBalance (firstAddress)).getInWei,
114
+ balanceOfFirst.getInWei - value);
115
+ expect ((await client.getBalance (secondAddress)).getInWei,
116
+ balanceOfSecond.getInWei + value);
117
+
118
+ final receipt = await client.getTransactionReceipt (hash);
119
+ expect (
120
+ receipt,
121
+ isA <TransactionReceipt >()
122
+ .having ((e) => e.to, 'to' , secondAddress)
123
+ .having ((e) => e.from, 'from' , first.address),
124
+ );
125
+ });
126
+
95
127
test ('getTransactionReceipt returns null for unknown transactions' , () {
96
128
expect (client.getTransactionReceipt ('0x123' ), completion (isNull));
97
129
});
0 commit comments