Check error in safety checks test failure (#1571)
This commit is contained in:
parent
6dd0574cca
commit
5c5fa7927f
|
@ -5,7 +5,7 @@ declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
|
|||
#[program]
|
||||
pub mod account_info {
|
||||
use super::*;
|
||||
pub fn initialize(ctx: Context<Initialize>) -> ProgramResult {
|
||||
pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
|
|||
#[program]
|
||||
pub mod unchecked_account {
|
||||
use super::*;
|
||||
pub fn initialize(ctx: Context<Initialize>) -> ProgramResult {
|
||||
pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@ echo "Building programs"
|
|||
# Build the UncheckedAccount variant.
|
||||
#
|
||||
pushd programs/unchecked-account/
|
||||
anchor build
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Error: expected failure"
|
||||
output=$(anchor build 2>&1 > /dev/null)
|
||||
if ! [[ $output =~ "Struct field \"unchecked\" is unsafe" ]]; then
|
||||
echo "Error: expected /// CHECK error"
|
||||
exit 1
|
||||
fi
|
||||
popd
|
||||
|
@ -17,9 +17,9 @@ popd
|
|||
# Build the AccountInfo variant.
|
||||
#
|
||||
pushd programs/account-info/
|
||||
anchor build
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Error: expected failure"
|
||||
output=$(anchor build 2>&1 > /dev/null)
|
||||
if ! [[ $output =~ "Struct field \"unchecked\" is unsafe" ]]; then
|
||||
echo "Error: expected /// CHECK error"
|
||||
exit 1
|
||||
fi
|
||||
popd
|
||||
|
|
Loading…
Reference in New Issue