Skip to content

Commit 8de82ce

Browse files
committed
fix linter issue and update github workflow
1 parent 4fb253d commit 8de82ce

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
1-
name: CI
1+
name: Build, lint, and test
2+
23
on: [push]
4+
35
jobs:
46
build:
5-
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
7+
name: Build, lint, and test on Nodejs
8+
9+
runs-on: ubuntu-latest
610

7-
runs-on: ${{ matrix.os }}
811
strategy:
912
matrix:
10-
node: ['14.x']
11-
os: [ubuntu-latest, windows-latest, macOS-latest]
13+
node-version: [16.x]
1214

1315
steps:
14-
- name: Checkout repo
15-
uses: actions/checkout@v2
16-
17-
- name: Use Node ${{ matrix.node }}
18-
uses: actions/setup-node@v1
16+
- uses: actions/checkout@v4
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v4
1919
with:
20-
node-version: ${{ matrix.node }}
21-
22-
- name: Install deps and build (with cache)
23-
uses: bahmutov/npm-install@v1
24-
25-
- name: Test
26-
run: yarn test --ci --coverage --maxWorkers=2
20+
node-version: ${{ matrix.node-version }}
21+
cache: yarn
22+
- name: Install dependencies
23+
run: yarn --ignore-engines
2724

2825
- name: Build
2926
run: yarn build

src/common/helpers/bitcoinHelper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ const transfer = async (args: TransferPayload) => {
142142
: utxolib.networks.testnet
143143
);
144144

145-
const fromAddress = getAddressFromPrivateKey(args.privateKey, args.network).address;
145+
const fromAddress = getAddressFromPrivateKey(args.privateKey, args.network)
146+
.address;
146147

147148
const changeAddress = fromAddress;
148149
const endpoints = _apiFallbacks.fetchUTXOs(testnet, fromAddress, 0);

src/common/helpers/tronHelper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const getBalance = async ({
100100

101101
try {
102102
if (contract && tokenAddress) {
103-
const balance = await contract.balanceOf(address).call();
103+
const balance = await contract.methods.balanceOf(address).call();
104104

105105
return successResponse({
106106
balance: TronWeb.fromSun(Number(balance)),
@@ -195,10 +195,10 @@ const getTokenInfo = async ({
195195
if (contract) {
196196
try {
197197
const [name, symbol, decimals, totalSupply] = await Promise.all([
198-
contract.name().call(),
199-
contract.symbol().call(),
200-
contract.decimals().call(),
201-
contract.totalSupply().call(),
198+
contract.methods.name().call(),
199+
contract.methods.symbol().call(),
200+
contract.methods.decimals().call(),
201+
contract.methods.totalSupply().call(),
202202
]);
203203

204204
const data = {

src/services/wallet/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
Network,
2121
} from '../../common/utils/types';
2222

23-
const networkHelpers: Record<Network, any > = {
23+
const networkHelpers: Record<Network, any> = {
2424
ethereum: ethereumHelper,
2525
solana: solanaHelper,
2626
tron: tronHelper,

0 commit comments

Comments
 (0)