Skip to content

Commit 690ab53

Browse files
author
sam
committed
update
1 parent eaaae05 commit 690ab53

File tree

4 files changed

+100
-6
lines changed

4 files changed

+100
-6
lines changed

test/generate_sol_pb.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
#!/bin/bash
2-
2+
echo "==> Removing old solidity and protobuf files..."
33
# remove old sol and pb files
44
rm -f *.pb
55
rm -f solidity/contracts/lib/*.sol
66

77
# generate new sol files
88
export PATH="$TRAVIS_BUILD_DIR:$PATH"
9-
protoc --sol_out=importpb=true:solidity/contracts/lib/ test.proto a.proto b.proto
9+
protoc --sol_out=importpb=true:solidity/contracts/lib/ test.proto a.proto b.proto
1010

11+
echo "==> Generating protobuf files..."
1112
# generate new pb files
1213
for pathname in *.textpb; do
1314
filename=${pathname##*/}
1415
basename=${filename%.textpb}
1516
msg=${basename%%_*}
1617
msgno=${msg#msg}
1718
cat "$basename".textpb|protoc --encode=mytest.Msg"$msgno" test.proto > "$basename".pb || continue
18-
done
19+
done || exit 1
1920

2021
# generate binary msg for b to test import
2122
protoc --encode=b.B b.proto < b.pbtxt > b.pb
23+
echo "==> Generation Complete"

test/solidity/contracts/TestMain.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
pragma solidity ^0.5.0;
22

3-
import "lib/PbMytest.sol";
4-
import "lib/PbA.sol";
5-
import "lib/PbB.sol";
3+
import "./lib/PbMytest.sol";
4+
import "./lib/PbA.sol";
5+
import "./lib/PbB.sol";
66

77
contract TestMain {
88
event Msg1Part1(

test/solidity/package-lock.json

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

test/solidity/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"license": "ISC",
1515
"dependencies": {
1616
"protobufjs": "^6.10.2",
17+
"solc": "^0.5.17",
1718
"truffle": "^5.1.67",
1819
"truffle-hdwallet-provider": "^1.0.17",
1920
"web3": "^1.3.4"

0 commit comments

Comments
 (0)