Skip to content

Commit b8a5786

Browse files
authored
Merge pull request #119 from buffrr/fix-open
Fix open script & add testutils
2 parents 9f2df39 + 8cee17f commit b8a5786

File tree

4 files changed

+425
-1
lines changed

4 files changed

+425
-1
lines changed

Cargo.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol/src/validate.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ impl Validator {
145145
}
146146
Err(e) => {
147147
let input =
148-
changeset.spends.get_mut(open_idx).expect("input for open should exist");
148+
changeset.spends.iter_mut().find(|s| s.n == open_idx)
149+
.expect("input for open should exist");
149150
input.script_error = Some(e);
150151
}
151152
}

testutil/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@ name = "spaces_testutil"
33
version = "0.0.1"
44
edition = "2021"
55

6+
[[bin]]
7+
name = "db-dump"
8+
path = "src/bin/db_dump.rs"
9+
610
[dependencies]
711
bitcoind = { version = "0.36.0", features = ["26_0"] }
812
spaces_client = { path = "../client" }
913
hyper = "0.14.28"
1014
assert_cmd = "2.0.16"
15+
anyhow = "1.0.66"
16+
hex = "0.4"
17+
spacedb = { git = "https://github.com/spacesprotocol/spacedb", version = "0.0.7" }
18+
spaces_protocol = { path = "../protocol", features = ["std", "serde"] }
19+
bincode = { version = "2.0.1", features = ["serde", "derive"] }
20+
serde_json = "1.0"
1121

1222
[build-dependencies]
1323
zip = { version = "0.6" }

0 commit comments

Comments
 (0)