change seeds literals to camelcase, camel case was how mango did in v3, also matches struct names

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2022-03-11 20:10:15 +01:00
parent 241dd6080a
commit e742926ce2
6 changed files with 25 additions and 25 deletions

View File

@ -29,7 +29,7 @@ pub struct CreateSerumOpenOrders<'info> {
// initialized by this instruction via cpi to serum
#[account(
init,
seeds = [account.key().as_ref(), b"serumoo".as_ref(), serum_market.key().as_ref()],
seeds = [account.key().as_ref(), b"SerumOO".as_ref(), serum_market.key().as_ref()],
bump,
payer = payer,
owner = serum_program.key(),

View File

@ -24,7 +24,7 @@ pub struct RegisterToken<'info> {
#[account(
init,
seeds = [group.key().as_ref(), b"tokenbank".as_ref(), mint.key().as_ref()],
seeds = [group.key().as_ref(), b"TokenBank".as_ref(), mint.key().as_ref()],
bump,
payer = payer,
space = 8 + std::mem::size_of::<Bank>(),
@ -33,7 +33,7 @@ pub struct RegisterToken<'info> {
#[account(
init,
seeds = [group.key().as_ref(), b"tokenvault".as_ref(), mint.key().as_ref()],
seeds = [group.key().as_ref(), b"TokenVault".as_ref(), mint.key().as_ref()],
bump,
token::authority = group,
token::mint = mint,
@ -43,7 +43,7 @@ pub struct RegisterToken<'info> {
#[account(
init,
seeds = [group.key().as_ref(), b"mintinfo".as_ref(), mint.key().as_ref()],
seeds = [group.key().as_ref(), b"MintInfo".as_ref(), mint.key().as_ref()],
bump,
payer = payer,
space = 8 + std::mem::size_of::<MintInfo>(),

View File

@ -71,7 +71,7 @@ async fn get_mint_info(
mint: Pubkey,
) -> MintInfo {
let mint_info_pk = Pubkey::find_program_address(
&[account.group.as_ref(), b"mintinfo".as_ref(), mint.as_ref()],
&[account.group.as_ref(), b"MintInfo".as_ref(), mint.as_ref()],
&mango_v4::id(),
)
.0;
@ -238,7 +238,7 @@ impl<'keypair> ClientInstruction for WithdrawInstruction<'keypair> {
let bank = Pubkey::find_program_address(
&[
account.group.as_ref(),
b"tokenbank".as_ref(),
b"TokenBank".as_ref(),
token_account.mint.as_ref(),
],
&program_id,
@ -247,7 +247,7 @@ impl<'keypair> ClientInstruction for WithdrawInstruction<'keypair> {
let vault = Pubkey::find_program_address(
&[
account.group.as_ref(),
b"tokenvault".as_ref(),
b"TokenVault".as_ref(),
token_account.mint.as_ref(),
],
&program_id,
@ -310,7 +310,7 @@ impl<'keypair> ClientInstruction for DepositInstruction<'keypair> {
let bank = Pubkey::find_program_address(
&[
account.group.as_ref(),
b"tokenbank".as_ref(),
b"TokenBank".as_ref(),
token_account.mint.as_ref(),
],
&program_id,
@ -319,7 +319,7 @@ impl<'keypair> ClientInstruction for DepositInstruction<'keypair> {
let vault = Pubkey::find_program_address(
&[
account.group.as_ref(),
b"tokenvault".as_ref(),
b"TokenVault".as_ref(),
token_account.mint.as_ref(),
],
&program_id,
@ -388,7 +388,7 @@ impl<'keypair> ClientInstruction for RegisterTokenInstruction<'keypair> {
let bank = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"tokenbank".as_ref(),
b"TokenBank".as_ref(),
self.mint.as_ref(),
],
&program_id,
@ -397,7 +397,7 @@ impl<'keypair> ClientInstruction for RegisterTokenInstruction<'keypair> {
let vault = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"tokenvault".as_ref(),
b"TokenVault".as_ref(),
self.mint.as_ref(),
],
&program_id,
@ -406,7 +406,7 @@ impl<'keypair> ClientInstruction for RegisterTokenInstruction<'keypair> {
let mint_info = Pubkey::find_program_address(
&[
self.group.as_ref(),
b"mintinfo".as_ref(),
b"MintInfo".as_ref(),
self.mint.as_ref(),
],
&program_id,
@ -680,7 +680,7 @@ impl<'keypair> ClientInstruction for CreateSerumOpenOrdersInstruction<'keypair>
let open_orders = Pubkey::find_program_address(
&[
self.account.as_ref(),
b"serumoo".as_ref(),
b"SerumOO".as_ref(),
self.serum_market.as_ref(),
],
&program_id,

View File

@ -21,7 +21,7 @@ async fn test_margin_trade() -> Result<(), TransportError> {
Pubkey::from_str("J83w4HKfqxwcq3BEMMkPFSppX3gqekLyLJBexebFVkix").unwrap();
let margin_trade_token_account = Keypair::new();
let (mtta_owner, mtta_bump_seeds) =
Pubkey::find_program_address(&[b"margintrade"], &margin_trade_program_id);
Pubkey::find_program_address(&[b"MarginTrade"], &margin_trade_program_id);
let context = TestContext::new(
Option::None,
Some(&margin_trade_program_id),

View File

@ -28,7 +28,7 @@ pub mod margin_trade {
amount_to,
ctx.accounts.deposit_account.mint
);
let seeds = &[b"margintrade".as_ref(), &[deposit_account_owner_bump_seeds]];
let seeds = &[b"MarginTrade".as_ref(), &[deposit_account_owner_bump_seeds]];
token::transfer(
ctx.accounts
.transfer_back_to_mango_vault_ctx()

View File

@ -79,7 +79,7 @@ export type MangoV4 = {
{
"kind": "const",
"type": "string",
"value": "tokenbank"
"value": "TokenBank"
},
{
"kind": "account",
@ -104,7 +104,7 @@ export type MangoV4 = {
{
"kind": "const",
"type": "string",
"value": "tokenvault"
"value": "TokenVault"
},
{
"kind": "account",
@ -235,7 +235,7 @@ export type MangoV4 = {
{
"kind": "const",
"type": "string",
"value": "tokenbank"
"value": "TokenBank"
},
{
"kind": "account",
@ -260,7 +260,7 @@ export type MangoV4 = {
{
"kind": "const",
"type": "string",
"value": "tokenvault"
"value": "TokenVault"
},
{
"kind": "account",
@ -358,7 +358,7 @@ export type MangoV4 = {
}
},
{
"name": "tokenBank",
"name": "TokenBank",
"type": {
"kind": "struct",
"fields": [
@ -573,7 +573,7 @@ export const IDL: MangoV4 = {
{
"kind": "const",
"type": "string",
"value": "tokenbank"
"value": "TokenBank"
},
{
"kind": "account",
@ -598,7 +598,7 @@ export const IDL: MangoV4 = {
{
"kind": "const",
"type": "string",
"value": "tokenvault"
"value": "TokenVault"
},
{
"kind": "account",
@ -729,7 +729,7 @@ export const IDL: MangoV4 = {
{
"kind": "const",
"type": "string",
"value": "tokenbank"
"value": "TokenBank"
},
{
"kind": "account",
@ -754,7 +754,7 @@ export const IDL: MangoV4 = {
{
"kind": "const",
"type": "string",
"value": "tokenvault"
"value": "TokenVault"
},
{
"kind": "account",
@ -852,7 +852,7 @@ export const IDL: MangoV4 = {
}
},
{
"name": "tokenBank",
"name": "TokenBank",
"type": {
"kind": "struct",
"fields": [