Skip to content

Commit

Permalink
Format files.
Browse files Browse the repository at this point in the history
  • Loading branch information
xclud committed Sep 20, 2023
1 parent d43b6ca commit f015b42
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/publish_pubdev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ name: Publish to Pub.dev

on:
push:
branches: [ main ]
branches: [main]

jobs:
publishing:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
- name: "Checkout"
uses: actions/checkout@v2 # required!
- name: 'web3dart'

- name: "web3dart"
uses: k-paxian/dart-package-publisher@master
with:
credentialJson: ${{ secrets.CREDENTIAL_JSON }}
format: true
2 changes: 1 addition & 1 deletion lib/src/core/transaction_signer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Uint8List signTransactionRaw(
Transaction transaction,
Credentials c, {
int? chainId = 1,
}) {
}) {
if (transaction.isEIP1559 && chainId != null) {
final encodedTx = LengthTrackingByteSink();
encodedTx.addByte(0x02);
Expand Down
1 change: 0 additions & 1 deletion test/contracts/abi/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:web3dart/crypto.dart';

import 'package:web3dart/web3dart.dart' show LengthTrackingByteSink;


void expectEncodes<T>(AbiType<T> type, T data, String encoded) {
final buffer = LengthTrackingByteSink();
type.encode(data, buffer);
Expand Down
10 changes: 5 additions & 5 deletions test/core/sign_transaction_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ void main() {
});
});

test('sign eip 1559 transaction without client', () {
test('sign eip 1559 transaction without client', () {
final data = jsonDecode(rawJson) as List<dynamic>;

Future.forEach(data, (element) {
Future.forEach(data, (element) {
final tx = element as Map<String, dynamic>;
final credentials =
EthPrivateKey.fromHex(strip0x(tx['privateKey'] as String));
EthPrivateKey.fromHex(strip0x(tx['privateKey'] as String));
final transaction = Transaction(
from: credentials.address,
to: EthereumAddress.fromHex(tx['to'] as String),
Expand All @@ -174,7 +174,8 @@ void main() {
data: tx['data'] ?? Uint8List(0),
);

final signature = signTransactionRaw(transaction, credentials, chainId: 4);
final signature =
signTransactionRaw(transaction, credentials, chainId: 4);

expect(
bytesToHex(
Expand All @@ -185,7 +186,6 @@ void main() {
strip0x(tx['signedTransactionRLP'] as String),
);
});

});

test('signs transactions', () async {
Expand Down

0 comments on commit f015b42

Please sign in to comment.