Skip to content

Commit

Permalink
degrade borsh version for compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagaprasadvr committed Dec 23, 2024
1 parent 9416dd3 commit c2c98a8
Show file tree
Hide file tree
Showing 45 changed files with 6,675 additions and 121 deletions.
6,538 changes: 6,538 additions & 0 deletions packages/renderers-rust/e2e/anchor/Cargo.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions packages/renderers-rust/e2e/anchor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ test-sbf = []

[dependencies]
anchor-lang = { version = "0.30.0", optional = true }
borsh = "^1.5.3"
borsh-derive = "^1.5.3"
borsh = "^0.10"
kaigan = "0.2.5"
num-derive = "^0.3"
num-traits = "^0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ impl CreateGuard {
false,
));
accounts.extend_from_slice(remaining_accounts);
let mut data = borsh::to_vec(&CreateGuardInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&args).unwrap();
let mut data = CreateGuardInstructionData::new().try_to_vec().unwrap();
let mut args = args.try_to_vec().unwrap();
data.append(&mut args);

solana_program::instruction::Instruction {
Expand Down Expand Up @@ -428,8 +428,8 @@ impl<'a, 'b> CreateGuardCpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let mut data = borsh::to_vec(&CreateGuardInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&self.__args).unwrap();
let mut data = CreateGuardInstructionData::new().try_to_vec().unwrap();
let mut args = self.__args.try_to_vec().unwrap();
data.append(&mut args);

let instruction = solana_program::instruction::Instruction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ impl Execute {
false,
));
accounts.extend_from_slice(remaining_accounts);
let mut data = borsh::to_vec(&ExecuteInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&args).unwrap();
let mut data = ExecuteInstructionData::new().try_to_vec().unwrap();
let mut args = args.try_to_vec().unwrap();
data.append(&mut args);

solana_program::instruction::Instruction {
Expand Down Expand Up @@ -351,8 +351,8 @@ impl<'a, 'b> ExecuteCpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let mut data = borsh::to_vec(&ExecuteInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&self.__args).unwrap();
let mut data = ExecuteInstructionData::new().try_to_vec().unwrap();
let mut args = self.__args.try_to_vec().unwrap();
data.append(&mut args);

let instruction = solana_program::instruction::Instruction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Initialize {
self.payer, true,
));
accounts.extend_from_slice(remaining_accounts);
let data = borsh::to_vec(&InitializeInstructionData::new()).unwrap();
let data = InitializeInstructionData::new().try_to_vec().unwrap();

solana_program::instruction::Instruction {
program_id: crate::WEN_TRANSFER_GUARD_ID,
Expand Down Expand Up @@ -299,7 +299,7 @@ impl<'a, 'b> InitializeCpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let data = borsh::to_vec(&InitializeInstructionData::new()).unwrap();
let data = InitializeInstructionData::new().try_to_vec().unwrap();

let instruction = solana_program::instruction::Instruction {
program_id: crate::WEN_TRANSFER_GUARD_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ impl UpdateGuard {
false,
));
accounts.extend_from_slice(remaining_accounts);
let mut data = borsh::to_vec(&UpdateGuardInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&args).unwrap();
let mut data = UpdateGuardInstructionData::new().try_to_vec().unwrap();
let mut args = args.try_to_vec().unwrap();
data.append(&mut args);

solana_program::instruction::Instruction {
Expand Down Expand Up @@ -348,8 +348,8 @@ impl<'a, 'b> UpdateGuardCpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let mut data = borsh::to_vec(&UpdateGuardInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&self.__args).unwrap();
let mut data = UpdateGuardInstructionData::new().try_to_vec().unwrap();
let mut args = self.__args.try_to_vec().unwrap();
data.append(&mut args);

let instruction = solana_program::instruction::Instruction {
Expand Down
3 changes: 1 addition & 2 deletions packages/renderers-rust/e2e/dummy/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/renderers-rust/e2e/dummy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ test-sbf = []

[dependencies]
anchor-lang = { version = "0.30.0", optional = true }
borsh = "^1.5.3"
borsh-derive = "^1.5.3"
borsh = "^0.10"
kaigan = "0.2.5"
num-derive = "^0.3"
num-traits = "^0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Instruction1 {
) -> solana_program::instruction::Instruction {
let mut accounts = Vec::with_capacity(remaining_accounts.len());
accounts.extend_from_slice(remaining_accounts);
let data = borsh::to_vec(&Instruction1InstructionData::new()).unwrap();
let data = Instruction1InstructionData::new().try_to_vec().unwrap();

solana_program::instruction::Instruction {
program_id: crate::DUMMY_ID,
Expand Down Expand Up @@ -138,7 +138,7 @@ impl<'a, 'b> Instruction1Cpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let data = borsh::to_vec(&Instruction1InstructionData::new()).unwrap();
let data = Instruction1InstructionData::new().try_to_vec().unwrap();

let instruction = solana_program::instruction::Instruction {
program_id: crate::DUMMY_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Instruction2 {
) -> solana_program::instruction::Instruction {
let mut accounts = Vec::with_capacity(remaining_accounts.len());
accounts.extend_from_slice(remaining_accounts);
let data = borsh::to_vec(&Instruction2InstructionData::new()).unwrap();
let data = Instruction2InstructionData::new().try_to_vec().unwrap();

solana_program::instruction::Instruction {
program_id: crate::DUMMY_ID,
Expand Down Expand Up @@ -138,7 +138,7 @@ impl<'a, 'b> Instruction2Cpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let data = borsh::to_vec(&Instruction2InstructionData::new()).unwrap();
let data = Instruction2InstructionData::new().try_to_vec().unwrap();

let instruction = solana_program::instruction::Instruction {
program_id: crate::DUMMY_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Instruction3 {
) -> solana_program::instruction::Instruction {
let mut accounts = Vec::with_capacity(remaining_accounts.len());
accounts.extend_from_slice(remaining_accounts);
let data = borsh::to_vec(&Instruction3InstructionData::new()).unwrap();
let data = Instruction3InstructionData::new().try_to_vec().unwrap();

solana_program::instruction::Instruction {
program_id: crate::DUMMY_ID,
Expand Down Expand Up @@ -140,7 +140,7 @@ impl<'a, 'b> Instruction3Cpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let data = borsh::to_vec(&Instruction3InstructionData::new()).unwrap();
let data = Instruction3InstructionData::new().try_to_vec().unwrap();

let instruction = solana_program::instruction::Instruction {
program_id: crate::DUMMY_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ impl Instruction4 {
) -> solana_program::instruction::Instruction {
let mut accounts = Vec::with_capacity(remaining_accounts.len());
accounts.extend_from_slice(remaining_accounts);
let mut data = borsh::to_vec(&Instruction4InstructionData::new()).unwrap();
let mut args = borsh::to_vec(&args).unwrap();
let mut data = Instruction4InstructionData::new().try_to_vec().unwrap();
let mut args = args.try_to_vec().unwrap();
data.append(&mut args);

solana_program::instruction::Instruction {
Expand Down Expand Up @@ -167,8 +167,8 @@ impl<'a, 'b> Instruction4Cpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let mut data = borsh::to_vec(&Instruction4InstructionData::new()).unwrap();
let mut args = borsh::to_vec(&self.__args).unwrap();
let mut data = Instruction4InstructionData::new().try_to_vec().unwrap();
let mut args = self.__args.try_to_vec().unwrap();
data.append(&mut args);

let instruction = solana_program::instruction::Instruction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ impl Instruction5 {
) -> solana_program::instruction::Instruction {
let mut accounts = Vec::with_capacity(remaining_accounts.len());
accounts.extend_from_slice(remaining_accounts);
let mut data = borsh::to_vec(&Instruction5InstructionData::new()).unwrap();
let mut args = borsh::to_vec(&args).unwrap();
let mut data = Instruction5InstructionData::new().try_to_vec().unwrap();
let mut args = args.try_to_vec().unwrap();
data.append(&mut args);

solana_program::instruction::Instruction {
Expand Down Expand Up @@ -168,8 +168,8 @@ impl<'a, 'b> Instruction5Cpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let mut data = borsh::to_vec(&Instruction5InstructionData::new()).unwrap();
let mut args = borsh::to_vec(&self.__args).unwrap();
let mut data = Instruction5InstructionData::new().try_to_vec().unwrap();
let mut args = self.__args.try_to_vec().unwrap();
data.append(&mut args);

let instruction = solana_program::instruction::Instruction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl Instruction6 {
false,
));
accounts.extend_from_slice(remaining_accounts);
let data = borsh::to_vec(&Instruction6InstructionData::new()).unwrap();
let data = Instruction6InstructionData::new().try_to_vec().unwrap();

solana_program::instruction::Instruction {
program_id: crate::DUMMY_ID,
Expand Down Expand Up @@ -170,7 +170,7 @@ impl<'a, 'b> Instruction6Cpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let data = borsh::to_vec(&Instruction6InstructionData::new()).unwrap();
let data = Instruction6InstructionData::new().try_to_vec().unwrap();

let instruction = solana_program::instruction::Instruction {
program_id: crate::DUMMY_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl Instruction7 {
));
}
accounts.extend_from_slice(remaining_accounts);
let data = borsh::to_vec(&Instruction7InstructionData::new()).unwrap();
let data = Instruction7InstructionData::new().try_to_vec().unwrap();

solana_program::instruction::Instruction {
program_id: crate::DUMMY_ID,
Expand Down Expand Up @@ -184,7 +184,7 @@ impl<'a, 'b> Instruction7Cpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let data = borsh::to_vec(&Instruction7InstructionData::new()).unwrap();
let data = Instruction7InstructionData::new().try_to_vec().unwrap();

let instruction = solana_program::instruction::Instruction {
program_id: crate::DUMMY_ID,
Expand Down
3 changes: 1 addition & 2 deletions packages/renderers-rust/e2e/memo/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/renderers-rust/e2e/memo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ test-sbf = []

[dependencies]
anchor-lang = { version = "0.30.0", optional = true }
borsh = "^1.5.3"
borsh-derive = "^1.5.3"
borsh = "^0.10"
kaigan = "0.2.5"
num-derive = "^0.3"
num-traits = "^0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ impl AddMemo {
) -> solana_program::instruction::Instruction {
let mut accounts = Vec::with_capacity(remaining_accounts.len());
accounts.extend_from_slice(remaining_accounts);
let mut data = borsh::to_vec(&AddMemoInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&args).unwrap();
let mut data = AddMemoInstructionData::new().try_to_vec().unwrap();
let mut args = args.try_to_vec().unwrap();
data.append(&mut args);

solana_program::instruction::Instruction {
Expand Down Expand Up @@ -168,8 +168,8 @@ impl<'a, 'b> AddMemoCpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let mut data = borsh::to_vec(&AddMemoInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&self.__args).unwrap();
let mut data = AddMemoInstructionData::new().try_to_vec().unwrap();
let mut args = self.__args.try_to_vec().unwrap();
data.append(&mut args);

let instruction = solana_program::instruction::Instruction {
Expand Down
3 changes: 1 addition & 2 deletions packages/renderers-rust/e2e/system/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/renderers-rust/e2e/system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ test-sbf = []

[dependencies]
anchor-lang = { version = "0.30.0", optional = true }
borsh = "^1.5.3"
borsh-derive = "^1.5.3"
borsh = "^0.10"
num-derive = "^0.3"
num-traits = "^0.2"
serde = { version = "^1.0", features = ["derive"], optional = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ impl AdvanceNonceAccount {
true,
));
accounts.extend_from_slice(remaining_accounts);
let data = borsh::to_vec(&AdvanceNonceAccountInstructionData::new()).unwrap();
let data = AdvanceNonceAccountInstructionData::new()
.try_to_vec()
.unwrap();

solana_program::instruction::Instruction {
program_id: crate::SYSTEM_ID,
Expand Down Expand Up @@ -227,7 +229,9 @@ impl<'a, 'b> AdvanceNonceAccountCpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let data = borsh::to_vec(&AdvanceNonceAccountInstructionData::new()).unwrap();
let data = AdvanceNonceAccountInstructionData::new()
.try_to_vec()
.unwrap();

let instruction = solana_program::instruction::Instruction {
program_id: crate::SYSTEM_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ impl Allocate {
true,
));
accounts.extend_from_slice(remaining_accounts);
let mut data = borsh::to_vec(&AllocateInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&args).unwrap();
let mut data = AllocateInstructionData::new().try_to_vec().unwrap();
let mut args = args.try_to_vec().unwrap();
data.append(&mut args);

solana_program::instruction::Instruction {
Expand Down Expand Up @@ -197,8 +197,8 @@ impl<'a, 'b> AllocateCpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let mut data = borsh::to_vec(&AllocateInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&self.__args).unwrap();
let mut data = AllocateInstructionData::new().try_to_vec().unwrap();
let mut args = self.__args.try_to_vec().unwrap();
data.append(&mut args);

let instruction = solana_program::instruction::Instruction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ impl AllocateWithSeed {
true,
));
accounts.extend_from_slice(remaining_accounts);
let mut data = borsh::to_vec(&AllocateWithSeedInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&args).unwrap();
let mut data = AllocateWithSeedInstructionData::new().try_to_vec().unwrap();
let mut args = args.try_to_vec().unwrap();
data.append(&mut args);

solana_program::instruction::Instruction {
Expand Down Expand Up @@ -248,8 +248,8 @@ impl<'a, 'b> AllocateWithSeedCpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let mut data = borsh::to_vec(&AllocateWithSeedInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&self.__args).unwrap();
let mut data = AllocateWithSeedInstructionData::new().try_to_vec().unwrap();
let mut args = self.__args.try_to_vec().unwrap();
data.append(&mut args);

let instruction = solana_program::instruction::Instruction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ impl Assign {
true,
));
accounts.extend_from_slice(remaining_accounts);
let mut data = borsh::to_vec(&AssignInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&args).unwrap();
let mut data = AssignInstructionData::new().try_to_vec().unwrap();
let mut args = args.try_to_vec().unwrap();
data.append(&mut args);

solana_program::instruction::Instruction {
Expand Down Expand Up @@ -201,8 +201,8 @@ impl<'a, 'b> AssignCpi<'a, 'b> {
is_writable: remaining_account.2,
})
});
let mut data = borsh::to_vec(&AssignInstructionData::new()).unwrap();
let mut args = borsh::to_vec(&self.__args).unwrap();
let mut data = AssignInstructionData::new().try_to_vec().unwrap();
let mut args = self.__args.try_to_vec().unwrap();
data.append(&mut args);

let instruction = solana_program::instruction::Instruction {
Expand Down
Loading

0 comments on commit c2c98a8

Please sign in to comment.