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

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

Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.2.1...2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

* chore: bump

* chore: format

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Starry <justin@solana.com>
This commit is contained in:
dependabot[bot] 2021-05-25 03:53:16 +00:00 committed by GitHub
parent fd43446bfa
commit fda8cb176a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 64 additions and 279 deletions

View File

@ -72,7 +72,7 @@
"mz": "^2.7.0", "mz": "^2.7.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"nyc": "^15.1.0", "nyc": "^15.1.0",
"prettier": "^2.0.0", "prettier": "^2.3.0",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"rollup": "2.49.0", "rollup": "2.49.0",
"rollup-plugin-dts": "^3.0.1", "rollup-plugin-dts": "^3.0.1",
@ -16471,9 +16471,9 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "2.2.1", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.0.tgz",
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", "integrity": "sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin-prettier.js" "prettier": "bin-prettier.js"
@ -32662,9 +32662,9 @@
"dev": true "dev": true
}, },
"prettier": { "prettier": {
"version": "2.2.1", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.0.tgz",
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", "integrity": "sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==",
"dev": true "dev": true
}, },
"prettier-linter-helpers": { "prettier-linter-helpers": {

View File

@ -125,7 +125,7 @@
"mz": "^2.7.0", "mz": "^2.7.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"nyc": "^15.1.0", "nyc": "^15.1.0",
"prettier": "^2.0.0", "prettier": "^2.3.0",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"rollup": "2.49.0", "rollup": "2.49.0",
"rollup-plugin-dts": "^3.0.1", "rollup-plugin-dts": "^3.0.1",

View File

@ -3020,9 +3020,8 @@ export class Connection {
'finalized', 'finalized',
); );
if (block.signatures.length > 0) { if (block.signatures.length > 0) {
options.until = block.signatures[ options.until =
block.signatures.length - 1 block.signatures[block.signatures.length - 1].toString();
].toString();
} }
} catch (err) { } catch (err) {
if (err.message.includes('skipped')) { if (err.message.includes('skipped')) {
@ -3043,9 +3042,8 @@ export class Connection {
try { try {
const block = await this.getConfirmedBlockSignatures(endSlot); const block = await this.getConfirmedBlockSignatures(endSlot);
if (block.signatures.length > 0) { if (block.signatures.length > 0) {
options.before = block.signatures[ options.before =
block.signatures.length - 1 block.signatures[block.signatures.length - 1].toString();
].toString();
} }
} catch (err) { } catch (err) {
if (err.message.includes('skipped')) { if (err.message.includes('skipped')) {

View File

@ -247,22 +247,8 @@ function is_on_curve(p: any) {
} }
let gf1 = naclLowLevel.gf([1]); let gf1 = naclLowLevel.gf([1]);
let I = naclLowLevel.gf([ let I = naclLowLevel.gf([
0xa0b0, 0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7,
0x4a0e, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83,
0x1b27,
0xc4ee,
0xe478,
0xad2f,
0x1806,
0x2f43,
0xd7a7,
0x3dfb,
0x0099,
0x2b4d,
0xdf0b,
0x4fc1,
0x2480,
0x2b83,
]); ]);
function neq25519(a: any, b: any) { function neq25519(a: any, b: any) {
var c = new Uint8Array(32), var c = new Uint8Array(32),

View File

@ -710,13 +710,8 @@ export class StakeProgram {
* Generate a Transaction that withdraws deactivated Stake tokens. * Generate a Transaction that withdraws deactivated Stake tokens.
*/ */
static withdraw(params: WithdrawStakeParams): Transaction { static withdraw(params: WithdrawStakeParams): Transaction {
const { const {stakePubkey, authorizedPubkey, toPubkey, lamports, custodianPubkey} =
stakePubkey, params;
authorizedPubkey,
toPubkey,
lamports,
custodianPubkey,
} = params;
const type = STAKE_INSTRUCTION_LAYOUTS.Withdraw; const type = STAKE_INSTRUCTION_LAYOUTS.Withdraw;
const data = encodeData(type, {lamports}); const data = encodeData(type, {lamports});

View File

@ -11,70 +11,10 @@ describe('Account', () => {
it('account from secret key', () => { it('account from secret key', () => {
const secretKey = Buffer.from([ const secretKey = Buffer.from([
153, 153, 218, 149, 89, 225, 94, 145, 62, 233, 171, 46, 83, 227, 223, 173, 87,
218, 93, 163, 59, 73, 190, 17, 37, 187, 146, 46, 51, 73, 79, 73, 136, 40, 27,
149, 47, 73, 9, 110, 62, 93, 189, 15, 207, 169, 192, 192, 205, 146, 217, 171,
89, 59, 33, 84, 75, 52, 213, 221, 74, 101, 217, 139, 135, 139, 153, 34,
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); const account = new Account(secretKey);
expect(account.publicKey.toBase58()).to.eq( expect(account.publicKey.toBase58()).to.eq(

View File

@ -37,9 +37,10 @@ if (process.env.TEST_LIVE) {
const payerBalance = await connection.getMinimumBalanceForRentExemption( const payerBalance = await connection.getMinimumBalanceForRentExemption(
0, 0,
); );
const executableBalance = await connection.getMinimumBalanceForRentExemption( const executableBalance =
programData.length, await connection.getMinimumBalanceForRentExemption(
); programData.length,
);
await helpers.airdrop({ await helpers.airdrop({
connection, connection,

View File

@ -383,9 +383,8 @@ describe('Connection', () => {
value: [], value: [],
}); });
const programAccountsDontMatchFilter = await connection.getProgramAccounts( const programAccountsDontMatchFilter =
programId.publicKey, await connection.getProgramAccounts(programId.publicKey, {
{
commitment: 'confirmed', commitment: 'confirmed',
filters: [ filters: [
{ {
@ -395,8 +394,7 @@ describe('Connection', () => {
}, },
}, },
], ],
}, });
);
expect(programAccountsDontMatchFilter).to.have.length(0); expect(programAccountsDontMatchFilter).to.have.length(0);
} }
@ -472,13 +470,11 @@ describe('Connection', () => {
value: [], value: [],
}); });
const programAccountsDontMatchFilter = await connection.getParsedProgramAccounts( const programAccountsDontMatchFilter =
programId.publicKey, await connection.getParsedProgramAccounts(programId.publicKey, {
{
commitment: 'confirmed', commitment: 'confirmed',
filters: [{dataSize: 2}], filters: [{dataSize: 2}],
}, });
);
expect(programAccountsDontMatchFilter).to.have.length(0); expect(programAccountsDontMatchFilter).to.have.length(0);
} }
@ -525,9 +521,8 @@ describe('Connection', () => {
], ],
}); });
const programAccountsDoMatchFilter = await connection.getParsedProgramAccounts( const programAccountsDoMatchFilter =
programId.publicKey, await connection.getParsedProgramAccounts(programId.publicKey, {
{
commitment: 'confirmed', commitment: 'confirmed',
filters: [ filters: [
{ {
@ -537,8 +532,7 @@ describe('Connection', () => {
}, },
}, },
], ],
}, });
);
expect(programAccountsDoMatchFilter).to.have.length(2); expect(programAccountsDoMatchFilter).to.have.length(2);
} }
}); });
@ -889,8 +883,7 @@ describe('Connection', () => {
instructions: [ instructions: [
{ {
accounts: [1, 2, 3], accounts: [1, 2, 3],
data: data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programIdIndex: 4, programIdIndex: 4,
}, },
], ],
@ -914,10 +907,8 @@ describe('Connection', () => {
slot++; slot++;
const block = await connection.getConfirmedBlock(slot); const block = await connection.getConfirmedBlock(slot);
if (block.transactions.length > 0) { if (block.transactions.length > 0) {
const { const {signature, publicKey} =
signature, block.transactions[0].transaction.signatures[0];
publicKey,
} = block.transactions[0].transaction.signatures[0];
if (signature) { if (signature) {
address = publicKey; address = publicKey;
expectedSignature = bs58.encode(signature); expectedSignature = bs58.encode(signature);
@ -973,11 +964,12 @@ describe('Connection', () => {
], ],
}); });
const confirmedSignatures = await connection.getConfirmedSignaturesForAddress( const confirmedSignatures =
address, await connection.getConfirmedSignaturesForAddress(
slot, address,
slot + 1, slot,
); slot + 1,
);
expect(confirmedSignatures.includes(expectedSignature)).to.be.true; expect(confirmedSignatures.includes(expectedSignature)).to.be.true;
const badSlot = Number.MAX_SAFE_INTEGER - 1; const badSlot = Number.MAX_SAFE_INTEGER - 1;
@ -1008,10 +1000,8 @@ describe('Connection', () => {
], ],
}); });
const confirmedSignatures2 = await connection.getConfirmedSignaturesForAddress2( const confirmedSignatures2 =
address, await connection.getConfirmedSignaturesForAddress2(address, {limit: 1});
{limit: 1},
);
expect(confirmedSignatures2).to.have.length(1); expect(confirmedSignatures2).to.have.length(1);
if (mockServer) { if (mockServer) {
expect(confirmedSignatures2[0].signature).to.eq(expectedSignature); expect(confirmedSignatures2[0].signature).to.eq(expectedSignature);
@ -1066,8 +1056,7 @@ describe('Connection', () => {
instructions: [ instructions: [
{ {
accounts: [1, 2, 3], accounts: [1, 2, 3],
data: data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programIdIndex: 4, programIdIndex: 4,
}, },
], ],
@ -1339,8 +1328,7 @@ describe('Connection', () => {
instructions: [ instructions: [
{ {
accounts: [1, 2, 3], accounts: [1, 2, 3],
data: data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programIdIndex: 4, programIdIndex: 4,
}, },
], ],
@ -1391,8 +1379,7 @@ describe('Connection', () => {
instructions: [ instructions: [
{ {
accounts: [1, 2, 3], accounts: [1, 2, 3],
data: data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programIdIndex: 4, programIdIndex: 4,
}, },
], ],
@ -1470,8 +1457,7 @@ describe('Connection', () => {
instructions: [ instructions: [
{ {
accounts: ['va12u4o9DipLEB2z4fuoHszroq1U9NcAB9aooFDPJSf'], accounts: ['va12u4o9DipLEB2z4fuoHszroq1U9NcAB9aooFDPJSf'],
data: data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programId: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', programId: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
}, },
], ],
@ -1614,8 +1600,7 @@ describe('Connection', () => {
instructions: [ instructions: [
{ {
accounts: [1, 2, 3], accounts: [1, 2, 3],
data: data: '37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
'37u9WtQpcm6ULa3VtWDFAWoQc1hUvybPrA3dtx99tgHvvcE7pKRZjuGmn7VX2tC3JmYDYGG7',
programIdIndex: 4, programIdIndex: 4,
}, },
], ],

View File

@ -12,39 +12,8 @@ describe('PublicKey', function () {
it('invalid', () => { it('invalid', () => {
expect(() => { expect(() => {
new PublicKey([ new PublicKey([
3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
]); ]);
}).to.throw(); }).to.throw();
@ -73,38 +42,8 @@ describe('PublicKey', function () {
it('equals', () => { it('equals', () => {
const arrayKey = new PublicKey([ const arrayKey = new PublicKey([
3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
]); ]);
const base58Key = new PublicKey( const base58Key = new PublicKey(
'CiDwVBFgWV9E5MvXWoLgnEgn2hK7rJikbvfWavzAQz3', 'CiDwVBFgWV9E5MvXWoLgnEgn2hK7rJikbvfWavzAQz3',
@ -126,38 +65,8 @@ describe('PublicKey', function () {
expect(key3.toBase58()).to.eq('11111111111111111111111111111111'); expect(key3.toBase58()).to.eq('11111111111111111111111111111111');
const key4 = new PublicKey([ const key4 = new PublicKey([
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
]); ]);
expect(key4.toBase58()).to.eq('11111111111111111111111111111111'); expect(key4.toBase58()).to.eq('11111111111111111111111111111111');
}); });
@ -178,38 +87,8 @@ describe('PublicKey', function () {
it('equals (II)', () => { it('equals (II)', () => {
const key1 = new PublicKey([ const key1 = new PublicKey([
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
]); ]);
const key2 = new PublicKey(key1.toBuffer()); const key2 = new PublicKey(key1.toBuffer());

View File

@ -63,11 +63,12 @@ describe('shortvec', () => {
checkEncodedArray(array, 0x7fff, (prevLength += 3), 3, [0xff, 0xff, 0x01]); checkEncodedArray(array, 0x7fff, (prevLength += 3), 3, [0xff, 0xff, 0x01]);
checkEncodedArray(array, 0x200000, (prevLength += 4), 4, [ checkEncodedArray(
0x80, array,
0x80, 0x200000,
0x80, (prevLength += 4),
0x01, 4,
]); [0x80, 0x80, 0x80, 0x01],
);
}); });
}); });