Skip to content

Commit

Permalink
Merge pull request #3 from nasjuice/revert-1-confidentialTransfer
Browse files Browse the repository at this point in the history
Revert "refactor(experimental): graphql: token-2022 extensions: ConfidentialTransfer"
  • Loading branch information
nasjuice authored May 7, 2024
2 parents 14c8f38 + 8a1e70c commit 11893d1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 158 deletions.
39 changes: 1 addition & 38 deletions packages/rpc-graphql/src/__tests__/__setup__.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,7 @@ export const mockTransactionToken2022AllExtensions = {
programId: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
stackHeight: null,
},

{
parsed: {
info: {
Expand Down Expand Up @@ -2346,44 +2347,6 @@ export const mockTransactionToken2022AllExtensions = {
programId: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
stackHeight: null,
},
{
parsed: {
info: {
source: '2Pwe6Yahh5cbzvCwRMtTYFeboSwYiWeHhYJzZZBsU6eB',
destination: '2Pwe6Yahh5cbzvCwRMtTYFeboSwYiWeHhYJzZZBsU6eB',
mint: 'FsHcsGiY43QmZc6yTgwYC1DA5U3ZgycXxn3bd2oBjrEZ',
instructionsSysvar: 'SysvarRent111111111111111111111111111111111',
newSourceDecryptableAvailableBalance: '57fZKMs9YqFhu6fENwKTe7mGZh+wJbIvYkQ3LI/FDnOdc2w7',
owner: 'FsHcsGiY43QmZc6yTgwYC1DA5U3ZgycXxn3bd2oBjrEZ',
proofInstructionOffset: 1,
},
type: 'confidentialTransfer',
},
program: 'spl-token',
programId: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
stackHeight: null,
},
{
parsed: {
info: {
source: '2Pwe6Yahh5cbzvCwRMtTYFeboSwYiWeHhYJzZZBsU6eB',
destination: '2Pwe6Yahh5cbzvCwRMtTYFeboSwYiWeHhYJzZZBsU6eB',
mint: 'FsHcsGiY43QmZc6yTgwYC1DA5U3ZgycXxn3bd2oBjrEZ',
instructionsSysvar: 'SysvarRent111111111111111111111111111111111',
newSourceDecryptableAvailableBalance: '57fZKMs9YqFhu6fENwKTe7mGZh+wJbIvYkQ3LI/FDnOdc2w7',
proofInstructionOffset: 1,
multisigOwner: 'FsHcsGiY43QmZc6yTgwYC1DA5U3ZgycXxn3bd2oBjrEZ',
signers: [
'2Pwe6Yahh5cbzvCwRMtTYFeboSwYiWeHhYJzZZBsU6eB',
'2Pwe6Yahh5cbzvCwRMtTYFeboSwYiWeHhYJzZZBsU6eB',
],
},
type: 'confidentialTransfer',
},
program: 'spl-token',
programId: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
stackHeight: null,
},
// TODO (more) ...
],
recentBlockhash: '6vRS7MoToVccMqfQecdVC6UbmARaT5mha91zhreqnce9',
Expand Down
93 changes: 0 additions & 93 deletions packages/rpc-graphql/src/__tests__/transaction-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2717,99 +2717,6 @@ describe('transaction', () => {
},
});
});

it('confidential-transfer', async () => {
expect.assertions(1);
const source = /* GraphQL */ `
query testQuery($signature: Signature!) {
transaction(signature: $signature) {
message {
instructions {
programId
... on SplTokenConfidentialTransfer {
destination {
address
}
instructionsSysvar {
address
}
mint {
address
}
multisigOwner {
address
}
newSourceDecryptableAvailableBalance
owner {
address
}
proofInstructionOffset
signers
source {
address
}
}
}
}
}
}
`;
const result = await rpcGraphQL.query(source, { signature });
expect(result).toMatchObject({
data: {
transaction: {
message: {
instructions: expect.arrayContaining([
{
destination: {
address: expect.any(String),
},
instructionsSysvar: {
address: expect.any(String),
},
mint: {
address: expect.any(String),
},
multisigOwner: null,
newSourceDecryptableAvailableBalance: expect.any(String),
owner: {
address: expect.any(String),
},
programId: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
proofInstructionOffset: expect.any(Number),
signers: null,
source: {
address: expect.any(String),
},
},
{
destination: {
address: expect.any(String),
},
instructionsSysvar: {
address: expect.any(String),
},
mint: {
address: expect.any(String),
},
multisigOwner: {
address: expect.any(String),
},
newSourceDecryptableAvailableBalance: expect.any(String),
owner: null,
programId: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
proofInstructionOffset: expect.any(Number),
signers: expect.arrayContaining([expect.any(String)]),
source: {
address: expect.any(String),
},
},
]),
},
},
},
});
});
});
});
});
11 changes: 0 additions & 11 deletions packages/rpc-graphql/src/resolvers/instruction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,6 @@ export const instructionResolvers = {
multisigOwner: resolveAccount('multisigOwner'),
owner: resolveAccount('owner'),
},
SplTokenConfidentialTransfer: {
destination: resolveAccount('destination'),
instructionsSysvar: resolveAccount('instructionsSysvar'),
mint: resolveAccount('mint'),
multisigOwner: resolveAccount('multisigOwner'),
owner: resolveAccount('owner'),
source: resolveAccount('source'),
},
SplTokenConfigureConfidentialTransferAccount: {
account: resolveAccount('account'),
mint: resolveAccount('mint'),
Expand Down Expand Up @@ -808,9 +800,6 @@ export const instructionResolvers = {
if (jsonParsedConfigs.instructionType === 'withdrawConfidentialTransfer') {
return 'SplTokenWithdrawConfidentialTransfer';
}
if (jsonParsedConfigs.instructionType === 'confidentialTransfer') {
return 'SplTokenConfidentialTransfer';
}
}
if (jsonParsedConfigs.programName === 'stake') {
if (jsonParsedConfigs.instructionType === 'initialize') {
Expand Down
16 changes: 0 additions & 16 deletions packages/rpc-graphql/src/schema/instruction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -900,22 +900,6 @@ export const instructionTypeDefs = /* GraphQL */ `
source: Account
}
"""
SplToken-2022: ConfidentialTransfer instruction
"""
type SplTokenConfidentialTransfer implements TransactionInstruction {
programId: Address
destination: Account
instructionsSysvar: Account
mint: Account
multisigOwner: Account
newSourceDecryptableAvailableBalance: String
owner: Account
proofInstructionOffset: Int
signers: [Address]
source: Account
}
# TODO: Extensions!
# ...
Expand Down

0 comments on commit 11893d1

Please sign in to comment.