Parcourir la source

example/escrow: bash script to generate escrow type for test

Chris Heaney il y a 4 ans
Parent
commit
1f949f1dc0
2 fichiers modifiés avec 13 ajouts et 1 suppressions
  1. 2 1
      .travis.yml
  2. 11 0
      examples/escrow/create-idl-type.sh

+ 2 - 1
.travis.yml

@@ -74,7 +74,8 @@ jobs:
       name: Runs the examples 3
       script:
         - pushd ts && yarn && yarn build && npm link && popd
-        - pushd examples/escrow && npm link @project-serum/anchor && yarn && anchor test && popd
+        - pushd examples/escrow && npm link @project-serum/anchor && yarn && popd
+        - pushd examples/escrow && anchor build && sh ./create-idl-type.sh && anchor test --skip-build popd
         - pushd examples/pyth && yarn && anchor test && popd
         - pushd examples/tutorial/basic-0 && anchor test && popd
         - pushd examples/tutorial/basic-1 && anchor test && popd

+ 11 - 0
examples/escrow/create-idl-type.sh

@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+TYPES_DIR="./tests/types"
+rm -rf $TYPES_DIR
+mkdir -p $TYPES_DIR
+OUT_PATH="$TYPES_DIR/escrow.ts"
+
+typename="EscrowIDL"
+echo "export type $typename =" >>$OUT_PATH
+cat target/idl/escrow.json >>$OUT_PATH
+echo ";" >>$OUT_PATH