Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

chore: bump prettier from 2.2.1 to 2.3.0 in /web3.js #17143

Merged
merged 3 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions web3.js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web3.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"mz": "^2.7.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"prettier": "^2.0.0",
"prettier": "^2.3.0",
"rimraf": "3.0.2",
"rollup": "2.47.0",
"rollup-plugin-dts": "^3.0.1",
Expand Down
10 changes: 4 additions & 6 deletions web3.js/src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3020,9 +3020,8 @@ export class Connection {
'finalized',
);
if (block.signatures.length > 0) {
options.until = block.signatures[
block.signatures.length - 1
].toString();
options.until =
block.signatures[block.signatures.length - 1].toString();
}
} catch (err) {
if (err.message.includes('skipped')) {
Expand All @@ -3043,9 +3042,8 @@ export class Connection {
try {
const block = await this.getConfirmedBlockSignatures(endSlot);
if (block.signatures.length > 0) {
options.before = block.signatures[
block.signatures.length - 1
].toString();
options.before =
block.signatures[block.signatures.length - 1].toString();
}
} catch (err) {
if (err.message.includes('skipped')) {
Expand Down
18 changes: 2 additions & 16 deletions web3.js/src/publickey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,22 +247,8 @@ function is_on_curve(p: any) {
}
let gf1 = naclLowLevel.gf([1]);
let I = naclLowLevel.gf([
0xa0b0,
0x4a0e,
0x1b27,
0xc4ee,
0xe478,
0xad2f,
0x1806,
0x2f43,
0xd7a7,
0x3dfb,
0x0099,
0x2b4d,
0xdf0b,
0x4fc1,
0x2480,
0x2b83,
0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7,
0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83,
]);
function neq25519(a: any, b: any) {
var c = new Uint8Array(32),
Expand Down
9 changes: 2 additions & 7 deletions web3.js/src/stake-program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,13 +710,8 @@ export class StakeProgram {
* Generate a Transaction that withdraws deactivated Stake tokens.
*/
static withdraw(params: WithdrawStakeParams): Transaction {
const {
stakePubkey,
authorizedPubkey,
toPubkey,
lamports,
custodianPubkey,
} = params;
const {stakePubkey, authorizedPubkey, toPubkey, lamports, custodianPubkey} =
params;
const type = STAKE_INSTRUCTION_LAYOUTS.Withdraw;
const data = encodeData(type, {lamports});

Expand Down
68 changes: 4 additions & 64 deletions web3.js/test/account.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,70 +11,10 @@ describe('Account', () => {

it('account from secret key', () => {
const secretKey = Buffer.from([
153,
218,
149,
89,
225,
94,
145,
62,
233,
171,
46,
83,
227,
223,
173,
87,
93,
163,
59,
73,
190,
17,
37,
187,
146,
46,
51,
73,
79,
73,
136,
40,
27,
47,
73,
9,
110,
62,
93,
189,
15,
207,
169,
192,
192,
205,
146,
217,
171,
59,
33,
84,
75,
52,
213,
221,
74,
101,
217,
139,
135,
139,
153,
34,
153, 218, 149, 89, 225, 94, 145, 62, 233, 171, 46, 83, 227, 223, 173, 87,
93, 163, 59, 73, 190, 17, 37, 187, 146, 46, 51, 73, 79, 73, 136, 40, 27,
47, 73, 9, 110, 62, 93, 189, 15, 207, 169, 192, 192, 205, 146, 217, 171,
59, 33, 84, 75, 52, 213, 221, 74, 101, 217, 139, 135, 139, 153, 34,
]);
const account = new Account(secretKey);
expect(account.publicKey.toBase58()).to.eq(
Expand Down
7 changes: 4 additions & 3 deletions web3.js/test/bpf-loader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ if (process.env.TEST_LIVE) {
const payerBalance = await connection.getMinimumBalanceForRentExemption(
0,
);
const executableBalance = await connection.getMinimumBalanceForRentExemption(
programData.length,
);
const executableBalance =
await connection.getMinimumBalanceForRentExemption(
programData.length,
);

await helpers.airdrop({
connection,
Expand Down
65 changes: 25 additions & 40 deletions web3.js/test/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,8 @@ describe('Connection', () => {
value: [],
});

const programAccountsDontMatchFilter = await connection.getProgramAccounts(
programId.publicKey,
{
const programAccountsDontMatchFilter =
await connection.getProgramAccounts(programId.publicKey, {
commitment: 'confirmed',
filters: [
{
Expand All @@ -395,8 +394,7 @@ describe('Connection', () => {
},
},
],
},
);
});
expect(programAccountsDontMatchFilter).to.have.length(0);
}

Expand Down Expand Up @@ -472,13 +470,11 @@ describe('Connection', () => {
value: [],
});

const programAccountsDontMatchFilter = await connection.getParsedProgramAccounts(
programId.publicKey,
{
const programAccountsDontMatchFilter =
await connection.getParsedProgramAccounts(programId.publicKey, {
commitment: 'confirmed',
filters: [{dataSize: 2}],
},
);
});
expect(programAccountsDontMatchFilter).to.have.length(0);
}

Expand Down Expand Up @@ -525,9 +521,8 @@ describe('Connection', () => {
],
});

const programAccountsDoMatchFilter = await connection.getParsedProgramAccounts(
programId.publicKey,
{
const programAccountsDoMatchFilter =
await connection.getParsedProgramAccounts(programId.publicKey, {
commitment: 'confirmed',
filters: [
{
Expand All @@ -537,8 +532,7 @@ describe('Connection', () => {
},
},
],
},
);
});
expect(programAccountsDoMatchFilter).to.have.length(2);
}
});
Expand Down Expand Up @@ -889,8 +883,7 @@ describe('Connection', () => {
instructions: [
{
accounts: [1, 2, 3],
data:
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programIdIndex: 4,
},
],
Expand All @@ -914,10 +907,8 @@ describe('Connection', () => {
slot++;
const block = await connection.getConfirmedBlock(slot);
if (block.transactions.length > 0) {
const {
signature,
publicKey,
} = block.transactions[0].transaction.signatures[0];
const {signature, publicKey} =
block.transactions[0].transaction.signatures[0];
if (signature) {
address = publicKey;
expectedSignature = bs58.encode(signature);
Expand Down Expand Up @@ -973,11 +964,12 @@ describe('Connection', () => {
],
});

const confirmedSignatures = await connection.getConfirmedSignaturesForAddress(
address,
slot,
slot + 1,
);
const confirmedSignatures =
await connection.getConfirmedSignaturesForAddress(
address,
slot,
slot + 1,
);
expect(confirmedSignatures.includes(expectedSignature)).to.be.true;

const badSlot = Number.MAX_SAFE_INTEGER - 1;
Expand Down Expand Up @@ -1008,10 +1000,8 @@ describe('Connection', () => {
],
});

const confirmedSignatures2 = await connection.getConfirmedSignaturesForAddress2(
address,
{limit: 1},
);
const confirmedSignatures2 =
await connection.getConfirmedSignaturesForAddress2(address, {limit: 1});
expect(confirmedSignatures2).to.have.length(1);
if (mockServer) {
expect(confirmedSignatures2[0].signature).to.eq(expectedSignature);
Expand Down Expand Up @@ -1066,8 +1056,7 @@ describe('Connection', () => {
instructions: [
{
accounts: [1, 2, 3],
data:
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programIdIndex: 4,
},
],
Expand Down Expand Up @@ -1339,8 +1328,7 @@ describe('Connection', () => {
instructions: [
{
accounts: [1, 2, 3],
data:
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programIdIndex: 4,
},
],
Expand Down Expand Up @@ -1391,8 +1379,7 @@ describe('Connection', () => {
instructions: [
{
accounts: [1, 2, 3],
data:
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programIdIndex: 4,
},
],
Expand Down Expand Up @@ -1470,8 +1457,7 @@ describe('Connection', () => {
instructions: [
{
accounts: ['va12u4o9DipLEB2z4fuoHszroq1U9NcAB9aooFDPJSf'],
data:
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programId: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
},
],
Expand Down Expand Up @@ -1614,8 +1600,7 @@ describe('Connection', () => {
instructions: [
{
accounts: [1, 2, 3],
data:
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programIdIndex: 4,
},
],
Expand Down
Loading