Bläddra i källkod

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

Chris Heaney 4 år sedan
förälder
incheckning
1f949f1dc0
2 ändrade filer med 13 tillägg och 1 borttagningar
  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