Skip to content

Commit

Permalink
Update to solana 1.16 and anchor 0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelleher committed Sep 27, 2023
1 parent 4b651c3 commit b107a9f
Show file tree
Hide file tree
Showing 8 changed files with 552 additions and 483 deletions.
929 changes: 496 additions & 433 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
"test:fixed": "yarn run ts-mocha -p ./tsconfig.json -t 1000000 packages/tests/buyBurnFixed.ts",
"test:switchboard": "yarn run ts-mocha -p ./tsconfig.json -t 1000000 packages/tests/buyBurnSwitchBoard.ts",
"test:router": "yarn run ts-mocha -p ./tsconfig.json -t 1000000 packages/tests/yieldRouter.ts",
"test:all": "yarn test:fixed && yarn test:switchboard && yarn test:router",
"test:all": " yarn test:router && yarn test:fixed && yarn test:switchboard",
"test": "anchor test",
"localnet": "anchor localnet",
"test:anchor": "yarn run ts-mocha -p ./tsconfig.json -t 1000000 packages/tests/**/*.ts",
"program:build": "anchor build",
"program:deploy": "anchor deploy"
},
"dependencies": {
"@coral-xyz/anchor": "^0.27.0",
"@coral-xyz/anchor": "^0.28.0",
"@solana/spl-token": "^0.3.7",
"fs": "^0.0.1-security"
},
"devDependencies": {
"@coral-xyz/anchor-cli": "^0.27.0",
"@coral-xyz/anchor-cli": "^0.28.0",
"@types/bn.js": "^5.1.0",
"@types/chai": "^4.3.0",
"@types/chai-as-promised": "^7.1.5",
Expand Down
30 changes: 15 additions & 15 deletions packages/tests/yieldRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,21 @@ describe("yield-router", () => {
return expect(shouldFail).to.be.rejectedWith("Unauthorized.");
});

it('should ...', () => {
const newKey = Keypair.generate();

const transaction = new Transaction().add(
SystemProgram.transfer({
fromPubkey: newKey.publicKey,
toPubkey: authority.publicKey,
lamports: 100_000,
})
)

transaction.sign(newKey);

console.log(transaction.signatures);
});
// it('should ...', () => {
// const newKey = Keypair.generate();
//
// const transaction = new Transaction().add(
// SystemProgram.transfer({
// fromPubkey: newKey.publicKey,
// toPubkey: authority.publicKey,
// lamports: 100_000,
// })
// )
//
// transaction.sign(newKey);
//
// console.log(transaction.signatures);
// });
});

context("with one output yield account", () => {
Expand Down
26 changes: 16 additions & 10 deletions packages/yield-router/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,13 @@ export class YieldRouterClient {
.rpc()
.then(() => {
confirm(client.provider.connection);
});
})
// Temporary - use this to get insight into failed transactions
// Can be removed after everything works, and re-added to debug as needed.
.catch((e) => {
console.log(e.logs);
throw e;
});

// now that the state is registered on chain, we can hydrate the client instance with its data
await client.init();
Expand Down Expand Up @@ -201,15 +207,15 @@ export class YieldRouterClient {
return this;
}

/**
* Update the state account with a new updateAuthority
* @param updateAuthority
*/
public async updateUpdateAuthority(
updateAuthority: PublicKey
): Promise<YieldRouterClient> {
// TODO
}
// /**
// * Update the state account with a new updateAuthority
// * @param updateAuthority
// */
// public async updateUpdateAuthority(
// updateAuthority: PublicKey
// ): Promise<YieldRouterClient> {
// // TODO
// }

public async allocateYield(amount: BN): Promise<YieldRouterClient> {
if (!this.config) {
Expand Down
6 changes: 3 additions & 3 deletions programs/buy-burn-fixed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ cpi = ["no-entrypoint"]
default = []

[dependencies]
anchor-lang = "0.27.0"
anchor-spl = "0.27.0"
solana-program = "1.14.12"
anchor-lang = "0.28.0"
anchor-spl = "0.28.0"
solana-program = "1.16.14"
8 changes: 4 additions & 4 deletions programs/buy-burn-switchboard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cpi = ["no-entrypoint"]
default = []

[dependencies]
anchor-lang = "0.27.0"
anchor-spl = "0.27.0"
solana-program = "1.14.12"
switchboard-v2 = "0.1.23"
anchor-lang = "0.28.0"
anchor-spl = "0.28.0"
solana-program = "1.16.14"
switchboard-v2 = "0.4.0"
4 changes: 2 additions & 2 deletions programs/yield-router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ cpi = ["no-entrypoint"]
default = []

[dependencies]
anchor-lang = "0.27.0"
solana-program = "1.14.12"
anchor-lang = "0.28.0"
solana-program = "1.16.14"
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
dependencies:
regenerator-runtime "^0.13.11"

"@coral-xyz/anchor-cli@^0.27.0":
version "0.27.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor-cli/-/anchor-cli-0.27.0.tgz#8c62c5e73505cf0aad92446655f8571313433903"
integrity sha512-/vyig/8KN/QG1KXLxpdnIXL8H3shjXKIRfTCIWwKApA6nhu7ryXJbyVb+dK80JQ0lObcikukQd5Ui0lw0lOjaQ==
"@coral-xyz/anchor-cli@^0.28.0":
version "0.28.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor-cli/-/anchor-cli-0.28.0.tgz#f88ce5b2821b6b56f8aca4aedcffdd7e07e86774"
integrity sha512-sI8pUpgh8W0w3Ef7KUif/PjgnBQYykVtj+JngpOcNTUV3yLWY4qVkDLFHyNrxGXgaQ2e9LUa7moFjNK9+499Sw==

"@coral-xyz/anchor@^0.27.0":
version "0.27.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.27.0.tgz#621e5ef123d05811b97e49973b4ed7ede27c705c"
integrity sha512-+P/vPdORawvg3A9Wj02iquxb4T0C5m4P6aZBVYysKl4Amk+r6aMPZkUhilBkD6E4Nuxnoajv3CFykUfkGE0n5g==
"@coral-xyz/anchor@^0.28.0":
version "0.28.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.28.0.tgz#8345c3c9186a91f095f704d7b90cd256f7e8b2dc"
integrity sha512-kQ02Hv2ZqxtWP30WN1d4xxT4QqlOXYDxmEd3k/bbneqhV3X5QMO4LAtoUFs7otxyivOgoqam5Il5qx81FuI4vw==
dependencies:
"@coral-xyz/borsh" "^0.27.0"
"@coral-xyz/borsh" "^0.28.0"
"@solana/web3.js" "^1.68.0"
base64-js "^1.5.1"
bn.js "^5.1.2"
Expand All @@ -35,10 +35,10 @@
superstruct "^0.15.4"
toml "^3.0.0"

"@coral-xyz/borsh@^0.27.0":
version "0.27.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.27.0.tgz#700c647ea5262b1488957ac7fb4e8acf72c72b63"
integrity sha512-tJKzhLukghTWPLy+n8K8iJKgBq1yLT/AxaNd10yJrX8mI56ao5+OFAKAqW/h0i79KCvb4BK0VGO5ECmmolFz9A==
"@coral-xyz/borsh@^0.28.0":
version "0.28.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.28.0.tgz#fa368a2f2475bbf6f828f4657f40a52102e02b6d"
integrity sha512-/u1VTzw7XooK7rqeD7JLUSwOyRSesPUk0U37BV9zK0axJc1q0nRbKFGFLYCQ16OtdOJTTwGfGp11Lx9B45bRCQ==
dependencies:
bn.js "^5.1.2"
buffer-layout "^1.2.0"
Expand Down

0 comments on commit b107a9f

Please sign in to comment.