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