feat: update superstruct and future proof type validations (#15491)

* chore: update superstruct

* fix: fix program account notification type coercion
This commit is contained in:
Justin Starry
2021-02-26 15:06:12 +08:00
committed by GitHub
parent d866f742e2
commit bb06817e16
6 changed files with 591 additions and 939 deletions

View File

@@ -1542,6 +1542,7 @@ describe('Connection', () => {
lamports: LAMPORTS_PER_SOL,
data: ['', 'base64'],
executable: false,
rentEpoch: 20,
},
withContext: true,
});
@@ -1569,6 +1570,7 @@ describe('Connection', () => {
lamports: LAMPORTS_PER_SOL,
data: ['', 'base64'],
executable: false,
rentEpoch: 20,
},
withContext: true,
});
@@ -1903,10 +1905,7 @@ describe('Connection', () => {
const subscriptionId = connection.onProgramAccountChange(
SystemProgram.programId,
(keyedAccountInfo: KeyedAccountInfo) => {
// FIX: accountId should be `PublicKey` not `string`
if (
keyedAccountInfo.accountId === programAccount.publicKey.toBase58()
) {
if (keyedAccountInfo.accountId.equals(programAccount.publicKey)) {
expect(keyedAccountInfo.accountInfo.lamports).to.eq(balanceNeeded);
expect(
keyedAccountInfo.accountInfo.owner.equals(

View File

@@ -92,6 +92,7 @@ describe('Nonce', () => {
lamports: minimumAmount,
data: expectedData(from.publicKey),
executable: false,
rentEpoch: 20,
},
withContext: true,
});
@@ -162,6 +163,7 @@ describe('Nonce', () => {
lamports: minimumAmount,
data: expectedData(from.publicKey),
executable: false,
rentEpoch: 20,
},
withContext: true,
});