2022-02-17 14:45:33 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
echo "Building programs"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build the UncheckedAccount variant.
|
|
|
|
#
|
|
|
|
pushd programs/unchecked-account/
|
2022-03-08 13:00:25 -08:00
|
|
|
output=$(anchor build 2>&1 > /dev/null)
|
|
|
|
if ! [[ $output =~ "Struct field \"unchecked\" is unsafe" ]]; then
|
|
|
|
echo "Error: expected /// CHECK error"
|
2022-02-17 14:45:33 -08:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
popd
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build the AccountInfo variant.
|
|
|
|
#
|
|
|
|
pushd programs/account-info/
|
2022-03-08 13:00:25 -08:00
|
|
|
output=$(anchor build 2>&1 > /dev/null)
|
|
|
|
if ! [[ $output =~ "Struct field \"unchecked\" is unsafe" ]]; then
|
|
|
|
echo "Error: expected /// CHECK error"
|
2022-02-17 14:45:33 -08:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
popd
|
|
|
|
|
|
|
|
echo "Success. All builds failed."
|