github.com/turingchain2020/turingchain@v1.1.21/cmd/tools/doc/calculator.proto (about) 1 syntax = "proto3"; 2 3 package types; 4 // calculator 合约交易行为总类型 5 message CalculatorAction { 6 oneof value { 7 Add add = 1; 8 Subtract sub = 2; 9 Multiply mul = 3; 10 Divide div = 4; 11 } 12 int32 ty = 5; 13 } 14 15 message Add { 16 int32 summand = 1; //被加数 17 int32 addend = 2; //加数 18 } 19 message AddLog { 20 int32 sum = 1; //和 21 } 22 23 message Subtract { 24 int32 minuend = 1; //被减数 25 int32 subtrahend = 2; //减数 26 } 27 message SubLog { 28 int32 remainder = 1; //差 29 } 30 31 message Multiply { 32 int32 faciend = 1; //被乘数 33 int32 multiplier = 2; //乘数 34 } 35 message MultiplyLog { 36 int32 product = 1; //积 37 } 38 39 message Divide { 40 int32 dividend = 1; //被除数 41 int32 divisor = 2; //除数 42 } 43 message DivideLog { 44 int32 quotient = 1; //商 45 int32 remain = 2; //余数 46 } 47 48 message ReqQueryCalcCount { 49 string action = 1; 50 } 51 message ReplyQueryCalcCount { 52 int32 count = 1; 53 } 54 55 service calculator { 56 rpc QueryCalcCount(ReqQueryCalcCount) returns (ReplyQueryCalcCount) {} 57 }