use std::fs;
use std::path::Path;
const VENDORED: &[(&str, &str)] = &[
(
"../../contracts/error-codes.json",
"contract/error-codes.json",
),
("../../contracts/defaults.toml", "contract/defaults.toml"),
];
fn main() {
for &(source, vendored) in VENDORED {
println!("cargo::rerun-if-changed={vendored}");
println!("cargo::rerun-if-changed={source}");
let source = Path::new(source);
if !source.exists() {
continue; }
let want = fs::read(source).expect("read repo contract file");
let got = fs::read(vendored).expect("read vendored contract copy");
assert!(
want == got,
"vendored contract copy {vendored} is stale against {}; \
run scripts/sync-vendored.sh to refresh it",
source.display()
);
}
}