examples: Fix typos (#564)
This commit is contained in:
parent
b7188b9b3e
commit
9ed18dc888
|
@ -1,7 +1,7 @@
|
||||||
//! counter is an example program that depends on an external interface
|
//! counter is an example program that depends on an external interface
|
||||||
//! that another program must implement. This allows our program to depend
|
//! that another program (here counter-auth/src/lib.rs) must implement. This allows
|
||||||
//! on another program, without knowing anything about it other than the fact
|
//! our program to depend on another program, without knowing anything about it
|
||||||
//! that it implements the `Auth` trait.
|
//! other than that it implements the `Auth` trait.
|
||||||
//!
|
//!
|
||||||
//! Here, we have a counter, where, in order to set the count, the `Auth`
|
//! Here, we have a counter, where, in order to set the count, the `Auth`
|
||||||
//! program must first approve the transaction.
|
//! program must first approve the transaction.
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe("interface", () => {
|
||||||
assert.ok(stateAccount.authProgram.equals(counterAuth.programId));
|
assert.ok(stateAccount.authProgram.equals(counterAuth.programId));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should fail to go from even to event", async () => {
|
it("Should fail to go from even to even", async () => {
|
||||||
await assert.rejects(
|
await assert.rejects(
|
||||||
async () => {
|
async () => {
|
||||||
await counter.state.rpc.setCount(new anchor.BN(4), {
|
await counter.state.rpc.setCount(new anchor.BN(4), {
|
||||||
|
|
|
@ -50,7 +50,7 @@ use solana_program::sysvar::rent;
|
||||||
///
|
///
|
||||||
/// Note that this middleware abstraction is not required to host a
|
/// Note that this middleware abstraction is not required to host a
|
||||||
/// permissioned market. One could write a regular program that manages the PDAs
|
/// permissioned market. One could write a regular program that manages the PDAs
|
||||||
/// and CPI invocations onesself, if desired.
|
/// and CPI invocations oneself, if desired.
|
||||||
#[program]
|
#[program]
|
||||||
pub mod permissioned_markets_middleware {
|
pub mod permissioned_markets_middleware {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
|
@ -20,13 +20,13 @@ use std::mem::size_of;
|
||||||
///
|
///
|
||||||
/// This example is provided as a (very) rough guide for how to might implement
|
/// This example is provided as a (very) rough guide for how to might implement
|
||||||
/// a permissioned market in a raw program, which may be useful in the
|
/// a permissioned market in a raw program, which may be useful in the
|
||||||
/// unexpected case that the middleware abstraction does not fit ones use case.
|
/// unexpected case that the middleware abstraction does not fit one's use case.
|
||||||
///
|
///
|
||||||
/// Note that a fallback function is used here as the entrypoint instead of
|
/// Note that a fallback function is used here as the entrypoint instead of
|
||||||
/// higher level Anchor instruction handers. This is done to keep the example
|
/// higher level Anchor instruction handers. This is done to keep the example
|
||||||
/// consistent with `programs/permissioned-markets-middleware`. A program
|
/// consistent with `programs/permissioned-markets-middleware`. A program
|
||||||
/// with explicit instruction handlers would work, though then one would lose
|
/// with explicit instruction handlers would work, though then one would lose
|
||||||
/// the middleware abstraction, which may or may not be acceptible depending on
|
/// the middleware abstraction, which may or may not be acceptable depending on
|
||||||
/// your use case.
|
/// your use case.
|
||||||
#[program]
|
#[program]
|
||||||
pub mod permissioned_markets {
|
pub mod permissioned_markets {
|
||||||
|
|
|
@ -39,7 +39,7 @@ describe("permissioned-markets", () => {
|
||||||
// Token client.
|
// Token client.
|
||||||
let usdcClient;
|
let usdcClient;
|
||||||
|
|
||||||
// Global DEX accounts and clients shared accross all tests.
|
// Global DEX accounts and clients shared across all tests.
|
||||||
let marketProxy, tokenAccount, usdcAccount;
|
let marketProxy, tokenAccount, usdcAccount;
|
||||||
let openOrders, openOrdersBump, openOrdersInitAuthority, openOrdersBumpinit;
|
let openOrders, openOrdersBump, openOrdersInitAuthority, openOrdersBumpinit;
|
||||||
let usdcPosted;
|
let usdcPosted;
|
||||||
|
@ -237,7 +237,7 @@ describe("permissioned-markets", () => {
|
||||||
const afterTokenAccount = await usdcClient.getAccountInfo(usdcAccount);
|
const afterTokenAccount = await usdcClient.getAccountInfo(usdcAccount);
|
||||||
assert.ok(
|
assert.ok(
|
||||||
afterTokenAccount.amount.sub(beforeTokenAccount.amount).toNumber() ===
|
afterTokenAccount.amount.sub(beforeTokenAccount.amount).toNumber() ===
|
||||||
usdcPosted.toNumber()
|
usdcPosted.toNumber()
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue