Skip to content

Commit

Permalink
Validate witnesses (#42)
Browse files Browse the repository at this point in the history
Apply verify_WitnessLayout and verify_WitnessArgs on molecule data.

---------

Co-authored-by: xjd <xjd@cryptape.com>
  • Loading branch information
joii2020 and XuJiandong authored Mar 1, 2024
1 parent e06ad7e commit c9be032
Show file tree
Hide file tree
Showing 6 changed files with 242 additions and 920 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ${PROTOCOL_SCHEMA}:

ALL_C_SOURCE := $(wildcard c/omni_lock.c c/omni_lock_acp.h c/omni_lock_time_lock.h \
tests/omni_lock/omni_lock_sim.c tests/omni_lock/ckb_syscall_omni_lock_sim.h tests/omni_lock/omni_lock_supply.h\
c/blake2b_decl_only.h c/cobuild.h c/cobuild.c)
c/blake2b_decl_only.h c/cobuild.h c/cobuild.c c/molecule2_verify.h)

fmt:
docker run --rm -v `pwd`:/code ${CLANG_FORMAT_DOCKER} bash -c "cd code && clang-format -i -style=Google $(ALL_C_SOURCE)"
Expand All @@ -76,10 +76,10 @@ omni_lock_mol:
${MOLC} --language - --schema-file c/omni_lock.mol --format json > build/omni_lock_mol2.json
moleculec-c2 --input build/omni_lock_mol2.json | clang-format -style=Google > c/omni_lock_mol2.h

build/cobuild.o: c/cobuild.c c/cobuild.h c/mol2_utils.h
$(CC) -c $(OMNI_LOCK_CFLAGS) -o $@ $<
build/cobuild.o: c/cobuild.c c/cobuild.h c/mol2_utils.h c/molecule2_verify.h
$(CC) -c $(OMNI_LOCK_CFLAGS) -DMOLECULEC_C2_DECLARATION_ONLY -o $@ $<

build/omni_lock.o: c/omni_lock.c c/omni_lock_supply.h c/omni_lock_acp.h build/secp256k1_data_info.h $(SECP256K1_SRC) c/ckb_identity.h c/mol2_utils.h
build/omni_lock.o: c/omni_lock.c c/omni_lock_supply.h c/omni_lock_acp.h build/secp256k1_data_info.h $(SECP256K1_SRC) c/ckb_identity.h c/mol2_utils.h c/cobuild_basic_mol2.h c/molecule2_verify.h
$(CC) -c $(OMNI_LOCK_CFLAGS) -o $@ $<

build/omni_lock: build/omni_lock.o build/cobuild.o
Expand Down
Loading

0 comments on commit c9be032

Please sign in to comment.