Skip to content

Commit

Permalink
Rename missing names.
Browse files Browse the repository at this point in the history
  • Loading branch information
blockiosaurus committed Jul 30, 2024
1 parent a945020 commit 7b63d57
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 376 deletions.
4 changes: 2 additions & 2 deletions .github/file-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ program_common: &program_common
- ".github/file-filters.yml"
- ".github/.env"

mpl_project_name_program: &mpl_project_name_program
solana_serialization_benchmark_program: &solana_serialization_benchmark_program
- *program_common
- "programs/solana-serialization-benchmark/**"

programs: &programs
- *mpl_project_name_program
- *solana_serialization_bench

# Clients.

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-rust-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ jobs:
with:
name: rust-client-builds
# First wildcard ensures exported paths are consistently under the clients folder.
path: ./targe*/release/*mpl_project_name*
if-no-files-found: error
path: ./targe*/release/*solana_serialization_benchmark*
if-no-files-found: error
4 changes: 2 additions & 2 deletions clients/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ A Umi-compatible JavaScript library for the project.
```
2. Finally, register the library with your Umi instance like so.
```ts
import { mplProjectName } from '@metaplex-foundation/solana-serialization-benchmark';
umi.use(mplProjectName());
import { solanaSerializationBenchmark } from '@metaplex-foundation/solana-serialization-benchmark';
umi.use(solanaSerializationBenchmark());
```

You can learn more about this library's API by reading its generated [TypeDoc documentation](https://solana-serialization-benchmark-js-docs.vercel.app).
Expand Down
4 changes: 2 additions & 2 deletions clients/js/bench/_setup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import { createUmi as basecreateUmi } from '@metaplex-foundation/umi-bundle-tests';
import {
mplProjectName,
solanaSerializationBenchmark,
} from '../src';

export const createUmi = async () => (await basecreateUmi()).use(mplProjectName());
export const createUmi = async () => (await basecreateUmi()).use(solanaSerializationBenchmark());
2 changes: 1 addition & 1 deletion clients/js/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@metaplex-foundation/solana-serialization-benchmark",
"version": "0.1.0",
"description": "My project description",
"description": "Benchmarks for rust serialization frameworks, inspired by https://github.com/djkoloski/rust_serialization_benchmark",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/accounts/myAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function getMyAccountGpaBuilder(
) {
const programId = context.programs.getPublicKey(
'solanaSerializationBenchmark',
'MyProgram1111111111111111111111111111111111'
'BENCHVr3SC7dVDMtKVpwctjFNPBMrqvXn9JVACJg3KEb'
);
return gpaBuilder(context, programId)
.registerFields<{ key: KeyArgs; authority: PublicKey; data: MyDataArgs }>({
Expand Down
4 changes: 2 additions & 2 deletions clients/js/src/generated/accounts/myPdaAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export function getMyPdaAccountGpaBuilder(
) {
const programId = context.programs.getPublicKey(
'solanaSerializationBenchmark',
'MyProgram1111111111111111111111111111111111'
'BENCHVr3SC7dVDMtKVpwctjFNPBMrqvXn9JVACJg3KEb'
);
return gpaBuilder(context, programId)
.registerFields<{ key: KeyArgs; bump: number }>({
Expand Down Expand Up @@ -146,7 +146,7 @@ export function findMyPdaAccountPda(
): Pda {
const programId = context.programs.getPublicKey(
'solanaSerializationBenchmark',
'MyProgram1111111111111111111111111111111111'
'BENCHVr3SC7dVDMtKVpwctjFNPBMrqvXn9JVACJg3KEb'
);
return context.eddsa.findPda(programId, [
string({ size: 'variable' }).serialize('myPdaAccount'),
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function create(
// Program ID.
const programId = context.programs.getPublicKey(
'solanaSerializationBenchmark',
'MyProgram1111111111111111111111111111111111'
'BENCHVr3SC7dVDMtKVpwctjFNPBMrqvXn9JVACJg3KEb'
);

// Accounts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '../errors';

export const SOLANA_SERIALIZATION_BENCHMARK_PROGRAM_ID =
'MyProgram1111111111111111111111111111111111' as PublicKey<'MyProgram1111111111111111111111111111111111'>;
'BENCHVr3SC7dVDMtKVpwctjFNPBMrqvXn9JVACJg3KEb' as PublicKey<'BENCHVr3SC7dVDMtKVpwctjFNPBMrqvXn9JVACJg3KEb'>;

export function createSolanaSerializationBenchmarkProgram(): Program {
return {
Expand Down
6 changes: 3 additions & 3 deletions clients/js/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { UmiPlugin } from '@metaplex-foundation/umi';
import { createMplProjectNameProgram } from './generated';
import { createSolanaSerializationBenchmarkProgram } from './generated';

export const mplProjectName = (): UmiPlugin => ({
export const solanaSerializationBenchmark = (): UmiPlugin => ({
install(umi) {
umi.programs.add(createMplProjectNameProgram(), false);
umi.programs.add(createSolanaSerializationBenchmarkProgram(), false);
},
});
4 changes: 2 additions & 2 deletions clients/js/test/_setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable import/no-extraneous-dependencies */
import { createUmi as basecreateUmi } from '@metaplex-foundation/umi-bundle-tests';
import { mplProjectName } from '../src';
import { solanaSerializationBenchmark } from '../src';

export const createUmi = async () =>
(await basecreateUmi()).use(mplProjectName());
(await basecreateUmi()).use(solanaSerializationBenchmark());
6 changes: 3 additions & 3 deletions clients/js/test/getProgram.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import test from 'ava';
import { MPL_PROJECT_NAME_PROGRAM_ID } from '../src';
import { SOLANA_SERIALIZATION_BENCHMARK_PROGRAM_ID } from '../src';
import { createUmi } from './_setup';

test('it registers the program', async (t) => {
// Given a Umi instance using the project's plugin.
const umi = await createUmi();

// When we fetch the registered program.
const program = umi.programs.get('mplProjectName');
const program = umi.programs.get('solanaSerializationBenchmark');

// Then we expect it to be the same as the program ID constant.
t.true(program.publicKey === MPL_PROJECT_NAME_PROGRAM_ID);
t.true(program.publicKey === SOLANA_SERIALIZATION_BENCHMARK_PROGRAM_ID);
});
2 changes: 1 addition & 1 deletion clients/rust/src/generated/programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ use solana_program::{pubkey, pubkey::Pubkey};

/// `solana_serialization_benchmark` program ID.
pub const SOLANA_SERIALIZATION_BENCHMARK_ID: Pubkey =
pubkey!("MyProgram1111111111111111111111111111111111");
pubkey!("BENCHVr3SC7dVDMtKVpwctjFNPBMrqvXn9JVACJg3KEb");
173 changes: 0 additions & 173 deletions idls/mpl_serialization_benchmark_program.json

This file was deleted.

Loading

0 comments on commit 7b63d57

Please sign in to comment.