diff --git a/CMakeLists.txt b/CMakeLists.txt index e8002c02e..f8a8c7310 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ add_custom_target(distclean GO111MODULE=on go clean .. DEPENDS libtool-clean) add_custom_target(protoc - COMMAND protoc -I/usr/local/include -I${PROTO_DIR} --go_out=plugins=grpc:${CMAKE_CURRENT_LIST_DIR}/types ${PROTO_DIR}/*.proto + COMMAND protoc -I/usr/local/include -I${PROTO_DIR} --go_out=${CMAKE_CURRENT_LIST_DIR}/types --go_opt=paths=source_relative --go-grpc_out=${CMAKE_CURRENT_LIST_DIR}/types --go-grpc_opt=paths=source_relative ${PROTO_DIR}/*.proto COMMAND GO111MODULE=on go build ../types/...) add_custom_target(protoclean rm -f ../types/*.pb.go) diff --git a/account/accountservice.go b/account/accountservice.go index c0c7feff7..41f13add9 100644 --- a/account/accountservice.go +++ b/account/accountservice.go @@ -63,7 +63,7 @@ func (as *AccountService) Statistics() *map[string]interface{} { } } func (as *AccountService) resolveName(namedAddress []byte) ([]byte, error) { - scs, err := as.sdb.GetStateDB().OpenContractStateAccount(types.ToAccountID([]byte(types.AergoName))) + scs, err := as.sdb.GetStateDB().GetNameAccountState() if err != nil { return nil, err } diff --git a/aergo-protobuf b/aergo-protobuf index 6047c704f..0c3579cd4 160000 --- a/aergo-protobuf +++ b/aergo-protobuf @@ -1 +1 @@ -Subproject commit 6047c704fd3815466157bd70139ad656480bc745 +Subproject commit 0c3579cd42f830eb787715a78895d971b8ee5fce diff --git a/chain/chainhandle.go b/chain/chainhandle.go index 14be24121..23567d4fd 100644 --- a/chain/chainhandle.go +++ b/chain/chainhandle.go @@ -744,6 +744,7 @@ func (cs *ChainService) executeBlock(bstate *state.BlockState, block *types.Bloc // contract & state DB update is done during execution. if err := ex.execute(); err != nil { + cs.Update(bestBlock) return err } diff --git a/chain/chainservice.go b/chain/chainservice.go index bdca76d7c..f867b9d91 100644 --- a/chain/chainservice.go +++ b/chain/chainservice.go @@ -685,7 +685,7 @@ func (cm *ChainManager) Receive(context actor.Context) { func getAddressNameResolved(sdb *state.StateDB, account []byte) ([]byte, error) { if len(account) == types.NameLength { - scs, err := sdb.OpenContractStateAccount(types.ToAccountID([]byte(types.AergoName))) + scs, err := sdb.GetNameAccountState() if err != nil { logger.Error().Str("hash", enc.ToString(account)).Err(err).Msg("failed to get state for account") return nil, err diff --git a/chain/governance.go b/chain/governance.go index 06ad3ce17..fcc6457a6 100644 --- a/chain/governance.go +++ b/chain/governance.go @@ -56,8 +56,7 @@ func executeGovernanceTx(ccc consensus.ChainConsensusCluster, bs *state.BlockSta // InitGenesisBPs opens system contract and put initial voting result // it also set *State in Genesis to use statedb func InitGenesisBPs(states *state.StateDB, genesis *types.Genesis) error { - aid := types.ToAccountID([]byte(types.AergoSystem)) - scs, err := states.OpenContractStateAccount(aid) + scs, err := states.GetSystemAccountState() if err != nil { return err } diff --git a/chain/signVerifier.go b/chain/signVerifier.go index 69583b28f..b3b65edab 100644 --- a/chain/signVerifier.go +++ b/chain/signVerifier.go @@ -132,7 +132,7 @@ func (sv *SignVerifier) verifyTx(comm component.IComponentRequester, tx *types.T } if tx.NeedNameVerify() { - cs, err := sv.sdb.GetStateDB().OpenContractStateAccount(types.ToAccountID([]byte(types.AergoName))) + cs, err := sv.sdb.GetStateDB().GetNameAccountState() if err != nil { logger.Error().Err(err).Msg("failed to get verify because of opening contract error") return false, err diff --git a/consensus/impl/dpos/dpos.go b/consensus/impl/dpos/dpos.go index e98e0035e..331b186e5 100644 --- a/consensus/impl/dpos/dpos.go +++ b/consensus/impl/dpos/dpos.go @@ -207,7 +207,7 @@ func sendVotingReward(bState *state.BlockState, dummy []byte) error { } func InitVPR(sdb *state.StateDB) error { - s, err := sdb.OpenContractStateAccount(types.ToAccountID([]byte(types.AergoSystem))) + s, err := sdb.GetSystemAccountState() if err != nil { return err } diff --git a/contract/bignum_module.c b/contract/bignum_module.c index a75878139..f1d7c8f09 100644 --- a/contract/bignum_module.c +++ b/contract/bignum_module.c @@ -549,15 +549,19 @@ static const luaL_Reg R[] = { }; LUALIB_API int luaopen_bignum(lua_State *L) { + luaL_newmetatable(L,MYTYPE); lua_setglobal(L,MYNAME); luaL_register(L,MYNAME,R); + lua_pushliteral(L,"version"); /* version */ lua_pushliteral(L,MYVERSION); lua_settable(L,-3); + lua_pushliteral(L,"__index"); lua_pushvalue(L,-2); lua_settable(L,-3); + lua_pop(L, 1); return 1; } diff --git a/contract/contract_module.c b/contract/contract_module.c index b1c7aff9a..da9b259be 100644 --- a/contract/contract_module.c +++ b/contract/contract_module.c @@ -230,7 +230,6 @@ static int moduleSend(lua_State *L) { static int moduleBalance(lua_State *L) { char *contract; int service = getLuaExecContext(L); - lua_Integer amount; struct luaGetBalance_return balance; int nArg; diff --git a/contract/db_module.c b/contract/db_module.c index 46e00f026..e2ac603dc 100644 --- a/contract/db_module.c +++ b/contract/db_module.c @@ -600,36 +600,36 @@ int lua_db_release_resource(lua_State *L) { return 0; } -int luaopen_db(lua_State *L) { +static const luaL_Reg rs_methods[] = { + {"next", db_rs_next}, + {"get", db_rs_get}, + {"colcnt", db_rs_colcnt}, + {"__tostring", db_rs_tostr}, + {"__gc", db_rs_gc}, + {NULL, NULL} +}; + +static const luaL_Reg pstmt_methods[] = { + {"exec", db_pstmt_exec}, + {"query", db_pstmt_query}, + {"column_info", db_pstmt_column_info}, + {"bind_param_cnt", db_pstmt_bind_param_cnt}, + {"__tostring", db_pstmt_tostr}, + {"__gc", db_pstmt_gc}, + {NULL, NULL} +}; + +static const luaL_Reg db_lib[] = { + {"exec", db_exec}, + {"query", db_query}, + {"prepare", db_prepare}, + {"getsnap", db_get_snapshot}, + {"open_with_snapshot", db_open_with_snapshot}, + {"last_insert_rowid", db_last_insert_rowid}, + {NULL, NULL} +}; - static const luaL_Reg rs_methods[] = { - {"next", db_rs_next}, - {"get", db_rs_get}, - {"colcnt", db_rs_colcnt}, - {"__tostring", db_rs_tostr}, - {"__gc", db_rs_gc}, - {NULL, NULL} - }; - - static const luaL_Reg pstmt_methods[] = { - {"exec", db_pstmt_exec}, - {"query", db_pstmt_query}, - {"column_info", db_pstmt_column_info}, - {"bind_param_cnt", db_pstmt_bind_param_cnt}, - {"__tostring", db_pstmt_tostr}, - {"__gc", db_pstmt_gc}, - {NULL, NULL} - }; - - static const luaL_Reg db_lib[] = { - {"exec", db_exec}, - {"query", db_query}, - {"prepare", db_prepare}, - {"getsnap", db_get_snapshot}, - {"open_with_snapshot", db_open_with_snapshot}, - {"last_insert_rowid", db_last_insert_rowid}, - {NULL, NULL} - }; +int luaopen_db(lua_State *L) { luaL_newmetatable(L, DB_RS_ID); lua_pushvalue(L, -1); @@ -642,6 +642,7 @@ int luaopen_db(lua_State *L) { luaL_register(L, NULL, pstmt_methods); luaL_register(L, "db", db_lib); + lua_pop(L, 3); return 1; } diff --git a/contract/enterprise/config_test.go b/contract/enterprise/config_test.go index 6168a0fc6..50c3d9482 100644 --- a/contract/enterprise/config_test.go +++ b/contract/enterprise/config_test.go @@ -24,7 +24,7 @@ func initTest(t *testing.T) (*state.ContractState, *state.V, *state.V) { } const testSender = "AmPNYHyzyh9zweLwDyuoiUuTVCdrdksxkRWDjVJS76WQLExa2Jr4" - scs, err := cdb.GetStateDB().OpenContractStateAccount(types.ToAccountID([]byte("aergo.system"))) + scs, err := cdb.GetStateDB().GetSystemAccountState() assert.NoError(t, err, "could not open contract state") account, err := types.DecodeAddress(testSender) diff --git a/contract/name/execute.go b/contract/name/execute.go index b3858f425..68739e853 100644 --- a/contract/name/execute.go +++ b/contract/name/execute.go @@ -14,7 +14,7 @@ import ( func ExecuteNameTx(bs *state.BlockState, scs *state.ContractState, txBody *types.TxBody, sender, receiver *state.V, blockInfo *types.BlockHeaderInfo) ([]*types.Event, error) { - systemContractState, err := bs.StateDB.OpenContractStateAccount(types.ToAccountID([]byte(types.AergoSystem))) + systemContractState, err := bs.StateDB.GetSystemAccountState() ci, err := ValidateNameTx(txBody, sender, scs, systemContractState) if err != nil { diff --git a/contract/name/execute_test.go b/contract/name/execute_test.go index 4a16f2cde..3726c37ef 100644 --- a/contract/name/execute_test.go +++ b/contract/name/execute_test.go @@ -113,19 +113,13 @@ func TestExcuteFailNameTx(t *testing.T) { } func openContractState(t *testing.T, bs *state.BlockState) *state.ContractState { - nameContractID := types.ToAccountID([]byte(types.AergoName)) - nameContract, err := bs.GetAccountState(nameContractID) - assert.NoError(t, err, "could not get account state") - scs, err := bs.OpenContractState(nameContractID, nameContract) + scs, err := bs.GetNameAccountState() assert.NoError(t, err, "could not open contract state") return scs } func openSystemContractState(t *testing.T, bs *state.BlockState) *state.ContractState { - systemContractID := types.ToAccountID([]byte(types.AergoSystem)) - systemContract, err := bs.GetAccountState(systemContractID) - assert.NoError(t, err, "could not get account state") - scs, err := bs.OpenContractState(systemContractID, systemContract) + scs, err := bs.GetSystemAccountState() assert.NoError(t, err, "could not open contract state") return scs } diff --git a/contract/name/name_test.go b/contract/name/name_test.go index 7ca8e37ba..2748dcdeb 100644 --- a/contract/name/name_test.go +++ b/contract/name/name_test.go @@ -117,7 +117,7 @@ func TestNameNil(t *testing.T) { name1 := "AB1234567890" name2 := "1234567890CD" - scs, err := sdb.GetStateDB().OpenContractStateAccount(types.ToAccountID([]byte("aergo.system"))) + scs, err := sdb.GetStateDB().GetSystemAccountState() assert.NoError(t, err, "could not open contract state") tx := &types.TxBody{Account: []byte(name1), Payload: buildNamePayload(name2, types.NameCreate, "")} sender, _ := sdb.GetStateDB().GetAccountStateV(tx.Account) diff --git a/contract/state_module.c b/contract/state_module.c index 33a9c02eb..48e0b1ef8 100644 --- a/contract/state_module.c +++ b/contract/state_module.c @@ -669,5 +669,6 @@ int luaopen_state(lua_State *L) { luaL_register(L, "state", state_lib); + lua_pop(L, 1); return 1; } diff --git a/contract/system/execute_test.go b/contract/system/execute_test.go index 82ae494b7..4d3fe2907 100644 --- a/contract/system/execute_test.go +++ b/contract/system/execute_test.go @@ -242,7 +242,7 @@ func TestValidateSystemTxForStaking(t *testing.T) { scs, sender, receiver := initTest(t) defer deinitTest() - scs, err := cdb.GetStateDB().OpenContractStateAccount(types.ToAccountID([]byte("aergo.system"))) + scs, err := cdb.GetStateDB().GetSystemAccountState() assert.NoError(t, err, "could not open contract state") tx := &types.Tx{ @@ -265,7 +265,7 @@ func TestValidateSystemTxForUnstaking(t *testing.T) { defer deinitTest() const testSender = "AmPNYHyzyh9zweLwDyuoiUuTVCdrdksxkRWDjVJS76WQLExa2Jr4" - scs, err := cdb.GetStateDB().OpenContractStateAccount(types.ToAccountID([]byte("aergo.system"))) + scs, err := cdb.GetStateDB().GetSystemAccountState() assert.NoError(t, err, "could not open contract state") account, err := types.DecodeAddress(testSender) diff --git a/contract/system/staking_test.go b/contract/system/staking_test.go index f9c8ed102..7c1a0fb6b 100644 --- a/contract/system/staking_test.go +++ b/contract/system/staking_test.go @@ -138,7 +138,7 @@ func TestUnstakingError(t *testing.T) { initTest(t) defer deinitTest() const testSender = "AmPNYHyzyh9zweLwDyuoiUuTVCdrdksxkRWDjVJS76WQLExa2Jr4" - scs, err := cdb.GetStateDB().OpenContractStateAccount(types.ToAccountID([]byte("aergo.system"))) + scs, err := cdb.GetStateDB().GetSystemAccountState() assert.Equal(t, err, nil, "could not open contract state") account, err := types.DecodeAddress(testSender) diff --git a/contract/system/vote.go b/contract/system/vote.go index 9c809aaaa..5d2ee9187 100644 --- a/contract/system/vote.go +++ b/contract/system/vote.go @@ -92,13 +92,27 @@ func newVprCmd(ctx *SystemContext, vr *VoteResult) *vprCmd { func (c *vprCmd) subVote(v *types.Vote) error { votingPowerRank.sub(c.Sender.AccountID(), c.Sender.ID(), v.GetAmountBigInt()) - + // Hotfix - reproduce vpr calculation for block 138015125 + // When block is reverted, votingPowerRank is not reverted and calculated three times. + // TODO : implement commit, revert, reorg for governance variables. + if c.BlockInfo.No == 138015125 && c.Sender.AccountID().String() == "36t2u7Q31HmEbkkYZng7DHNm3xepxHKUfgGrAXNA8pMW" { + for i := 0; i < 2; i++ { + votingPowerRank.sub(c.Sender.AccountID(), c.Sender.ID(), v.GetAmountBigInt()) + } + } return c.voteResult.SubVote(v) } func (c *vprCmd) addVote(v *types.Vote) error { votingPowerRank.add(c.Sender.AccountID(), c.Sender.ID(), v.GetAmountBigInt()) - + // Hotfix - reproduce vpr calculation for block 138015125 + // When block is reverted, votingPowerRank is not reverted and calculated three times. + // TODO : implement commit, revert, reorg for governance variables. + if c.BlockInfo.No == 138015125 && c.Sender.AccountID().String() == "36t2u7Q31HmEbkkYZng7DHNm3xepxHKUfgGrAXNA8pMW" { + for i := 0; i < 2; i++ { + votingPowerRank.add(c.Sender.AccountID(), c.Sender.ID(), v.GetAmountBigInt()) + } + } return c.voteResult.AddVote(v) } diff --git a/contract/system/vote_test.go b/contract/system/vote_test.go index 0b19c618e..57b0562f4 100644 --- a/contract/system/vote_test.go +++ b/contract/system/vote_test.go @@ -38,7 +38,7 @@ func initTest(t *testing.T) (*state.ContractState, *state.V, *state.V) { InitGovernance("dpos") const testSender = "AmPNYHyzyh9zweLwDyuoiUuTVCdrdksxkRWDjVJS76WQLExa2Jr4" - scs, err := bs.OpenContractStateAccount(types.ToAccountID([]byte("aergo.system"))) + scs, err := bs.GetSystemAccountState() assert.NoError(t, err, "could not open contract state") InitSystemParams(scs, 3) @@ -64,10 +64,7 @@ func commitNextBlock(t *testing.T, scs *state.ContractState) *state.ContractStat bs.Update() bs.Commit() cdb.UpdateRoot(bs) - systemContractID := types.ToAccountID([]byte(types.AergoSystem)) - systemContract, err := bs.GetAccountState(systemContractID) - assert.NoError(t, err, "could not get account state") - ret, err := bs.OpenContractState(systemContractID, systemContract) + ret, err := bs.GetSystemAccountState() assert.NoError(t, err, "could not open contract state") return ret } diff --git a/contract/system/vprt_test.go b/contract/system/vprt_test.go index b3be7924c..2cd9582b3 100644 --- a/contract/system/vprt_test.go +++ b/contract/system/vprt_test.go @@ -4,13 +4,13 @@ import ( "bytes" "container/list" "fmt" - "github.com/aergoio/aergo-lib/log" "math/big" "math/rand" "os" "testing" "github.com/aergoio/aergo-lib/db" + "github.com/aergoio/aergo-lib/log" "github.com/aergoio/aergo/v2/internal/enc" "github.com/aergoio/aergo/v2/state" "github.com/aergoio/aergo/v2/types" @@ -125,7 +125,7 @@ func initVprtTest(t *testing.T, initTable func()) { func initVprtTestWithSc(t *testing.T, initTable func(*state.ContractState)) { initDB(t) - s, err := vprStateDB.OpenContractStateAccount(types.ToAccountID([]byte(types.AergoSystem))) + s, err := vprStateDB.GetSystemAccountState() assert.NoError(t, err, "fail to open the system contract state") initTable(s) @@ -148,7 +148,7 @@ func getStateRoot() []byte { } func openSystemAccountWith(root []byte) *state.ContractState { - s, err := vprChainStateDB.OpenNewStateDB(root).OpenContractStateAccount(types.ToAccountID([]byte(types.AergoSystem))) + s, err := vprChainStateDB.OpenNewStateDB(root).GetSystemAccountState() if err != nil { return nil } @@ -172,7 +172,7 @@ func initRankTableRand(rankMax uint32) { } func openSystemAccount(t *testing.T) *state.ContractState { - s, err := vprStateDB.OpenContractStateAccount(types.ToAccountID([]byte(types.AergoSystem))) + s, err := vprStateDB.GetSystemAccountState() assert.NoError(t, err, "fail to open the system contract state") logger.Debug().Msgf( "(after) state, contract: %s, %s\n", diff --git a/contract/system_module.h b/contract/system_module.h index 149ae6748..b78680cd9 100644 --- a/contract/system_module.h +++ b/contract/system_module.h @@ -4,10 +4,11 @@ #include "lua.h" extern int luaopen_system(lua_State *L); + extern int setItem(lua_State *L); extern int setItemWithPrefix(lua_State *L); extern int getItem(lua_State *L); extern int getItemWithPrefix(lua_State *L); extern int delItemWithPrefix(lua_State *L); -#endif /* _SYSTEM_MODULE_H */ \ No newline at end of file +#endif /* _SYSTEM_MODULE_H */ diff --git a/contract/vm.c b/contract/vm.c index b46296b5d..1f3ea6c69 100644 --- a/contract/vm.c +++ b/contract/vm.c @@ -118,17 +118,20 @@ const char *vm_loadcall(lua_State *L) { } luaL_enablemaxmem(L); } + err = lua_pcall(L, 0, 0, 0); + if (lua_usegas(L)) { lua_disablegas(L); } else { luaL_disablemaxmem(L); } + lua_sethook(L, NULL, 0, 0); + if (err != 0) { return lua_tostring(L, -1); } - return NULL; } diff --git a/contract/vm.go b/contract/vm.go index ca69e3b05..992496850 100644 --- a/contract/vm.go +++ b/contract/vm.go @@ -55,11 +55,11 @@ const ( ) var ( - maxContext int - ctrLgr *log.Logger - contexts []*vmContext - lastQueryIndex int - querySync sync.Mutex + maxContext int + ctrLgr *log.Logger + contexts []*vmContext + lastQueryIndex int + querySync sync.Mutex currentForkVersion int32 ) @@ -230,40 +230,48 @@ func NewVmContextQuery( return ctx, nil } -func (s *vmContext) IsGasSystem() bool { - return !s.isQuery && PubNet && s.blockInfo.ForkVersion >= 2 +func (ctx *vmContext) IsGasSystem() bool { + return !ctx.isQuery && PubNet && ctx.blockInfo.ForkVersion >= 2 } -func (s *vmContext) getRemainingGas(L *LState) { - if s.IsGasSystem() { - s.remainedGas = uint64(C.lua_gasget(L)) +// get the remaining gas from the given LState +func (ctx *vmContext) getRemainingGas(L *LState) { + if ctx.IsGasSystem() { + ctx.remainedGas = uint64(C.lua_gasget(L)) + } +} + +// set the remaining gas on the given LState +func (ctx *vmContext) setRemainingGas(L *LState) { + if ctx.IsGasSystem() { + C.lua_gasset(L, C.ulonglong(ctx.remainedGas)) } } -func (s *vmContext) usedFee() *big.Int { +func (ctx *vmContext) usedFee() *big.Int { if fee.IsZeroFee() { return fee.NewZeroFee() } - if s.IsGasSystem() { - usedGas := s.usedGas() + if ctx.IsGasSystem() { + usedGas := ctx.usedGas() if ctrLgr.IsDebugEnabled() { ctrLgr.Debug().Uint64("gas used", usedGas).Str("lua vm", "executed").Msg("gas information") } - return new(big.Int).Mul(s.bs.GasPrice, new(big.Int).SetUint64(usedGas)) + return new(big.Int).Mul(ctx.bs.GasPrice, new(big.Int).SetUint64(usedGas)) } - return fee.PaymentDataFee(s.dbUpdateTotalSize) + return fee.PaymentDataFee(ctx.dbUpdateTotalSize) } -func (s *vmContext) usedGas() uint64 { - if fee.IsZeroFee() || !s.IsGasSystem() { +func (ctx *vmContext) usedGas() uint64 { + if fee.IsZeroFee() || !ctx.IsGasSystem() { return 0 } - return s.gasLimit - s.remainedGas + return ctx.gasLimit - ctx.remainedGas } func newLState() *LState { - ctrLgr.Debug().Msg("LState created") - return C.vm_newstate(C.int(currentForkVersion)) + ctrLgr.Debug().Msg("LState created") + return C.vm_newstate(C.int(currentForkVersion)) } func (L *LState) close() { diff --git a/contract/vm_callback.go b/contract/vm_callback.go index 226c85ac0..b91e45075 100644 --- a/contract/vm_callback.go +++ b/contract/vm_callback.go @@ -65,14 +65,14 @@ func init() { zeroBig = types.NewZeroAmount() } -func addUpdateSize(s *vmContext, updateSize int64) error { - if s.IsGasSystem() { +func addUpdateSize(ctx *vmContext, updateSize int64) error { + if ctx.IsGasSystem() { return nil } - if s.dbUpdateTotalSize+updateSize > dbUpdateMaxLimit { + if ctx.dbUpdateTotalSize+updateSize > dbUpdateMaxLimit { return errors.New("exceeded size of updates in the state database") } - s.dbUpdateTotalSize += updateSize + ctx.dbUpdateTotalSize += updateSize return nil } @@ -1584,13 +1584,6 @@ func LuaGetDbSnapshot(service C.int) *C.char { return C.CString(strconv.FormatUint(curContract.rp, 10)) } -// set the remaining gas on the given LState -func (ctx *vmContext) setRemainingGas(L *LState) { - if ctx.IsGasSystem() { - C.lua_gasset(L, C.ulonglong(ctx.remainedGas)) - } -} - //export luaGetStaking func luaGetStaking(service C.int, addr *C.char) (*C.char, C.lua_Integer, *C.char) { diff --git a/contract/vm_dummy/test_files/arc1-factory.lua b/contract/vm_dummy/test_files/arc1-factory.lua new file mode 100644 index 000000000..a7f5dbbf3 --- /dev/null +++ b/contract/vm_dummy/test_files/arc1-factory.lua @@ -0,0 +1,936 @@ +arc1_core = [[ +------------------------------------------------------------------------------ +-- Aergo Standard Token Interface (Proposal) - 20211028 +-- Core +------------------------------------------------------------------------------ + +extensions = {} + +---- State Data for Token +state.var { + _contract_owner = state.value(), + + _balances = state.map(), -- address -> unsigned_bignum + _totalSupply = state.value(), -- unsigned_bignum + + _name = state.value(), -- string + _symbol = state.value(), -- string + _decimals = state.value(), -- string + + -- Token Metadata + _metakeys = state.map(), -- number -> string + _metadata = state.map(), -- string -> string + + -- Pausable + _paused = state.value(), -- boolean + + -- Blacklist + _blacklist = state.map() -- address -> boolean +} + +address0 = '1111111111111111111111111111111111111111111111111111' -- null address + +-- Type check +-- @type internal +-- @param x variable to check +-- @param t (string) expected type +local function _typecheck(x, t) + if (x and t == 'address') then -- a string containing an address + assert(type(x) == 'string', "ARC1: address must be a string") + -- check address length + assert(#x == 52, string.format("ARC1: invalid address length (%s): %s", #x, x)) + -- check address checksum + if x ~= address0 then + local success = pcall(system.isContract, x) + assert(success, "ARC1: invalid address: " .. x) + end + elseif (x and t == 'ubig') then -- a positive big integer + -- check unsigned bignum + assert(bignum.isbignum(x), string.format("ARC1: invalid type: %s != %s", type(x), t)) + assert(x >= bignum.number(0), string.format("ARC1: %s must be positive number", bignum.tostring(x))) + elseif (x and t == 'uint') then -- a positive lua integer + assert(type(x) == 'number', string.format("ARC1: invalid type: %s != number", type(x))) + assert(math.floor(x) == x, "ARC1: the number must be an integer") + assert(x >= 0, "ARC1: the number must be 0 or positive") + else + -- check default lua types + assert(type(x) == t, string.format("ARC1: invalid type: %s != %s", type(x), t or 'nil')) + end +end + +-- check or convert the input to a bignum +function _check_bignum(x) + -- if the input is a string, convert it to bignum + if type(x) == 'string' then + -- check for valid characters: 0-9 and . + assert(string.match(x, '[^0-9.]') == nil, "ARC1: amount contains invalid character") + -- count the number of dots + local _, count = string.gsub(x, "%.", "") + assert(count <= 1, "ARC1: the amount is invalid") + -- if the number has a dot + if count == 1 then + local num_decimals = _decimals:get() + -- separate the integer part and the decimal part + local p1, p2 = string.match('0' .. x .. '0', '(%d+)%.(%d+)') + -- calculate the number of digits to add + local to_add = num_decimals - #p2 + if to_add > 0 then + -- add trailing zeros + p2 = p2 .. string.rep('0', to_add) + elseif to_add < 0 then + -- do not remove trailing digits + --p2 = string.sub(p2, 1, num_decimals) + assert(false, "ARC1: too many decimal digits") + end + -- join the integer part and the decimal part + x = p1 .. p2 + -- remove leading zeros + x = string.gsub(x, '0*', '', 1) + -- if the result is an empty string, set it to '0' + if #x == 0 then x = '0' end + end + -- convert the string to bignum + x = bignum.number(x) + end + -- check if it is a valid unsigned bignum + _typecheck(x, 'ubig') + return x +end + +-- initialize the token contract +-- this function should be called by the constructor +-- this function can be called only once +-- @type internal +-- @param name (string) name of this token +-- @param symbol (string) symbol of this token +-- @param decimals (number) decimals of this token +-- @param owner (optional:address) the owner of this contract +local function _init(name, symbol, decimals, owner) + + -- check if the contract is already initialized + assert(_name:get() == nil, "ARC1: the contract is already initialized") + + if owner == nil or owner == '' then + owner = system.getCreator() + elseif owner == 'none' then + owner = nil + else + _typecheck(owner, "address") + end + _contract_owner:set(owner) + + _typecheck(name, 'string') + _typecheck(symbol, 'string') + _typecheck(decimals, 'uint') + + assert(decimals >= 0 and decimals <= 18, "decimals must be between 0 and 18") + + _name:set(name) + _symbol:set(symbol) + _decimals:set(decimals) + + _totalSupply:set(bignum.number(0)) + _paused:set(false) + +end + +-- Get the token name +-- @type query +-- @return (string) name of this token +function name() + return _name:get() +end + +-- Get the token symbol +-- @type query +-- @return (string) symbol of this token +function symbol() + return _symbol:get() +end + +-- Get the token decimals +-- @type query +-- @return (number) decimals of this token +function decimals() + return _decimals:get() +end + +-- Store token metadata +-- @type call +-- @param metadata (table) lua table containing key-value pairs +function set_metadata(metadata) + + assert(system.getSender() == _contract_owner:get(), "ARC1: permission denied") + + for key,value in pairs(metadata) do + for i=1,1000,1 do + local skey = _metakeys[tostring(i)] + if skey == nil then + _metakeys[tostring(i)] = key + break + end + if skey == key then + break + end + end + _metadata[key] = value + end + +end + +-- Get token metadata +-- @type query +-- @return (string) if key is nil, return all metadata from token, +-- otherwise return the value linked to the key +function get_metadata(key) + + if key ~= nil then + return _metadata[key] + end + + local items = {} + for i=1,1000,1 do + key = _metakeys[tostring(i)] + if key == nil then break end + local value = _metadata[key] + items[key] = value + end + return items + +end + +-- Get the balance of an account +-- @type query +-- @param owner (address) +-- @return (ubig) balance of owner +function balanceOf(owner) + if owner == nil then + owner = system.getSender() + else + _typecheck(owner, 'address') + end + + return _balances[owner] or bignum.number(0) +end + +-- Return the total supply of this token +-- @type query +-- @return (ubig) total supply of this token +function totalSupply() + return _totalSupply:get() +end + +-- register exported functions +abi.register(set_metadata) +abi.register_view(name, symbol, decimals, get_metadata, totalSupply, balanceOf) + +-- Call the tokensReceived() function on the recipient contract after a transfer or mint +-- @type internal +-- @param from (address) sender's address +-- @param to (address) recipient's address +-- @param amount (ubig) the amount of token that was sent +-- @param ... additional data which is sent unaltered in the call +-- @return value returned from the 'tokensReceived' callback, or nil +local function _callTokensReceived(from, to, amount, ...) + if to ~= address0 and system.isContract(to) then + return contract.call(to, "tokensReceived", system.getSender(), from, amount, ...) + else + return nil + end +end + +-- Transfer tokens from an account to another +-- @type internal +-- @param from (address) sender's address +-- @param to (address) recipient's address +-- @param amount (ubig) amount of token to send +-- @param ... additional data, is sent unaltered in call to 'tokensReceived' on 'to' +-- @return value returned from 'tokensReceived' callback, or nil +local function _transfer(from, to, amount, ...) + assert(not _paused:get(), "ARC1: paused contract") + assert(not _blacklist[from], "ARC1: sender is on blacklist") + assert(not _blacklist[to], "ARC1: recipient is on blacklist") + + -- block transfers of `0` amount + assert(amount > bignum.number(0), "ARC1: invalid amount") + + local balance = _balances[from] or bignum.number(0) + assert(balance >= amount, "ARC1: not enough balance") + + _balances[from] = balance - amount + _balances[to] = (_balances[to] or bignum.number(0)) + amount + + return _callTokensReceived(from, to, amount, ...) +end + +-- Mint new tokens to an account +-- @type internal +-- @param to (address) recipient's address +-- @param amount (ubig) amount of tokens to mint +-- @param ... additional data, is sent unaltered in call to 'tokensReceived' on 'to' +-- @return value returned from 'tokensReceived' callback, or nil +local function _mint(to, amount, ...) + assert(not _paused:get(), "ARC1: paused contract") + assert(not _blacklist[to], "ARC1: recipient is on blacklist") + + _totalSupply:set((_totalSupply:get() or bignum.number(0)) + amount) + _balances[to] = (_balances[to] or bignum.number(0)) + amount + + return _callTokensReceived(system.getSender(), to, amount, ...) +end + +-- Burn tokens from an account +-- @type internal +-- @param from (address) +-- @param amount (ubig) amount of tokens to burn +local function _burn(from, amount) + assert(not _paused:get(), "ARC1: paused contract") + assert(not _blacklist[from], "ARC1: sender is on blacklist") + + assert(amount > bignum.number(0), "ARC1: invalid amount") + + local balance = _balances[from] or bignum.number(0) + assert(balance >= amount, "ARC1: not enough balance") + + _balances[from] = balance - amount + _totalSupply:set(_totalSupply:get() - amount) +end + +-- Transfer tokens to an account (from caller) +-- @type call +-- @param to (address) recipient's address +-- @param amount (ubig) amount of tokens to send +-- @param ... additional data, is sent unaltered in call to 'tokensReceived' on 'to' +-- @return value returned from 'tokensReceived' callback, or nil +-- @event transfer(from, to, amount) +function transfer(to, amount, ...) + _typecheck(to, 'address') + amount = _check_bignum(amount) + local from = system.getSender() + + contract.event("transfer", from, to, bignum.tostring(amount)) + + return _transfer(from, to, amount, ...) +end + +-- Define a new contract owner +function set_contract_owner(address) + assert(system.getSender() == _contract_owner:get(), "ARC1: permission denied") + _typecheck(address, "address") + _contract_owner:set(address) +end + +-- Returns a JSON string containing the list of ARC1 extensions +-- that were included on the contract +function arc1_extensions() + local list = {} + for name,_ in pairs(extensions) do + table.insert(list, name) + end + return list +end + +-- register exported functions +abi.register(transfer, set_contract_owner) +abi.register_view(arc1_extensions) +]] + +arc1_burnable = [[ +------------------------------------------------------------------------------ +-- Aergo Standard Token Interface (Proposal) - 20211028 +-- Burnable +------------------------------------------------------------------------------ + +extensions["burnable"] = true + +-- Burn tokens from the caller account +-- @type call +-- @param amount (ubig) amount of tokens to burn +-- @event burn(account, amount) +function burn(amount) + amount = _check_bignum(amount) + + local sender = system.getSender() + + _burn(sender, amount) + + contract.event("burn", sender, bignum.tostring(amount)) +end + +-- register the exported functions +abi.register(burn) +]] + +arc1_mintable = [[ +------------------------------------------------------------------------------ +-- Aergo Standard Token Interface (Proposal) - 20211028 +-- Mintable +------------------------------------------------------------------------------ + +extensions["mintable"] = true + +state.var { + _minter = state.map(), -- address -> boolean + _max_supply = state.value() -- unsigned_bignum +} + +-- Set the Maximum Supply of tokens +-- @type internal +-- @param amount (ubig) amount of mintable tokens +local function _setMaxSupply(amount) + _typecheck(amount, 'ubig') + _max_supply:set(amount) +end + +-- Indicate if an account is a minter +-- @type query +-- @param account (address) +-- @return (bool) true/false +function isMinter(account) + _typecheck(account, 'address') + return (account == _contract_owner:get()) or (_minter[account] == true) +end + +-- Add an account to minters +-- @type call +-- @param account (address) +-- @event addMinter(account) +function addMinter(account) + _typecheck(account, 'address') + + assert(system.getSender() == _contract_owner:get(), "ARC1: only the contract owner can add a minter") + + _minter[account] = true + + contract.event("addMinter", account) +end + +-- Remove an account from minters +-- @type call +-- @param account (address) +-- @event removeMinter(account) +function removeMinter(account) + _typecheck(account, 'address') + + local contract_owner = _contract_owner:get() + assert(system.getSender() == contract_owner, "ARC1: only the contract owner can remove a minter") + assert(account ~= contract_owner, "ARC1: the contract owner is always a minter") + assert(isMinter(account), "ARC1: not a minter") + + _minter:delete(account) + + contract.event("removeMinter", account) +end + +-- Renounce the Minter Role +-- @type call +-- @event removeMinter(account) +function renounceMinter() + local sender = system.getSender() + assert(sender ~= _contract_owner:get(), "ARC1: contract owner can't renounce minter role") + assert(isMinter(sender), "ARC1: only minter can renounce minter role") + + _minter:delete(sender) + + contract.event("removeMinter", sender) +end + +-- Mint new tokens at an account +-- @type call +-- @param account (address) recipient's address +-- @param amount (ubig) amount of tokens to mint +-- @param ... additional data, is sent unaltered in call to 'tokensReceived' on 'to' +-- @return value returned from 'tokensReceived' callback, or nil +-- @event mint(account, amount) +function mint(account, amount, ...) + _typecheck(account, 'address') + amount = _check_bignum(amount) + + assert(isMinter(system.getSender()), "ARC1: only minter can mint") + assert(not _max_supply:get() or (_totalSupply:get()+amount) <= _max_supply:get(), "ARC1: totalSupply is over MaxSupply") + + contract.event("mint", account, bignum.tostring(amount)) + + return _mint(account, amount, ...) +end + +-- Return the Max Supply +-- @type query +-- @return amount (ubig) amount of tokens to mint +function maxSupply() + return _max_supply:get() or bignum.number(0) +end + +-- register the exported functions +abi.register(mint, addMinter, removeMinter, renounceMinter) +abi.register_view(isMinter, maxSupply) +]] + +arc1_pausable = [[ +------------------------------------------------------------------------------ +-- Aergo Standard Token Interface (Proposal) - 20211028 +-- Pausable +------------------------------------------------------------------------------ + +extensions["pausable"] = true + +state.var { + _pauser = state.map() -- address -> boolean +} + +-- Indicate whether an account has the pauser role +-- @type query +-- @param account (address) +-- @return (bool) true/false +function isPauser(account) + _typecheck(account, 'address') + return (account == _contract_owner:get()) or (_pauser[account] == true) +end + +-- Grant the pauser role to an account +-- @type call +-- @param account (address) +-- @event addPauser(account) +function addPauser(account) + _typecheck(account, 'address') + + assert(system.getSender() == _contract_owner:get(), "ARC1: only contract owner can grant pauser role") + + _pauser[account] = true + + contract.event("addPauser", account) +end + +-- Removes the pauser role from an account +-- @type call +-- @param account (address) +-- @event removePauser(account) +function removePauser(account) + _typecheck(account, 'address') + + assert(system.getSender() == _contract_owner:get(), "ARC1: only owner can remove pauser role") + assert(_pauser[account] == true, "ARC1: account does not have pauser role") + + _pauser[account] = nil + + contract.event("removePauser", account) +end + +-- Renounce the granted pauser role +-- @type call +-- @event removePauser(account) +function renouncePauser() + local sender = system.getSender() + assert(sender ~= _contract_owner:get(), "ARC1: owner can't renounce pauser role") + assert(_pauser[sender] == true, "ARC1: account does not have pauser role") + + _pauser[sender] = nil + + contract.event("removePauser", sender) +end + +-- Indicate if the contract is paused +-- @type query +-- @return (bool) true/false +function paused() + return _paused:get() +end + +-- Put the contract in a paused state +-- @type call +-- @event pause(caller) +function pause() + local sender = system.getSender() + assert(not _paused:get(), "ARC1: contract is paused") + assert(isPauser(sender), "ARC1: only pauser can pause") + + _paused:set(true) + + contract.event("pause", sender) +end + +-- Return the contract to the normal state +-- @type call +-- @event unpause(caller) +function unpause() + local sender = system.getSender() + assert(_paused:get(), "ARC1: contract is unpaused") + assert(isPauser(sender), "ARC1: only pauser can unpause") + + _paused:set(false) + + contract.event("unpause", sender) +end + +-- register the exported functions +abi.register(pause, unpause, removePauser, renouncePauser, addPauser) +abi.register_view(paused, isPauser) +]] + +arc1_blacklist = [[ +------------------------------------------------------------------------------ +-- Aergo Standard Token Interface (Proposal) - 20211028 +-- Blacklist +------------------------------------------------------------------------------ + +extensions["blacklist"] = true + +-- Add accounts to the blacklist +-- @type call +-- @param account_list (list of address) +-- @event addToBlacklist(account_list) +function addToBlacklist(account_list) + assert(system.getSender() == _contract_owner:get(), "ARC1: only owner can blacklist accounts") + + for i = 1, #account_list do + _typecheck(account_list[i], 'address') + _blacklist[account_list[i] ] = true + end + + contract.event("addToBlacklist", account_list) +end + +-- Removes accounts from the blacklist +-- @type call +-- @param account_list (list of address) +-- @event removeFromBlacklist(account_list) +function removeFromBlacklist(account_list) + assert(system.getSender() == _contract_owner:get(), "ARC1: only owner can blacklist anothers") + + for i = 1, #account_list do + _typecheck(account_list[i], 'address') + _blacklist[account_list[i] ] = nil + end + + contract.event("removeFromBlacklist", account_list) +end + +-- Return true when an account is on the blacklist +-- @type query +-- @param account (address) +function isOnBlacklist(account) + _typecheck(account, 'address') + return _blacklist[account] == true +end + +-- register the exported functions +abi.register(addToBlacklist, removeFromBlacklist) +abi.register_view(isOnBlacklist) +]] + +arc1_all_approval = [[ +------------------------------------------------------------------------------ +-- Aergo Standard Token Interface (Proposal) - 20211028 +-- All approval +------------------------------------------------------------------------------ + +extensions["all_approval"] = true + +state.var { + _operators = state.map(), -- address/address -> boolean +} + +-- Indicate the allowance from an account to another +-- @type query +-- @param owner (address) owner's address +-- @param operator (address) allowed address +-- @return (bool) true/false +function isApprovedForAll(owner, operator) + return _operators[owner .. "/" .. operator] == true +end + +-- Allow an account to use all caller's tokens +-- @type call +-- @param operator (address) operator's address +-- @param approved (boolean) true/false +-- @event setApprovalForAll(caller, operator, approved) +function setApprovalForAll(operator, approved) + _typecheck(operator, 'address') + _typecheck(approved, 'boolean') + + local sender = system.getSender() + + assert(sender ~= operator, "ARC1: cannot approve self as operator") + + if approved then + _operators[sender .. "/" .. operator] = true + else + _operators[sender .. "/" .. operator] = nil + end + + contract.event("setApprovalForAll", sender, operator, approved) +end + +-- Transfer tokens from an account to another, the caller must be an approved operator +-- @type call +-- @param from (address) sender's address +-- @param to (address) recipient's address +-- @param amount (ubig) amount of tokens to send +-- @param ... additional data, is sent unaltered in call to 'tokensReceived' on 'to' +-- @return value returned from 'tokensReceived' callback, or nil +-- @event transfer(from, to, amount, operator) +function transferFrom(from, to, amount, ...) + _typecheck(from, 'address') + _typecheck(to, 'address') + amount = _check_bignum(amount) + + local operator = system.getSender() + + assert(operator ~= from, "ARC1: use the transfer function") + assert(isApprovedForAll(from, operator), "ARC1: caller is not approved by holder") + + contract.event("transfer", from, to, bignum.tostring(amount), operator) + + return _transfer(from, to, amount, ...) +end + +-- register the exported functions +abi.register(setApprovalForAll, transferFrom) +abi.register_view(isApprovedForAll) + + +if extensions["burnable"] == true then + +-- Burn tokens from an account, the caller must be an approved operator +-- @type call +-- @param from (address) sender's address +-- @param amount (ubig) amount of tokens to send +-- @event burn(from, amount, operator) +function burnFrom(from, amount) + _typecheck(from, 'address') + amount = _check_bignum(amount) + + assert(extensions["burnable"], "ARC1: burnable extension not available") + + local operator = system.getSender() + + assert(operator ~= from, "ARC1: use the burn function") + assert(isApprovedForAll(from, operator), "ARC1: caller not approved by holder") + + contract.event("burn", from, bignum.tostring(amount), operator) + + _burn(from, amount) +end + +abi.register(burnFrom) + +end +]] + +arc1_limited_approval = [[ +------------------------------------------------------------------------------ +-- Aergo Standard Token Interface (Proposal) - 20211028 +-- Allowed approval +------------------------------------------------------------------------------ + +extensions["limited_approval"] = true + +state.var { + _allowance = state.map(), -- address/address -> unsigned_bignum +} + +-- Approve an account to spend the specified amount of caller's tokens +-- @type call +-- @param operator (address) operator's address +-- @param amount (ubig) amount of allowed tokens +-- @event approve(caller, operator, amount) +function approve(operator, amount) + _typecheck(operator, 'address') + amount = _check_bignum(amount) + + local owner = system.getSender() + + assert(owner ~= operator, "ARC1: cannot approve self as operator") + + _allowance[owner .. "/" .. operator] = amount + + contract.event("approve", owner, operator, bignum.tostring(amount)) +end + +-- Increase the amount of tokens allowed to an operator +-- @type call +-- @param operator (address) operator's address +-- @param amount (ubig) amount to increase +-- @event increaseAllowance(caller, operator, amount) +function increaseAllowance(operator, amount) + _typecheck(operator, 'address') + amount = _check_bignum(amount) + + local owner = system.getSender() + local pair = owner .. "/" .. operator + + assert(_allowance[pair], "ARC1: not approved") + + _allowance[pair] = _allowance[pair] + amount + + contract.event("increaseAllowance", owner, operator, bignum.tostring(amount)) +end + +-- Decrease the amount of tokens allowed to an operator +-- @type call +-- @param operator (address) operator's address +-- @param amount (ubig) amount of allowance to decrease +-- @event decreaseAllowance(caller, operator, amount) +function decreaseAllowance(operator, amount) + _typecheck(operator, 'address') + amount = _check_bignum(amount) + + local owner = system.getSender() + local pair = owner .. "/" .. operator + + assert(_allowance[pair], "ARC1: not approved") + + if _allowance[pair] < amount then + _allowance[pair] = 0 + else + _allowance[pair] = _allowance[pair] - amount + end + + contract.event("decreaseAllowance", owner, operator, bignum.tostring(amount)) +end + +-- Get amount of remaining tokens that an account allowed to another +-- @type query +-- @param owner (address) owner's address +-- @param operator (address) operator's address +-- @return (number) amount of remaining tokens +function allowance(owner, operator) + _typecheck(owner, 'address') + _typecheck(operator, 'address') + + return _allowance[owner .."/".. operator] or bignum.number(0) +end + +-- Transfer tokens from an account to another using the allowance mechanism +-- @type call +-- @param from (address) sender's address +-- @param to (address) recipient's address +-- @param amount (ubig) amount of tokens to send +-- @param ... additional data, is sent unaltered in call to 'tokensReceived' on 'to' +-- @return value returned from 'tokensReceived' callback, or nil +-- @event transfer(from, to, amount, operator) +function limitedTransferFrom(from, to, amount, ...) + _typecheck(from, 'address') + _typecheck(to, 'address') + amount = _check_bignum(amount) + + local operator = system.getSender() + + assert(operator ~= from, "ARC1: use the transfer function") + + local pair = from .. "/" .. operator + + assert(_allowance[pair], "ARC1: not approved") + assert(_allowance[pair] >= amount, "ARC1: insufficient allowance") + + _allowance[pair] = _allowance[pair] - amount + + contract.event("transfer", from, to, bignum.tostring(amount), operator) + + return _transfer(from, to, amount, ...) +end + +-- register the exported functions +abi.register(approve, increaseAllowance, decreaseAllowance, limitedTransferFrom) +abi.register_view(allowance) + + +if extensions["burnable"] == true then + +-- Burn tokens from an account using the allowance mechanism +-- @type call +-- @param from (address) sender's address +-- @param amount (ubig) amount of tokens to burn +-- @event burn(from, amount, operator) +function limitedBurnFrom(from, amount) + _typecheck(from, 'address') + amount = _check_bignum(amount) + + assert(extensions["burnable"], "ARC1: burnable extension not available") + + local operator = system.getSender() + + assert(operator ~= from, "ARC1: use the burn function") + + local pair = from .. "/" .. operator + + assert(_allowance[pair], "ARC1: caller not approved by holder") + assert(_allowance[pair] >= amount, "ARC1: insufficient allowance") + + _allowance[pair] = _allowance[pair] - amount + + contract.event("burn", from, bignum.tostring(amount), operator) + + _burn(from, amount) +end + +abi.register(limitedBurnFrom) + +end +]] + +arc1_constructor = [[ +function constructor(name, symbol, decimals, initial_supply, max_supply, owner) + _init(name, symbol, decimals, owner) + local decimal_str = "1" .. string.rep("0", decimals) + if initial_supply > bignum.number(0) then + _mint(owner, initial_supply * bignum.number(decimal_str)) + end + if max_supply then + _setMaxSupply(max_supply * bignum.number(decimal_str)) + end +end +]] + +function new_token(name, symbol, decimals, initial_supply, options, owner) + + if options == nil or options == '' then + options = {} + end + + if owner == nil or owner == '' then + owner = system.getSender() + end + + local contract_code = arc1_core + + if options["burnable"] then + contract_code = contract_code .. arc1_burnable + end + if options["mintable"] then + contract_code = contract_code .. arc1_mintable + end + if options["pausable"] then + contract_code = contract_code .. arc1_pausable + end + if options["blacklist"] then + contract_code = contract_code .. arc1_blacklist + end + if options["all_approval"] then + contract_code = contract_code .. arc1_all_approval + end + if options["limited_approval"] then + contract_code = contract_code .. arc1_limited_approval + end + + contract_code = contract_code .. arc1_constructor + + if not bignum.isbignum(initial_supply) then + initial_supply = bignum.number(initial_supply) + end + assert(initial_supply >= bignum.number(0), "invalid initial supply") + local max_supply = options["max_supply"] + if max_supply then + assert(options["mintable"], "max_supply is only available with the mintable extension") + max_supply = bignum.number(max_supply) + assert(max_supply >= initial_supply, "invalid max supply") + end + + local address = contract.deploy(contract_code, name, symbol, decimals, initial_supply, max_supply, owner) + + contract.event("new_arc1_token", address) + + return address +end + +abi.register(new_token) diff --git a/contract/vm_dummy/test_files/arc2-factory.lua b/contract/vm_dummy/test_files/arc2-factory.lua new file mode 100644 index 000000000..58de829d9 --- /dev/null +++ b/contract/vm_dummy/test_files/arc2-factory.lua @@ -0,0 +1,1203 @@ +arc2_core = [[ +------------------------------------------------------------------------------ +-- Aergo Standard NFT Interface (Proposal) - 20210425 +------------------------------------------------------------------------------ + +extensions = {} + +address0 = '1111111111111111111111111111111111111111111111111111' + +-- A internal type check function +-- @type internal +-- @param x variable to check +-- @param t (string) expected type +local function _typecheck(x, t) + if (x and t == 'address') then + assert(type(x) == 'string', "address must be string type") + -- check address length + assert(52 == #x, string.format("invalid address length: %s (%s)", x, #x)) + -- check address checksum + if x ~= address0 then + local success = pcall(system.isContract, x) + assert(success, "invalid address: " .. x) + end + elseif (x and t == 'str128') then + assert(type(x) == 'string', "str128 must be string type") + -- check address length + assert(#x <= 128, string.format("too long str128 length: %s", #x)) + elseif (x and t == 'uint') then + -- check unsigned integer + assert(type(x) == 'number', string.format("invalid type: %s != number", type(x))) + assert(math.floor(x) == x, "the number must be an integer") + assert(x >= 0, "the number must be 0 or positive") + else + -- check default lua types + assert(type(x) == t, string.format("invalid type: %s != %s", type(x), t or 'nil')) + end +end + + +state.var { + _contract_owner = state.value(), -- string + + _name = state.value(), -- string + _symbol = state.value(), -- string + + _num_burned = state.value(), -- integer + _last_index = state.value(), -- integer + _ids = state.map(), -- integer -> str128 + _tokens = state.map(), -- str128 -> { index: integer, owner: address, approved: address } + _user_tokens = state.map(), -- address -> array of integers (index to tokenId) + + -- Pausable + _paused = state.value(), -- boolean + + -- Blacklist + _blacklist = state.map() -- address -> boolean +} + + +-- call this at constructor +local function _init(name, symbol, owner) + _typecheck(name, 'string') + _typecheck(symbol, 'string') + + if owner == nil or owner == '' then + owner = system.getCreator() + elseif owner == 'none' then + owner = nil + else + _typecheck(owner, "address") + end + _contract_owner:set(owner) + + _name:set(name) + _symbol:set(symbol) + + _last_index:set(0) + _num_burned:set(0) + + _paused:set(false) +end + +local function _callReceiverCallback(from, to, tokenId, ...) + if to ~= address0 and system.isContract(to) then + return contract.call(to, "nonFungibleReceived", system.getSender(), from, tokenId, ...) + else + return nil + end +end + +local function _exists(tokenId) + return _tokens[tokenId] ~= nil +end + +-- Get the token name +-- @type query +-- @return (string) name of this token +function name() + return _name:get() +end + +-- Get the token symbol +-- @type query +-- @return (string) symbol of this token +function symbol() + return _symbol:get() +end + +-- Count of all NFTs +-- @type query +-- @return (integer) the number of non-fungible tokens on this contract +function totalSupply() + return _last_index:get() - _num_burned:get() +end + +-- Count of all NFTs assigned to an owner +-- @type query +-- @param owner (address) a target address +-- @return (integer) the number of non-fungible tokens of owner +function balanceOf(owner) + local list = _user_tokens[owner] or {} + return #list +end + +-- Find the owner of an NFT +-- @type query +-- @param tokenId (str128) the non-fungible token id +-- @return (address) the address of the owner, or nil if the token does not exist +function ownerOf(tokenId) + local token = _tokens[tokenId] + if token == nil then + return nil + else + return token["owner"] + end +end + + +local function add_to_owner(index, owner) + local list = _user_tokens[owner] or {} + table.insert(list, index) + _user_tokens[owner] = list +end + +local function remove_from_owner(index, owner) + local list = _user_tokens[owner] or {} + for position,value in ipairs(list) do + if value == index then + table.remove(list, position) + break + end + end + if #list > 0 then + _user_tokens[owner] = list + else + _user_tokens:delete(owner) + end +end + + +local function _mint(to, tokenId, metadata, ...) + _typecheck(to, 'address') + _typecheck(tokenId, 'str128') + + assert(not _paused:get(), "ARC2: paused contract") + assert(not _blacklist[to], "ARC2: recipient is on blacklist") + + assert(not _exists(tokenId), "ARC2: mint - already minted token") + assert(metadata==nil or type(metadata)=="table", "ARC2: invalid metadata") + + local index = _last_index:get() + 1 + _last_index:set(index) + _ids[tostring(index)] = tokenId + + local token = { + index = index, + owner = to + } + if metadata ~= nil then + assert(extensions["metadata"], "ARC2: this token has no support for metadata") + for key,value in pairs(metadata) do + assert(not is_reserved_metadata(key), "ARC2: reserved metadata") + token[key] = value + end + end + _tokens[tokenId] = token + + add_to_owner(index, to) + + contract.event("mint", to, tokenId) + + return _callReceiverCallback(nil, to, tokenId, ...) +end + + +local function _burn(tokenId) + _typecheck(tokenId, 'str128') + + local token = _tokens[tokenId] + assert(token ~= nil, "ARC2: burn: token not found") + local index = token["index"] + local owner = token["owner"] + + assert(not _paused:get(), "ARC2: paused contract") + assert(not _blacklist[owner], "ARC2: owner is on blacklist") + + _ids:delete(tostring(index)) + + _tokens:delete(tokenId) + + remove_from_owner(index, owner) + + _num_burned:set(_num_burned:get() + 1) + + contract.event("burn", owner, tokenId) +end + + +local function _transfer(from, to, tokenId, ...) + assert(not _paused:get(), "ARC2: paused contract") + assert(not _blacklist[from], "ARC2: sender is on blacklist") + assert(not _blacklist[to], "ARC2: recipient is on blacklist") + + local token = _tokens[tokenId] + token["owner"] = to + token["approved"] = nil -- clear approval + _tokens[tokenId] = token + + local index = token["index"] + remove_from_owner(index, from) + add_to_owner(index, to) + + return _callReceiverCallback(from, to, tokenId, ...) +end + + +-- Transfer a token +-- @type call +-- @param to (address) the receiver address +-- @param tokenId (str128) the NFT token to send +-- @param ... (Optional) additional data, is sent unaltered in a call to 'nonFungibleReceived' on 'to' +-- @return value returned from the 'nonFungibleReceived' callback, or nil +-- @event transfer(from, to, tokenId) +function transfer(to, tokenId, ...) + _typecheck(to, 'address') + _typecheck(tokenId, 'str128') + + local token = _tokens[tokenId] + assert(token ~= nil, "ARC2: transfer - nonexisting token") + + assert(extensions["non_transferable"] == nil and + token["non_transferable"] == nil, "ARC2: this token is non-transferable") + + local sender = system.getSender() + local owner = token["owner"] + assert(sender == owner, "ARC2: transfer of token that is not own") + + contract.event("transfer", sender, to, tokenId) + + return _transfer(sender, to, tokenId, ...) +end + +-- Transfer a non-fungible token of 'from' to 'to' +-- @type call +-- @param from (address) the owner address +-- @param to (address) the receiver address +-- @param tokenId (str128) the non-fungible token to send +-- @param ... (Optional) additional data, is sent unaltered in a call to 'nonFungibleReceived' on 'to' +-- @return value returned from the 'nonFungibleReceived' callback, or nil +-- @event transfer(from, to, tokenId, operator) +function transferFrom(from, to, tokenId, ...) + _typecheck(from, 'address') + _typecheck(to, 'address') + _typecheck(tokenId, 'str128') + + local token = _tokens[tokenId] + assert(token ~= nil, "ARC2: transferFrom - nonexisting token") + + local owner = token["owner"] + assert(from == owner, "ARC2: transferFrom - token is not from account") + + local operator = system.getSender() + + -- if recallable, the creator/issuer can transfer the token + if extensions["mintable"] then + operator_can_recall = isMinter(operator) + else + operator_can_recall = (operator == _contract_owner:get()) + end + local is_recall = (extensions["recallable"] or token["recallable"]) and operator_can_recall + + if not is_recall then + assert(extensions["approval"], "ARC2: approval extension not included") + -- check allowance + assert(operator == token["approved"] or isApprovedForAll(owner, operator), + "ARC2: transferFrom - caller is not approved") + -- check if it is a non-transferable token + assert(extensions["non_transferable"] == nil and + token["non_transferable"] == nil, "ARC2: this token is non-transferable") + end + + contract.event("transfer", from, to, tokenId, operator) + + return _transfer(from, to, tokenId, ...) +end + + +-- Token Enumeration Functions -- + + +-- Retrieves the next token in the contract +-- @type query +-- @param prev_index (integer) the index of the previous returned token. use `0` in the first call +-- @return (index, tokenId) the index of the next token and its token id, or `nil,nil` if no more tokens +function nextToken(prev_index) + _typecheck(prev_index, 'uint') + + local index = prev_index + local last_index = _last_index:get() + local tokenId + + while tokenId == nil and index < last_index do + index = index + 1 + tokenId = _ids[tostring(index)] + end + + if tokenId == nil then + index = nil + end + + return index, tokenId +end + +-- Retrieves the token from the given user at the given position +-- @type query +-- @param user (address) .. +-- @param position (integer) the position of the token in the incremental sequence +-- @return tokenId (str128) the token id, or `nil` if no more tokens on this account +function tokenFromUser(user, position) + _typecheck(user, 'address') + _typecheck(position, 'uint') + + local list = _user_tokens[user] or {} + local index = list[position] + local tokenId = _ids[tostring(index)] + return tokenId +end + + +function set_contract_owner(address) + assert(system.getSender() == _contract_owner:get(), "ARC2: permission denied") + _typecheck(address, "address") + _contract_owner:set(address) +end + + +-- Returns a JSON string containing the list of ARC2 extensions +-- that were included on the contract. +-- @type query +function arc2_extensions() + local list = {} + for name,_ in pairs(extensions) do + table.insert(list, name) + end + return list +end + + +abi.register(transfer, transferFrom, set_contract_owner) +abi.register_view(name, symbol, balanceOf, ownerOf, totalSupply, nextToken, tokenFromUser, arc2_extensions) +]] + +arc2_burnable = [[ +------------------------------------------------------------------------------ +-- Aergo Standard NFT Interface (Proposal) - 20210425 +------------------------------------------------------------------------------ + +extensions["burnable"] = true + +-- Burn a non-fungible token +-- @type call +-- @param tokenId (str128) the identifier of the token to be burned +-- @event burn(owner, tokenId) +function burn(tokenId) + _typecheck(tokenId, 'str128') + + local owner = ownerOf(tokenId) + assert(owner ~= nil, "ARC2: burn - nonexisting token") + assert(system.getSender() == owner, "ARC2: cannot burn a token that is not own") + + _burn(tokenId) +end + +abi.register(burn) +]] + +arc2_mintable = [[ +------------------------------------------------------------------------------ +-- Aergo Standard NFT Interface (Proposal) - 20210425 +------------------------------------------------------------------------------ + +extensions["mintable"] = true + +state.var { + _minter = state.map(), -- address -> boolean + _max_supply = state.value() -- integer +} + +-- set Max Supply +-- @type internal +-- @param amount (integer) amount of mintable tokens + +local function _setMaxSupply(amount) + _typecheck(amount, 'uint') + _max_supply:set(amount) +end + +-- Indicate if an account is a minter +-- @type query +-- @param account (address) +-- @return (bool) true/false + +function isMinter(account) + _typecheck(account, 'address') + + return (account == _contract_owner:get()) or (_minter[account] == true) +end + +-- Add an account to the minters group +-- @type call +-- @param account (address) +-- @event addMinter(account) + +function addMinter(account) + _typecheck(account, 'address') + + local creator = _contract_owner:get() + assert(system.getSender() == creator, "ARC2: only the contract owner can add a minter") + assert(account ~= creator, "ARC2: the contract owner is always a minter") + + _minter[account] = true + + contract.event("addMinter", account) +end + +-- Remove an account from the minters group +-- @type call +-- @param account (address) +-- @event removeMinter(account) + +function removeMinter(account) + _typecheck(account, 'address') + + local creator = _contract_owner:get() + assert(system.getSender() == creator, "ARC2: only the contract owner can remove a minter") + assert(account ~= creator, "ARC2: the contract owner is always a minter") + assert(isMinter(account), "ARC2: not a minter") + + _minter:delete(account) + + contract.event("removeMinter", account) +end + +-- Renounce the minter role +-- @type call +-- @event removeMinter(account) + +function renounceMinter() + local sender = system.getSender() + assert(sender ~= _contract_owner:get(), "ARC2: contract owner can't renounce minter role") + assert(isMinter(sender), "ARC2: only minter can renounce minter role") + + _minter:delete(sender) + + contract.event("removeMinter", sender) +end + +-- Mint a new non-fungible token +-- @type call +-- @param to (address) recipient's address +-- @param tokenId (str128) the non-fungible token id +-- @param metadata (table) lua table containing key-value pairs +-- @param ... additional data, is sent unaltered in a call to 'nonFungibleReceived' on 'to' +-- @return value returned from the 'nonFungibleReceived' callback, or nil +-- @event mint(to, tokenId) + +function mint(to, tokenId, metadata, ...) + assert(isMinter(system.getSender()), "ARC2: only minter can mint") + local max_supply = _max_supply:get() + assert(not max_supply or (totalSupply() + 1) <= max_supply, "ARC2: TotalSupply is over MaxSupply") + + return _mint(to, tokenId, metadata, ...) +end + +-- Retrieve the Max Supply +-- @type query +-- @return amount (integer) the maximum amount of tokens that can be active on the contract + +function maxSupply() + return _max_supply:get() or 0 +end + +abi.register(mint, addMinter, removeMinter, renounceMinter) +abi.register_view(isMinter, maxSupply) +]] + +arc2_metadata = [[ +------------------------------------------------------------------------------ +-- Aergo Standard NFT Interface (Proposal) - 20210425 +------------------------------------------------------------------------------ + +extensions["metadata"] = true + +state.var { + _immutable_metadata = state.value(), + _incremental_metadata = state.value(), + _contract_metadata = state.value() +} + +reserved_metadata = { "index", "owner", "approved" } + +function is_reserved_metadata(name) + for _,reserved in ipairs(reserved_metadata) do + if name == reserved then + return true + end + end + return false +end + +local function check_metadata_update(name, prev_value, new_value) + + assert(not is_reserved_metadata(name), "ARC2: reserved metadata") + + local immutable = _immutable_metadata:get() or {} + local incremental = _incremental_metadata:get() or {} + + for _,value in ipairs(immutable) do + if value == name then + assert(false, "ARC2: immutable metadata") + end + end + for _,value in ipairs(incremental) do + if value == name then + assert(new_value ~= nil and type(new_value) == type(prev_value) and + new_value >= prev_value, "ARC2: incremental metadata") + break + end + end + +end + +--- Exported Functions --------------------------------------------------------- + +-- Store non-fungible token metadata +-- @type call +-- @param tokenId (str128) the non-fungible token id, or nil for contract metadata +-- @param metadata (table) lua table containing key-value pairs +function set_metadata(tokenId, metadata) + + if extensions["mintable"] then + assert(isMinter(system.getSender()), "ARC2: permission denied") + else + assert(system.getSender() == _contract_owner:get(), "ARC2: permission denied") + end + assert(not _paused:get(), "ARC2: paused contract") + + if tokenId == nil then + local contract_metadata = _contract_metadata:get() or {} + for key,value in pairs(metadata) do + contract_metadata[key] = value + end + _contract_metadata:set(contract_metadata) + return + end + + _typecheck(tokenId, 'str128') + + local token = _tokens[tokenId] + assert(token ~= nil, "ARC2: nonexisting token") + for key,value in pairs(metadata) do + check_metadata_update(key, token[key], value) + assert(key ~= "non_transferable" and key ~= "recallable", "ARC2: permission denied") + token[key] = value + end + _tokens[tokenId] = token +end + +-- Remove non-fungible token metadata +-- @type call +-- @param tokenId (str128) the non-fungible token id +-- @param list (table) lua table containing list of keys to remove +function remove_metadata(tokenId, list) + + if extensions["mintable"] then + assert(isMinter(system.getSender()), "ARC2: permission denied") + else + assert(system.getSender() == _contract_owner:get(), "ARC2: permission denied") + end + assert(not _paused:get(), "ARC2: paused contract") + + _typecheck(tokenId, 'str128') + + local token = _tokens[tokenId] + assert(token ~= nil, "ARC2: nonexisting token") + for _,key in ipairs(list) do + check_metadata_update(key, token[key], nil) + token[key] = nil + end + _tokens[tokenId] = token +end + +-- Retrieve non-fungible token metadata +-- @type query +-- @param tokenId (str128) the non-fungible token id, or nil for contract metadata +-- @param key (string) the metadata key +-- @return (string) if key is nil, return all metadata from token or contract, +-- otherwise return the value linked to the given key +function get_metadata(tokenId, key) + + if tokenId == nil then + local contract_metadata = _contract_metadata:get() or {} + if key ~= nil then + return contract_metadata[key] + end + return contract_metadata + end + + _typecheck(tokenId, 'str128') + + local token = _tokens[tokenId] + assert(token ~= nil, "ARC2: nonexisting token") + + -- token["index"] = nil + -- token["owner"] = nil + -- token["approved"] = nil + + if key == nil then + return token + end + + return token[key] +end + +-- Mark a specific metadata key as immutable. This means that once this metadata +-- is set on a token, it can no longer be modified. And once this property is set +-- on a metadata, it cannot be removed. It gives the guarantee to the owner that +-- the creator/issuer will not modify or remove this specific metadata. +-- @type call +-- @param key (string) the metadata key +function make_metadata_immutable(key) + _typecheck(key, 'string') + assert(#key > 0, "ARC2: invalid key") + assert(not is_reserved_metadata(key), "ARC2: reserved metadata") + assert(system.getSender() == _contract_owner:get(), "ARC2: permission denied") + assert(not _paused:get(), "ARC2: paused contract") + + local immutable = _immutable_metadata:get() or {} + + for _,value in ipairs(immutable) do + if value == key then return end + end + + table.insert(immutable, key) + _immutable_metadata:set(immutable) +end + +-- Mark a specific metadata key as incremental. This means that once this metadata +-- is set on a token, it can only be incremented. Useful for expiration time. +-- Once this property is set on a metadata, it cannot be removed. It gives the +-- guarantee to the owner that the creator/issuer can only increment this value. +-- @type call +-- @param key (string) the metadata key +function make_metadata_incremental(key) + _typecheck(key, 'string') + assert(#key > 0, "ARC2: invalid key") + assert(not is_reserved_metadata(key), "ARC2: reserved metadata") + assert(system.getSender() == _contract_owner:get(), "ARC2: permission denied") + assert(not _paused:get(), "ARC2: paused contract") + + local incremental = _incremental_metadata:get() or {} + + for _,value in ipairs(incremental) do + if value == key then return end + end + + table.insert(incremental, key) + _incremental_metadata:set(incremental) +end + +-- Retrieve the list of immutable and incremental metadata +-- @type query +-- @return (string) a JSON object with each metadata as key and the property +-- as value. Example: {"expiration": "incremental", "index": "immutable"} +function get_metadata_info() + local immutable = _immutable_metadata:get() or {} + local incremental = _incremental_metadata:get() or {} + + local list = {} + + list["index"] = "immutable" + + for _,value in ipairs(immutable) do + list[value] = "immutable" + end + for _,value in ipairs(incremental) do + list[value] = "incremental" + end + + return list +end + + +abi.register_view(get_metadata, get_metadata_info) +abi.register(set_metadata, remove_metadata, make_metadata_immutable, make_metadata_incremental) +]] + +arc2_pausable = [[ +------------------------------------------------------------------------------ +-- Aergo Standard Token Interface (Proposal) - 20211028 +-- Pausable +------------------------------------------------------------------------------ + +extensions["pausable"] = true + +state.var { + _pauser = state.map() -- address -> boolean +} + +-- Indicate whether an account has the pauser role +-- @type query +-- @param account (address) +-- @return (bool) true/false + +function isPauser(account) + _typecheck(account, 'address') + + return (account == _contract_owner:get()) or (_pauser[account] == true) +end + +-- Grant the pauser role to an account +-- @type call +-- @param account (address) +-- @event addPauser(account) + +function addPauser(account) + _typecheck(account, 'address') + + assert(system.getSender() == _contract_owner:get(), "ARC2: only contract owner can grant pauser role") + + _pauser[account] = true + + contract.event("addPauser", account) +end + +-- Removes the pauser role from an account +-- @type call +-- @param account (address) +-- @event removePauser(account) + +function removePauser(account) + _typecheck(account, 'address') + + assert(system.getSender() == _contract_owner:get(), "ARC2: only owner can remove pauser role") + assert(_pauser[account] == true, "ARC2: account does not have pauser role") + + _pauser[account] = nil + + contract.event("removePauser", account) +end + +-- Renounce the granted pauser role +-- @type call +-- @event removePauser(account) + +function renouncePauser() + local sender = system.getSender() + assert(sender ~= _contract_owner:get(), "ARC2: owner can't renounce pauser role") + assert(_pauser[sender] == true, "ARC2: account does not have pauser role") + + _pauser[sender] = nil + + contract.event("removePauser", sender) +end + +-- Indicate if the contract is paused +-- @type query +-- @return (bool) true/false + +function paused() + return (_paused:get() == true) +end + +-- Put the contract in a paused state +-- @type call +-- @event pause(caller) + +function pause() + local sender = system.getSender() + assert(not _paused:get(), "ARC2: contract is paused") + assert(isPauser(sender), "ARC2: only pauser can pause") + + _paused:set(true) + + contract.event("pause", sender) +end + +-- Return the contract to the normal state +-- @type call +-- @event unpause(caller) + +function unpause() + local sender = system.getSender() + assert(_paused:get(), "ARC2: contract is unpaused") + assert(isPauser(sender), "ARC2: only pauser can unpause") + + _paused:set(false) + + contract.event("unpause", sender) +end + + +abi.register(pause, unpause, removePauser, renouncePauser, addPauser) +abi.register_view(paused, isPauser) +]] + +arc2_blacklist = [[ +------------------------------------------------------------------------------ +-- Aergo Standard Token Interface (Proposal) - 20211028 +-- Blacklist +------------------------------------------------------------------------------ + +extensions["blacklist"] = true + +-- Add accounts to the blacklist +-- @type call +-- @param account_list (list of address) +-- @event addToBlacklist(account_list) + +function addToBlacklist(account_list) + assert(system.getSender() == _contract_owner:get(), "ARC2: only owner can blacklist accounts") + + for i = 1, #account_list do + _typecheck(account_list[i], 'address') + _blacklist[account_list[i] ] = true + end + + contract.event("addToBlacklist", account_list) +end + +-- Remove accounts from the blacklist +-- @type call +-- @param account_list (list of address) +-- @event removeFromBlacklist(account_list) + +function removeFromBlacklist(account_list) + assert(system.getSender() == _contract_owner:get(), "ARC2: only owner can blacklist accounts") + + for i = 1, #account_list do + _typecheck(account_list[i], 'address') + _blacklist[account_list[i] ] = nil + end + + contract.event("removeFromBlacklist", account_list) +end + +-- Indicate if an account is on the blacklist +-- @type query +-- @param account (address) +-- @return (bool) true/false + +function isOnBlacklist(account) + _typecheck(account, 'address') + + return _blacklist[account] == true +end + + +abi.register(addToBlacklist, removeFromBlacklist) +abi.register_view(isOnBlacklist) +]] + +arc2_approval = [[ +------------------------------------------------------------------------------ +-- Aergo Standard NFT Interface (Proposal) - 20210425 +------------------------------------------------------------------------------ + +extensions["approval"] = true + +state.var { + _operatorApprovals = state.map() -- address/address -> bool +} + +-- Approve an account to operate on the given non-fungible token. +-- Use `nil` on the operator to remove the approval +-- @type call +-- @param operator (address) the new approved NFT controller +-- @param tokenId (str128) the NFT token to be controlled +-- @event approve(owner, operator, tokenId) +function approve(operator, tokenId) + _typecheck(tokenId, 'str128') + if operator ~= nil then + _typecheck(operator, 'address') + end + + local token = _tokens[tokenId] + assert(token ~= nil, "ARC2: approve - nonexisting token") + local owner = token["owner"] + + assert(not _paused:get(), "ARC2: paused contract") + assert(not _blacklist[owner], "ARC2: owner is on blacklist") + if operator ~= nil then + assert(not _blacklist[operator], "ARC2: operator is on blacklist") + end + + assert(owner ~= operator, "ARC2: approve - to current owner") + local sender = system.getSender() + assert(sender == owner or isApprovedForAll(owner, sender), + "ARC2: approve - caller is not owner nor approved for all") + + token["approved"] = operator + _tokens[tokenId] = token + + contract.event("approve", owner, operator, tokenId) +end + +-- Get the approved operator address for a given non-fungible token +-- @type query +-- @param tokenId (str128) the NFT token to find the approved operator +-- @return (address) the approved operator address for this NFT, or nil if there is none +function getApproved(tokenId) + _typecheck(tokenId, 'str128') + local token = _tokens[tokenId] + assert(token ~= nil, "ARC2: getApproved - nonexisting token") + return token["approved"] +end + +-- Allow an operator to control all the sender's tokens +-- @type call +-- @param operator (address) the operator address +-- @param approved (boolean) true if the operator is approved, false to revoke approval +-- @event approvalForAll(owner, operator, approved) +function setApprovalForAll(operator, approved) + _typecheck(operator, 'address') + _typecheck(approved, 'boolean') + + local owner = system.getSender() + + assert(not _paused:get(), "ARC2: paused contract") + assert(not _blacklist[owner], "ARC2: owner is on blacklist") + if approved then + assert(not _blacklist[operator], "ARC2: operator is on blacklist") + end + + assert(operator ~= owner, "ARC2: setApprovalForAll - to caller") + + _operatorApprovals[owner .. '/' .. operator] = approved + + contract.event("approvalForAll", owner, operator, approved) +end + +-- Check if the given operator is approved to control the owner's tokens +-- @type query +-- @param owner (address) owner address +-- @param operator (address) operator address +-- @return (bool) true/false +function isApprovedForAll(owner, operator) + return _operatorApprovals[owner .. '/' .. operator] or false +end + + +abi.register(approve, setApprovalForAll) +abi.register_view(getApproved, isApprovedForAll) +]] + +arc2_searchable = [[ +------------------------------------------------------------------------------ +-- Aergo Standard NFT Interface (Proposal) - 20210425 +------------------------------------------------------------------------------ + +extensions["searchable"] = true + +local function escape(str) + return str:gsub("[%(%)%.%%%+%-%*%?%[%]%^%$]", function(c) return "%" .. c end) +end + +local function token_matches(tokenId, query) + + if tokenId == nil then + return false + end + + local token = _tokens[tokenId] + + local pattern = query["pattern"] + local metadata = query["metadata"] + + if pattern then + if not tokenId:match(pattern) then + return false + end + end + + if metadata then + for key,find in pairs(metadata) do + local op = find["op"] + local value = find["value"] + local neg = false + local matches = false + if string.sub(op,1,1) == "!" then + neg = true + op = string.sub(op, 2) + end + local token_value = token[key] + if token_value == nil and op ~= "=" then + -- does not match + elseif op == "=" then + matches = token_value == value + elseif op == ">" then + matches = token_value > value + elseif op == ">=" then + matches = token_value >= value + elseif op == "<" then + matches = token_value < value + elseif op == "<=" then + matches = token_value <= value + elseif op == "between" then + matches = (token_value >= value and token_value <= find["value2"]) + elseif op == "match" then + matches = string.match(token_value, value) ~= nil + else + assert(false, "operator not known: " .. op) + end + if neg then matches = not matches end + if not matches then return false end + end + end + + return true +end + +-- retrieve the first token found that mathes the query +-- the query is a table that can contain these fields: +-- owner - the owner of the token (address) +-- contains - check if the tokenId contains this string +-- pattern - check if the tokenId matches this Lua regex pattern +-- the prev_index must be 0 in the first call +-- for the next calls, just inform the returned index from the previous call +-- return value: (2 values) index, tokenId +-- if no token is found with the given query, it returns (nil, nil) +function findToken(query, prev_index) + _typecheck(query, 'table') + _typecheck(prev_index, 'uint') + + local contains = query["contains"] + if contains then + query["pattern"] = escape(contains) + end + + local index, tokenId + local owner = query["owner"] + + if owner then + -- iterate over the tokens from this user + local list = _user_tokens[owner] or {} + local check_tokens = (prev_index == 0) + + for position,index2 in ipairs(list) do + if check_tokens then + tokenId = _ids[tostring(index2)] + if token_matches(tokenId, query) then + index = index2 + break + else + tokenId = nil + end + elseif index2 == prev_index then + check_tokens = true + end + end + + else + -- iterate over all the tokens + local last_index = _last_index:get() + index = prev_index + + while tokenId == nil and index < last_index do + index = index + 1 + tokenId = _ids[tostring(index)] + if not token_matches(tokenId, query) then + tokenId = nil + end + end + end + + if tokenId == nil then + index = nil + end + + return index, tokenId +end + + +abi.register_view(findToken) +]] + +arc2_non_transferable = [[ +------------------------------------------------------------------------------ +-- Aergo Standard NFT Interface (Proposal) - 20210425 +------------------------------------------------------------------------------ + +extensions["non_transferable"] = true +]] + +arc2_recallable = [[ +------------------------------------------------------------------------------ +-- Aergo Standard NFT Interface (Proposal) - 20210425 +------------------------------------------------------------------------------ + +extensions["recallable"] = true +]] + +arc2_constructor = [[ +function constructor(name, symbol, initial_supply, max_supply, owner) + _init(name, symbol, owner) + if initial_supply then + for _,token in ipairs(initial_supply) do + _mint(owner, token[1], token[2]) + end + end + if max_supply then + _setMaxSupply(max_supply) + end +end +]] + +function new_arc2_nft(name, symbol, initial_supply, options, owner) + + if options == nil or options == '' then + options = {} + end + + if owner == nil or owner == '' then + owner = system.getSender() + end + + local contract_code = arc2_core + + if options["burnable"] then + contract_code = contract_code .. arc2_burnable + end + if options["mintable"] then + contract_code = contract_code .. arc2_mintable + end + if options["metadata"] then + contract_code = contract_code .. arc2_metadata + end + if options["pausable"] then + contract_code = contract_code .. arc2_pausable + end + if options["blacklist"] then + contract_code = contract_code .. arc2_blacklist + end + if options["approval"] then + contract_code = contract_code .. arc2_approval + end + if options["searchable"] then + contract_code = contract_code .. arc2_searchable + end + if options["non_transferable"] then + contract_code = contract_code .. arc2_non_transferable + end + if options["recallable"] then + contract_code = contract_code .. arc2_recallable + end + + contract_code = contract_code .. arc2_constructor + + if initial_supply then + for index,value in ipairs(initial_supply) do + if type(value) == "string" then + initial_supply[index] = {value} + end + end + end + + local max_supply = options["max_supply"] + if max_supply then + assert(options["mintable"], "max_supply is only available with the mintable extension") + max_supply = tonumber(max_supply) + if initial_supply then + assert(max_supply >= #initial_supply, "the max supply must be bigger than the initial supply count") + end + end + + local address = contract.deploy(contract_code, name, symbol, initial_supply, max_supply, owner) + + contract.event("new_arc2_token", address) + + return address +end + +abi.register(new_arc2_nft) diff --git a/contract/vm_dummy/test_files/deployn.lua b/contract/vm_dummy/test_files/deployn.lua index 6a9863d30..aaa2e4329 100644 --- a/contract/vm_dummy/test_files/deployn.lua +++ b/contract/vm_dummy/test_files/deployn.lua @@ -10,26 +10,32 @@ end function deploytest() src = [[ function default() - contract.send(system.getSender(), system.getAmount()) + contract.send(system.getSender(), system.getAmount()) + system.setItem('last-amount', system.getAmount()) + return system.getAmount() + end + + function get_last_amount() + return system.getItem('last-amount') end function getargs(...) - tb = {...} + tb = {...} end abi.payable(default) - abi.register(getargs) + abi.register(getargs, get_last_amount) ]] addr = contract.deploy(src) id = 'deploy_src'; system.setItem(id, addr) - system.print(id, system.getItem(id)) + assert(system.getItem(id) == addr, "deploy_src") korean_char_src = [[ function 함수() - 변수 = 1 - 결과 = 변수 + 3 - system.print('결과', 결과) + 변수 = 1 + 결과 = 변수 + 3 + system.print('결과', 결과) end abi.register(함수) @@ -38,14 +44,15 @@ function deploytest() korean_char_src222 = [[ function default() - contract.send(system.getSender(), system.getAmount()) + contract.send(system.getSender(), system.getAmount()) end function getargs(...) - tb = {...} + tb = {...} end function x() + -- empty end abi.payable(default) @@ -54,20 +61,68 @@ function deploytest() korean_addr = contract.deploy(korean_char_src) id = 'korean_char_src'; system.setItem(id, korean_addr) - system.print(id, system.getItem(id)) + assert(system.getItem(id) == korean_addr, "korean_char_src") end +-- also make sure that system.getAmount() is not the value +-- sent on the transaction on the second contract. it must +-- be the amount sent by this contract instead. + function sendtest() addr = system.getItem("deploy_src") - system.print('ADDRESS', addr, system.getAmount()) + --system.print('ADDRESS', addr, system.getAmount()) + + local amount_str = system.getAmount() + local amount_big = bignum.number(amount_str) + + -- transfer by using contract.send() + + contract.send(addr, amount_big) + local ret = contract.call(addr, "get_last_amount") + --system.print('call 1', amount_str, ret) + assert(ret == amount_str, "amount 1") + + contract.send(addr, amount_str) + local ret = contract.call(addr, "get_last_amount") + --system.print('call 2', amount_str, ret) + assert(ret == amount_str, "amount 2") + + contract.send(addr, bignum.number(0)) + local ret = contract.call(addr, "get_last_amount") + --system.print('call 3', "0", ret) + assert(ret == "0", "amount 3") + + contract.send(addr, "0") + local ret = contract.call(addr, "get_last_amount") + --system.print('call 4', "0", ret) + assert(ret == "0", "amount 4") + + -- transfer by calling the 'default' function directly + + local ret = contract.call.value(amount_big)(addr, "default") + --system.print('call 5', amount_str, ret) + assert(ret == amount_str, "amount 5") + + local ret = contract.call.value(amount_str)(addr, "default") + --system.print('call 6', amount_str, ret) + assert(ret == amount_str, "amount 6") + + local ret = contract.call.value(bignum.number(1))(addr, "default") + --system.print('call 7', "1", ret) + assert(ret == "1", "amount 7") + + local ret = contract.call.value(bignum.number(0))(addr, "default") + --system.print('call 8', "0", ret) + assert(ret == "0", "amount 8") + + local ret = contract.call(addr, "default") + --system.print('call 9', "0", ret) + assert(ret == "0", "amount 9") - id = 's01'; system.setItem(id, { pcall(function() contract.send(addr, system.getAmount()) end) }) - system.print(id, system.getItem(id)) end function default() -- do nothing end -abi.payable(constructor, default) -abi.register(testall) +abi.payable(constructor, default, testall) diff --git a/contract/vm_dummy/test_files/token-deployer.lua b/contract/vm_dummy/test_files/token-deployer.lua new file mode 100644 index 000000000..0e2e3756e --- /dev/null +++ b/contract/vm_dummy/test_files/token-deployer.lua @@ -0,0 +1,33 @@ +state.var { + arc1_factory = state.value(), + arc2_factory = state.value(), +} + +function constructor(f1, f2) + arc1_factory:set(f1) + arc2_factory:set(f2) +end + +function deploy_tokens(n1, n2) + + for n = 1,n1 do + address = contract.call(arc1_factory:get(), "new_token", "Test", "TST", 18, 1000, {burnable=true, mintable=true, pausable=true, blacklist=true, all_approval=true, limited_approval=true}) + assert(contract.call(address, "symbol") == "TST", "deployed contract is not working") + end + + for n = 1,n2 do + address = contract.call(arc2_factory:get(), "new_arc2_nft", "Test NFT 1", "NFT1", null, {burnable=true, mintable=true, metadata=true, pausable=true, blacklist=true, approval=true, searchable=true, non_transferable=true, recallable=true}) + assert(contract.call(address, "symbol") == "NFT1", "deployed contract is not working") + end + +end + +function tokensReceived(operator, from, value, ...) + -- do nothing +end + +function nonFungibleReceived(operator, from, tokenId, ...) + -- do nothing +end + +abi.register(deploy_tokens, tokensReceived, nonFungibleReceived) diff --git a/contract/vm_dummy/vm_dummy.go b/contract/vm_dummy/vm_dummy.go index 12498f86f..5de79b039 100644 --- a/contract/vm_dummy/vm_dummy.go +++ b/contract/vm_dummy/vm_dummy.go @@ -132,7 +132,7 @@ func LoadDummyChain(opts ...DummyChainOptions) (*DummyChain, error) { system.InitGovernance("dpos") // To pass dao parameters test - scs, err := bc.sdb.GetStateDB().OpenContractStateAccount(types.ToAccountID([]byte("aergo.system"))) + scs, err := bc.sdb.GetStateDB().GetSystemAccountState() system.InitSystemParams(scs, 3) fee.EnableZeroFee() @@ -224,7 +224,7 @@ func (bc *DummyChain) GetAccountState(name string) (*types.State, error) { } func (bc *DummyChain) GetStaking(name string) (*types.Staking, error) { - scs, err := bc.sdb.GetStateDB().OpenContractStateAccount(types.ToAccountID([]byte(types.AergoSystem))) + scs, err := bc.sdb.GetStateDB().GetSystemAccountState() if err != nil { return nil, err } diff --git a/contract/vm_dummy/vm_dummy_dbg.go b/contract/vm_dummy/vm_dummy_dbg.go index 1a5ea3812..52892417d 100644 --- a/contract/vm_dummy/vm_dummy_dbg.go +++ b/contract/vm_dummy/vm_dummy_dbg.go @@ -4,9 +4,10 @@ package vm_dummy import ( + "math/big" + luacUtil "github.com/aergoio/aergo/v2/cmd/aergoluac/util" "github.com/aergoio/aergo/v2/contract" - "math/big" ) func getCompiledABI(code string) ([]byte, error) { diff --git a/contract/vm_dummy/vm_dummy_pub_test.go b/contract/vm_dummy/vm_dummy_pub_test.go index 6c001b82b..a1cdd8ac5 100644 --- a/contract/vm_dummy/vm_dummy_pub_test.go +++ b/contract/vm_dummy/vm_dummy_pub_test.go @@ -6,10 +6,10 @@ package vm_dummy import ( "fmt" - "github.com/aergoio/aergo/v2/contract" "runtime" "testing" + "github.com/aergoio/aergo/v2/contract" "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -25,10 +25,8 @@ func skipNotOnAmd64(t *testing.T) { func TestContractSendF(t *testing.T) { skipNotOnAmd64(t) - code := readLuaCode("contract_sendf_1.lua") - require.NotEmpty(t, code, "failed to read contract_sendf_1.lua") - code2 := readLuaCode("contract_sendf_2.lua") - require.NotEmpty(t, code2, "failed to read contract_sendf_2.lua") + code := readLuaCode(t, "contract_sendf_1.lua") + code2 := readLuaCode(t, "contract_sendf_2.lua") bc, err := LoadDummyChain(SetPubNet()) require.NoErrorf(t, err, "failed to create dummy chain") @@ -66,8 +64,7 @@ func TestGasPerFunction(t *testing.T) { skipNotOnAmd64(t) var err error - code := readLuaCode("gas_per_function.lua") - require.NotEmpty(t, code, "failed to read gas_per_function.lua") + code := readLuaCode(t, "gas_per_function.lua") bc, err := LoadDummyChain(SetPubNet()) assert.NoError(t, err) @@ -565,8 +562,7 @@ func TestGasHello(t *testing.T) { skipNotOnAmd64(t) var err error - code := readLuaCode("contract_hello.lua") - require.NotEmpty(t, code, "failed to read hello.lua") + code := readLuaCode(t, "contract_hello.lua") err = expectGas(code, 0, `"hello"`, `"world"`, 100000, SetHardForkVersion(1)) assert.NoError(t, err) @@ -590,8 +586,7 @@ func TestGasDeploy(t *testing.T) { skipNotOnAmd64(t) var err error - code := readLuaCode("gas_deploy.lua") - require.NotEmpty(t, code, "failed to read deployfee.lua") + code := readLuaCode(t, "gas_deploy.lua") // err = expectGas(code, 0, `"testPcall"`, ``, 0, SetHardForkVersion(0)) // assert.NoError(t, err) @@ -610,8 +605,7 @@ func TestGasOp(t *testing.T) { skipNotOnAmd64(t) var err error - code := readLuaCode("gas_op.lua") - require.NotEmpty(t, code, "failed to read op.lua") + code := readLuaCode(t, "gas_op.lua") err = expectGas(string(code), 0, `"main"`, ``, 100000, SetHardForkVersion(0)) assert.NoError(t, err) @@ -630,8 +624,7 @@ func TestGasBF(t *testing.T) { skipNotOnAmd64(t) var err error - code := readLuaCode("gas_bf.lua") - require.NotEmpty(t, code, "failed to read bf.lua") + code := readLuaCode(t, "gas_bf.lua") // err = expectGas(t, string(code), 0, `"main"`, ``, 100000, SetHardForkVersion(1)) // assert.NoError(t, err) @@ -649,8 +642,7 @@ func TestGasBF(t *testing.T) { func TestGasLuaCryptoVerifyProof(t *testing.T) { skipNotOnAmd64(t) - code := readLuaCode("feature_luacryptoverifyproof.lua") - require.NotEmpty(t, code, "failed to read feature_luacryptoverifyproof.lua") + code := readLuaCode(t, "feature_luacryptoverifyproof.lua") // v2 raw err := expectGas(string(code), 0, `"verifyProofRaw"`, ``, 154137, SetHardForkVersion(2)) @@ -732,8 +724,7 @@ func expectGas(contractCode string, amount int64, funcName, funcArgs string, exp func TestTypeInvalidKey(t *testing.T) { skipNotOnAmd64(t) - code := readLuaCode("type_invalidkey.lua") - require.NotEmpty(t, code, "failed to read type_invalidkey.lua") + code := readLuaCode(t, "type_invalidkey.lua") bc, err := LoadDummyChain() require.NoErrorf(t, err, "failed to create dummy chain") @@ -770,10 +761,8 @@ func TestTypeBigTable(t *testing.T) { } skipNotOnAmd64(t) - code := readLuaCode("type_bigtable_1.lua") - require.NotEmpty(t, code, "failed to read type_bigtable_1.lua") - code2 := readLuaCode("type_bigtable_2.lua") - require.NotEmpty(t, code2, "failed to read type_bigtable_2.lua") + code := readLuaCode(t, "type_bigtable_1.lua") + code2 := readLuaCode(t, "type_bigtable_2.lua") bc, err := LoadDummyChain() require.NoErrorf(t, err, "failed to create dummy chain") diff --git a/contract/vm_dummy/vm_dummy_test.go b/contract/vm_dummy/vm_dummy_test.go index c4848cc18..831953571 100644 --- a/contract/vm_dummy/vm_dummy_test.go +++ b/contract/vm_dummy/vm_dummy_test.go @@ -19,2050 +19,2145 @@ import ( "github.com/stretchr/testify/require" ) -func TestMaxCallDepth(t *testing.T) { - code := readLuaCode("maxcalldepth_1.lua") - require.NotEmpty(t, code, "failed to read maxcalldepth_1.lua") +const min_version int32 = 2 +const max_version int32 = 3 +func TestMaxCallDepth(t *testing.T) { + //code := readLuaCode(t, "maxcalldepth_1.lua") // this contract receives a list of contract IDs to be called - code2 := readLuaCode("maxcalldepth_2.lua") - require.NotEmpty(t, code2, "failed to read maxcalldepth_2.lua") - + code2 := readLuaCode(t, "maxcalldepth_2.lua") // this contract stores the address of the next contract to be called - code3 := readLuaCode("maxcalldepth_3.lua") - require.NotEmpty(t, code3, "failed to read maxcalldepth_3.lua") - - bc, err := LoadDummyChain(SetHardForkVersion(3), SetPubNet()) - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + code3 := readLuaCode(t, "maxcalldepth_3.lua") - err = bc.ConnectBlock( - NewLuaTxAccount("user", 1, types.Aergo), - ) - if err != nil { - t.Error(err) - } + for version := int32(3); version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version), SetPubNet()) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - /* - // deploy 2 identical contracts err = bc.ConnectBlock( - NewLuaTxDeploy("user", "c1", 0, definition1), - NewLuaTxDeploy("user", "c2", 0, definition1), + NewLuaTxAccount("user", 1, types.Aergo), ) if err != nil { t.Error(err) } - // call first contract - recursion depth 64 - err = bc.ConnectBlock( - NewLuaTxCall("user", "c1", 0, `{"Name":"call_me", "Args":[1, 64]}`), - ) - if err != nil { - t.Error(err) - } - // check state - err = bc.Query("c1", `{"Name":"check_state"}`, "", "true") - if err != nil { - t.Error(err) - } - // query view - err = bc.Query("c1", `{"Name":"get_total_calls"}`, "", "[64,64]") - if err != nil { - t.Error(err) + /* + // deploy 2 identical contracts + err = bc.ConnectBlock( + NewLuaTxDeploy("user", "c1", 0, definition1), + NewLuaTxDeploy("user", "c2", 0, definition1), + ) + if err != nil { + t.Error(err) + } + + // call first contract - recursion depth 64 + err = bc.ConnectBlock( + NewLuaTxCall("user", "c1", 0, `{"Name":"call_me", "Args":[1, 64]}`), + ) + if err != nil { + t.Error(err) + } + // check state + err = bc.Query("c1", `{"Name":"check_state"}`, "", "true") + if err != nil { + t.Error(err) + } + // query view + err = bc.Query("c1", `{"Name":"get_total_calls"}`, "", "[64,64]") + if err != nil { + t.Error(err) + } + for i := 1; i <= 64; i++ { + err = bc.Query("c1", fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, i), "", fmt.Sprintf("%d", i)) + if err != nil { + t.Error(err) + } + } + + // call second contract - recursion depth 66 + err = bc.ConnectBlock( + NewLuaTxCall("user", "c2", 0, `{"Name":"call_me", "Args":[1, 66]}`). + Fail("exceeded the maximum call depth"), + ) + if err != nil { + t.Error(err) + } + // check state - should fail + err = bc.Query("c2", `{"Name":"check_state"}`, "", "") + if err == nil { + t.Error("should fail") + } + // query view - must return nil + err = bc.Query("c2", `{"Name":"get_total_calls"}`, "", "[null,null]") + if err != nil { + t.Error(err) + } + for i := 1; i <= 64; i++ { + err = bc.Query("c2", fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, i), "", "null") + if err != nil { + t.Error(err) + } + } + */ + + // deploy 66 identical contracts using definition2 + for i := 1; i <= 66; i++ { + err = bc.ConnectBlock( + NewLuaTxDeploy("user", fmt.Sprintf("c2%d", i), 0, code2), + ) + if err != nil { + t.Error(err) + } } - for i := 1; i <= 64; i++ { - err = bc.Query("c1", fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, i), "", fmt.Sprintf("%d", i)) + // deploy 66 identical contracts using definition3 + for i := 1; i <= 66; i++ { + err = bc.ConnectBlock( + NewLuaTxDeploy("user", fmt.Sprintf("c3%d", i), 0, code3), + ) if err != nil { t.Error(err) } } - // call second contract - recursion depth 66 - err = bc.ConnectBlock( - NewLuaTxCall("user", "c2", 0, `{"Name":"call_me", "Args":[1, 66]}`). - Fail("exceeded the maximum call depth"), - ) + // build a list of contract IDs, used to call the first contract + contracts := make([]string, 64) + contracts_str := []byte("") + for i := 1; i <= 64; i++ { + contracts[i-1] = StrToAddress(fmt.Sprintf("c2%d", i)) + } + contracts_str, err = json.Marshal(contracts) if err != nil { t.Error(err) } - // check state - should fail - err = bc.Query("c2", `{"Name":"check_state"}`, "", "") - if err == nil { - t.Error("should fail") - } - // query view - must return nil - err = bc.Query("c2", `{"Name":"get_total_calls"}`, "", "[null,null]") + // call first contract - recursion depth 64 + err = bc.ConnectBlock( + NewLuaTxCall("user", "c2"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 64]}`, string(contracts_str))), + ) if err != nil { t.Error(err) } + // check state on all the 64 contracts (query total calls and call info) for i := 1; i <= 64; i++ { - err = bc.Query("c2", fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, i), "", "null") + err = bc.Query(fmt.Sprintf("c2%d", i), `{"Name":"get_total_calls"}`, "", "1") + if err != nil { + t.Error(err) + } + //err = bc.Query(fmt.Sprintf("c2%d", i), fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, i), "", fmt.Sprintf("%d", i)) + err = bc.Query(fmt.Sprintf("c2%d", i), `{"Name":"get_call_info", "Args":["1"]}`, "", fmt.Sprintf("%d", i)) if err != nil { t.Error(err) } } - */ - // deploy 66 identical contracts using definition2 - for i := 1; i <= 66; i++ { - err = bc.ConnectBlock( - NewLuaTxDeploy("user", fmt.Sprintf("c2%d", i), 0, code2), - ) + // add the 66th contract to the list + contracts = append(contracts, StrToAddress(fmt.Sprintf("c2%d", 6))) + contracts_str, err = json.Marshal(contracts) if err != nil { t.Error(err) } - } - // deploy 66 identical contracts using definition3 - for i := 1; i <= 66; i++ { + // call first contract - recursion depth 66 err = bc.ConnectBlock( - NewLuaTxDeploy("user", fmt.Sprintf("c3%d", i), 0, code3), + NewLuaTxCall("user", "c2"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 66]}`, string(contracts_str))).Fail("exceeded the maximum call depth"), ) if err != nil { t.Error(err) } - } - - // build a list of contract IDs, used to call the first contract - contracts := make([]string, 64) - contracts_str := []byte("") - for i := 1; i <= 64; i++ { - contracts[i-1] = StrToAddress(fmt.Sprintf("c2%d", i)) - } - contracts_str, err = json.Marshal(contracts) - if err != nil { - t.Error(err) - } - // call first contract - recursion depth 64 - err = bc.ConnectBlock( - NewLuaTxCall("user", "c2"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 64]}`, string(contracts_str))), - ) - if err != nil { - t.Error(err) - } - // check state on all the 64 contracts (query total calls and call info) - for i := 1; i <= 64; i++ { - err = bc.Query(fmt.Sprintf("c2%d", i), `{"Name":"get_total_calls"}`, "", "1") + // check state on all the 64 contracts (query total calls and call info) + for i := 1; i <= 64; i++ { + err = bc.Query(fmt.Sprintf("c2%d", i), `{"Name":"get_total_calls"}`, "", "1") + if err != nil { + t.Error(err) + } + err = bc.Query(fmt.Sprintf("c2%d", i), `{"Name":"get_call_info", "Args":["1"]}`, "", fmt.Sprintf("%d", i)) + if err != nil { + t.Error(err) + } + } + // check state on the 66th contract (query total calls and call info) + err = bc.Query("c2"+fmt.Sprintf("%d", 66), `{"Name":"get_total_calls"}`, "", "null") if err != nil { t.Error(err) } - //err = bc.Query(fmt.Sprintf("c2%d", i), fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, i), "", fmt.Sprintf("%d", i)) - err = bc.Query(fmt.Sprintf("c2%d", i), `{"Name":"get_call_info", "Args":["1"]}`, "", fmt.Sprintf("%d", i)) + err = bc.Query("c2"+fmt.Sprintf("%d", 66), `{"Name":"get_call_info", "Args":["1"]}`, "", "null") if err != nil { t.Error(err) } - } - // add the 66th contract to the list - contracts = append(contracts, StrToAddress(fmt.Sprintf("c2%d", 6))) - contracts_str, err = json.Marshal(contracts) - if err != nil { - t.Error(err) - } - // call first contract - recursion depth 66 - err = bc.ConnectBlock( - NewLuaTxCall("user", "c2"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 66]}`, string(contracts_str))).Fail("exceeded the maximum call depth"), - ) - if err != nil { - t.Error(err) - } - // check state on all the 64 contracts (query total calls and call info) - for i := 1; i <= 64; i++ { - err = bc.Query(fmt.Sprintf("c2%d", i), `{"Name":"get_total_calls"}`, "", "1") - if err != nil { - t.Error(err) + // set next_contract for each contract + for i := 1; i <= 66; i++ { + err = bc.ConnectBlock( + NewLuaTxCall("user", fmt.Sprintf("c3%d", i), 0, fmt.Sprintf(`{"Name":"set_next_contract", "Args":["%s"]}`, StrToAddress(fmt.Sprintf("c3%d", i+1)))), + ) + if err != nil { + t.Error(err) + } } - err = bc.Query(fmt.Sprintf("c2%d", i), `{"Name":"get_call_info", "Args":["1"]}`, "", fmt.Sprintf("%d", i)) + // call first contract - recursion depth 64 + err = bc.ConnectBlock( + NewLuaTxCall("user", "c3"+fmt.Sprintf("%d", 1), 0, `{"Name":"call_me", "Args":[1, 64]}`), + ) if err != nil { t.Error(err) } - } - // check state on the 66th contract (query total calls and call info) - err = bc.Query("c2"+fmt.Sprintf("%d", 66), `{"Name":"get_total_calls"}`, "", "null") - if err != nil { - t.Error(err) - } - err = bc.Query("c2"+fmt.Sprintf("%d", 66), `{"Name":"get_call_info", "Args":["1"]}`, "", "null") - if err != nil { - t.Error(err) - } + // check state on all the 64 contracts (query total calls and call info) + for i := 1; i <= 64; i++ { + err = bc.Query(fmt.Sprintf("c3%d", i), `{"Name":"get_total_calls"}`, "", "1") + if err != nil { + t.Error(err) + } + err = bc.Query(fmt.Sprintf("c3%d", i), `{"Name":"get_call_info", "Args":["1"]}`, "", fmt.Sprintf("%d", i)) + if err != nil { + t.Error(err) + } + } - // set next_contract for each contract - for i := 1; i <= 66; i++ { + // call first contract - recursion depth 66 err = bc.ConnectBlock( - NewLuaTxCall("user", fmt.Sprintf("c3%d", i), 0, fmt.Sprintf(`{"Name":"set_next_contract", "Args":["%s"]}`, StrToAddress(fmt.Sprintf("c3%d", i+1)))), + NewLuaTxCall("user", "c3"+fmt.Sprintf("%d", 1), 0, `{"Name":"call_me", "Args":[1, 66]}`).Fail("exceeded the maximum call depth"), ) if err != nil { t.Error(err) } - } - // call first contract - recursion depth 64 - err = bc.ConnectBlock( - NewLuaTxCall("user", "c3"+fmt.Sprintf("%d", 1), 0, `{"Name":"call_me", "Args":[1, 64]}`), - ) - if err != nil { - t.Error(err) - } - // check state on all the 64 contracts (query total calls and call info) - for i := 1; i <= 64; i++ { - err = bc.Query(fmt.Sprintf("c3%d", i), `{"Name":"get_total_calls"}`, "", "1") + // check state on all the 64 contracts (query total calls and call info) + for i := 1; i <= 64; i++ { + err = bc.Query(fmt.Sprintf("c3%d", i), `{"Name":"get_total_calls"}`, "", "1") + if err != nil { + t.Error(err) + } + err = bc.Query(fmt.Sprintf("c3%d", i), `{"Name":"get_call_info", "Args":["1"]}`, "", fmt.Sprintf("%d", i)) + if err != nil { + t.Error(err) + } + } + // check state on the 66th contract (query total calls and call info) + err = bc.Query("c3"+fmt.Sprintf("%d", 66), `{"Name":"get_total_calls"}`, "", "null") if err != nil { t.Error(err) } - err = bc.Query(fmt.Sprintf("c3%d", i), `{"Name":"get_call_info", "Args":["1"]}`, "", fmt.Sprintf("%d", i)) + err = bc.Query("c3"+fmt.Sprintf("%d", 66), `{"Name":"get_call_info", "Args":["1"]}`, "", "null") if err != nil { t.Error(err) } - } - // call first contract - recursion depth 66 - err = bc.ConnectBlock( - NewLuaTxCall("user", "c3"+fmt.Sprintf("%d", 1), 0, `{"Name":"call_me", "Args":[1, 66]}`).Fail("exceeded the maximum call depth"), - ) - if err != nil { - t.Error(err) - } - // check state on all the 64 contracts (query total calls and call info) - for i := 1; i <= 64; i++ { - err = bc.Query(fmt.Sprintf("c3%d", i), `{"Name":"get_total_calls"}`, "", "1") - if err != nil { - t.Error(err) + // Circle: contract 1 calls contract 2, contract 2 calls contract 3, contract 3 calls contract 1... + + // deploy 4 identical contracts using definition2 + for i := 1; i <= 4; i++ { + err = bc.ConnectBlock( + NewLuaTxDeploy("user", fmt.Sprintf("c4%d", i), 0, code2), + ) + if err != nil { + t.Error(err) + } + } + // build a list of contract IDs, used to call the first contract + contracts = make([]string, 4) + for i := 1; i <= 4; i++ { + contracts[i-1] = StrToAddress(fmt.Sprintf("c4%d", i)) } - err = bc.Query(fmt.Sprintf("c3%d", i), `{"Name":"get_call_info", "Args":["1"]}`, "", fmt.Sprintf("%d", i)) + contracts_str, err = json.Marshal(contracts) if err != nil { t.Error(err) } - } - // check state on the 66th contract (query total calls and call info) - err = bc.Query("c3"+fmt.Sprintf("%d", 66), `{"Name":"get_total_calls"}`, "", "null") - if err != nil { - t.Error(err) - } - err = bc.Query("c3"+fmt.Sprintf("%d", 66), `{"Name":"get_call_info", "Args":["1"]}`, "", "null") - if err != nil { - t.Error(err) - } - - // Circle: contract 1 calls contract 2, contract 2 calls contract 3, contract 3 calls contract 1... - - // deploy 4 identical contracts using definition2 - for i := 1; i <= 4; i++ { + // call first contract - recursion depth 64 err = bc.ConnectBlock( - NewLuaTxDeploy("user", fmt.Sprintf("c4%d", i), 0, code2), + NewLuaTxCall("user", "c4"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 64]}`, string(contracts_str))), ) if err != nil { t.Error(err) } - } - // build a list of contract IDs, used to call the first contract - contracts = make([]string, 4) - for i := 1; i <= 4; i++ { - contracts[i-1] = StrToAddress(fmt.Sprintf("c4%d", i)) - } - contracts_str, err = json.Marshal(contracts) - if err != nil { - t.Error(err) - } - // call first contract - recursion depth 64 - err = bc.ConnectBlock( - NewLuaTxCall("user", "c4"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 64]}`, string(contracts_str))), - ) - if err != nil { - t.Error(err) - } - // check state on all the 4 contracts - // each contract should have (64 / 4) = 16 calls - for i := 1; i <= 4; i++ { - err = bc.Query(fmt.Sprintf("c4%d", i), `{"Name":"get_total_calls"}`, "", "16") - if err != nil { - t.Error(err) - } - for j := 1; j <= 16; j++ { - err = bc.Query(fmt.Sprintf("c4%d", i), fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, j), "", fmt.Sprintf("%d", i+4*(j-1))) + // check state on all the 4 contracts + // each contract should have (64 / 4) = 16 calls + for i := 1; i <= 4; i++ { + err = bc.Query(fmt.Sprintf("c4%d", i), `{"Name":"get_total_calls"}`, "", "16") if err != nil { t.Error(err) } + for j := 1; j <= 16; j++ { + err = bc.Query(fmt.Sprintf("c4%d", i), fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, j), "", fmt.Sprintf("%d", i+4*(j-1))) + if err != nil { + t.Error(err) + } + } } - } - // call first contract - recursion depth 66 - err = bc.ConnectBlock( - NewLuaTxCall("user", "c4"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 66]}`, string(contracts_str))).Fail("exceeded the maximum call depth"), - ) - if err != nil { - t.Error(err) - } - // check state on all the 4 contracts - // each contract should have (64 / 4) = 16 calls - for i := 1; i <= 4; i++ { - err = bc.Query(fmt.Sprintf("c4%d", i), `{"Name":"get_total_calls"}`, "", "16") + // call first contract - recursion depth 66 + err = bc.ConnectBlock( + NewLuaTxCall("user", "c4"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 66]}`, string(contracts_str))).Fail("exceeded the maximum call depth"), + ) if err != nil { t.Error(err) } - for j := 1; j <= 16; j++ { - err = bc.Query(fmt.Sprintf("c4%d", i), fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, j), "", fmt.Sprintf("%d", i+4*(j-1))) + // check state on all the 4 contracts + // each contract should have (64 / 4) = 16 calls + for i := 1; i <= 4; i++ { + err = bc.Query(fmt.Sprintf("c4%d", i), `{"Name":"get_total_calls"}`, "", "16") if err != nil { t.Error(err) } + for j := 1; j <= 16; j++ { + err = bc.Query(fmt.Sprintf("c4%d", i), fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, j), "", fmt.Sprintf("%d", i+4*(j-1))) + if err != nil { + t.Error(err) + } + } } - } - // ZigZag: contract 1 calls contract 2, contract 2 calls contract 1... + // ZigZag: contract 1 calls contract 2, contract 2 calls contract 1... - // deploy 2 identical contracts using definition2 - for i := 1; i <= 2; i++ { - err = bc.ConnectBlock( - NewLuaTxDeploy("user", fmt.Sprintf("c5%d", i), 0, code2), - ) + // deploy 2 identical contracts using definition2 + for i := 1; i <= 2; i++ { + err = bc.ConnectBlock( + NewLuaTxDeploy("user", fmt.Sprintf("c5%d", i), 0, code2), + ) + if err != nil { + t.Error(err) + } + } + // build a list of contract IDs, used to call the first contract + contracts = make([]string, 2) + for i := 1; i <= 2; i++ { + contracts[i-1] = StrToAddress(fmt.Sprintf("c5%d", i)) + } + contracts_str, err = json.Marshal(contracts) if err != nil { t.Error(err) } - } - // build a list of contract IDs, used to call the first contract - contracts = make([]string, 2) - for i := 1; i <= 2; i++ { - contracts[i-1] = StrToAddress(fmt.Sprintf("c5%d", i)) - } - contracts_str, err = json.Marshal(contracts) - if err != nil { - t.Error(err) - } - // call first contract - recursion depth 64 - err = bc.ConnectBlock( - NewLuaTxCall("user", "c5"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 64]}`, string(contracts_str))), - ) - if err != nil { - t.Error(err) - } - // check state on all the 2 contracts - // each contract should have (64 / 2) = 32 calls - for i := 1; i <= 2; i++ { - err = bc.Query(fmt.Sprintf("c5%d", i), `{"Name":"get_total_calls"}`, "", "32") + // call first contract - recursion depth 64 + err = bc.ConnectBlock( + NewLuaTxCall("user", "c5"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 64]}`, string(contracts_str))), + ) if err != nil { t.Error(err) } - for j := 1; j <= 32; j++ { - err = bc.Query(fmt.Sprintf("c5%d", i), fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, j), "", fmt.Sprintf("%d", i+2*(j-1))) + // check state on all the 2 contracts + // each contract should have (64 / 2) = 32 calls + for i := 1; i <= 2; i++ { + err = bc.Query(fmt.Sprintf("c5%d", i), `{"Name":"get_total_calls"}`, "", "32") if err != nil { t.Error(err) } + for j := 1; j <= 32; j++ { + err = bc.Query(fmt.Sprintf("c5%d", i), fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, j), "", fmt.Sprintf("%d", i+2*(j-1))) + if err != nil { + t.Error(err) + } + } } - } - // call first contract - recursion depth 66 - err = bc.ConnectBlock( - NewLuaTxCall("user", "c5"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 66]}`, string(contracts_str))).Fail("exceeded the maximum call depth"), - ) - if err != nil { - t.Error(err) - } - // check state on all the 2 contracts - // each contract should have (64 / 2) = 32 calls - for i := 1; i <= 2; i++ { - err = bc.Query(fmt.Sprintf("c5%d", i), `{"Name":"get_total_calls"}`, "", "32") + // call first contract - recursion depth 66 + err = bc.ConnectBlock( + NewLuaTxCall("user", "c5"+fmt.Sprintf("%d", 1), 0, fmt.Sprintf(`{"Name":"call_me", "Args":[%s, 1, 66]}`, string(contracts_str))).Fail("exceeded the maximum call depth"), + ) if err != nil { t.Error(err) } - for j := 1; j <= 32; j++ { - err = bc.Query(fmt.Sprintf("c5%d", i), fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, j), "", fmt.Sprintf("%d", i+2*(j-1))) + // check state on all the 2 contracts + // each contract should have (64 / 2) = 32 calls + for i := 1; i <= 2; i++ { + err = bc.Query(fmt.Sprintf("c5%d", i), `{"Name":"get_total_calls"}`, "", "32") if err != nil { t.Error(err) } + for j := 1; j <= 32; j++ { + err = bc.Query(fmt.Sprintf("c5%d", i), fmt.Sprintf(`{"Name":"get_call_info", "Args":["%d"]}`, j), "", fmt.Sprintf("%d", i+2*(j-1))) + if err != nil { + t.Error(err) + } + } } + } } func TestContractSystem(t *testing.T) { - code := readLuaCode("contract_system.lua") - require.NotEmpty(t, code, "failed to read contract_system.lua") + code := readLuaCode(t, "contract_system.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) - require.NoErrorf(t, err, "failed to new account") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) + require.NoErrorf(t, err, "failed to new account") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "system", 0, code)) - require.NoErrorf(t, err, "failed to deploy contract") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "system", 0, code)) + require.NoErrorf(t, err, "failed to deploy contract") - tx := NewLuaTxCall("user1", "system", 0, `{"Name":"testState", "Args":[]}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx := NewLuaTxCall("user1", "system", 0, `{"Name":"testState", "Args":[]}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - receipt := bc.GetReceipt(tx.Hash()) - exRv := fmt.Sprintf(`["%s","6FbDRScGruVdATaNWzD51xJkTfYCVwxSZDb7gzqCLzwf","AmhNNBNY7XFk4p5ym4CJf8nTcRTEHjWzAeXJfhP71244CjBCAQU3",%d,3,999]`, StrToAddress("user1"), bc.cBlock.Header.Timestamp/1e9) - assert.Equal(t, exRv, receipt.GetRet(), "receipt ret error") + receipt := bc.GetReceipt(tx.Hash()) + exRv := fmt.Sprintf(`["%s","6FbDRScGruVdATaNWzD51xJkTfYCVwxSZDb7gzqCLzwf","AmhNNBNY7XFk4p5ym4CJf8nTcRTEHjWzAeXJfhP71244CjBCAQU3",%d,3,999]`, StrToAddress("user1"), bc.cBlock.Header.Timestamp/1e9) + assert.Equal(t, exRv, receipt.GetRet(), "receipt ret error") + + } } func TestContractHello(t *testing.T) { - code := readLuaCode("contract_hello.lua") - require.NotEmpty(t, code, "failed to read contract_hello.lua") + code := readLuaCode(t, "contract_hello.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create test database") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create test database") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) - require.NoErrorf(t, err, "failed to new account") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) + require.NoErrorf(t, err, "failed to new account") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "hello", 0, code)) - require.NoErrorf(t, err, "failed to deploy contract") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "hello", 0, code)) + require.NoErrorf(t, err, "failed to deploy contract") - tx := NewLuaTxCall("user1", "hello", 0, `{"Name":"hello", "Args":["World"]}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx := NewLuaTxCall("user1", "hello", 0, `{"Name":"hello", "Args":["World"]}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - receipt := bc.GetReceipt(tx.Hash()) - assert.Equal(t, `"Hello World"`, receipt.GetRet(), "receipt ret error") + receipt := bc.GetReceipt(tx.Hash()) + assert.Equal(t, `"Hello World"`, receipt.GetRet(), "receipt ret error") + + } } func TestContractSend(t *testing.T) { - code := readLuaCode("contract_send_1.lua") - require.NotEmpty(t, code, "failed to read contract_send_1.lua") - code2 := readLuaCode("contract_send_2.lua") - require.NotEmpty(t, code2, "failed to read contract_send_2.lua") - code3 := readLuaCode("contract_send_3.lua") - require.NotEmpty(t, code3, "failed to read contract_send_3.lua") - code4 := readLuaCode("contract_send_4.lua") - require.NotEmpty(t, code4, "failed to read contract_send_4.lua") + code1 := readLuaCode(t, "contract_send_1.lua") + code2 := readLuaCode(t, "contract_send_2.lua") + code3 := readLuaCode(t, "contract_send_3.lua") + code4 := readLuaCode(t, "contract_send_4.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "test1", 50, code), - NewLuaTxDeploy("user1", "test2", 0, code2), - NewLuaTxDeploy("user1", "test3", 0, code3), - NewLuaTxDeploy("user1", "test4", 0, code4), - ) - assert.NoErrorf(t, err, "failed to deploy contract") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "test1", 50, code1), + NewLuaTxDeploy("user1", "test2", 0, code2), + NewLuaTxDeploy("user1", "test3", 0, code3), + NewLuaTxDeploy("user1", "test4", 0, code4), + ) + assert.NoErrorf(t, err, "failed to deploy contract") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "test1", 0, fmt.Sprintf(`{"Name":"send", "Args":["%s"]}`, nameToAddress("test2"))), - ) - assert.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "test1", 0, fmt.Sprintf(`{"Name":"send", "Args":["%s"]}`, nameToAddress("test2"))), + ) + assert.NoErrorf(t, err, "failed to call tx") - state, err := bc.GetAccountState("test2") - assert.Equalf(t, int64(2), state.GetBalanceBigInt().Int64(), "balance error") + state, err := bc.GetAccountState("test2") + assert.Equalf(t, int64(2), state.GetBalanceBigInt().Int64(), "balance error") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "test1", 0, fmt.Sprintf(`{"Name":"send", "Args":["%s"]}`, nameToAddress("test3"))).Fail(`[Contract.LuaSendAmount] call err: not found function: default`), - ) - assert.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "test1", 0, fmt.Sprintf(`{"Name":"send", "Args":["%s"]}`, nameToAddress("test3"))).Fail(`[Contract.LuaSendAmount] call err: not found function: default`), + ) + assert.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "test1", 0, fmt.Sprintf(`{"Name":"send", "Args":["%s"]}`, nameToAddress("test4"))).Fail(`[Contract.LuaSendAmount] call err: 'default' is not payable`), - ) - assert.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "test1", 0, fmt.Sprintf(`{"Name":"send", "Args":["%s"]}`, nameToAddress("test4"))).Fail(`[Contract.LuaSendAmount] call err: 'default' is not payable`), + ) + assert.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "test1", 0, fmt.Sprintf(`{"Name":"send", "Args":["%s"]}`, nameToAddress("user1"))), - ) - assert.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "test1", 0, fmt.Sprintf(`{"Name":"send", "Args":["%s"]}`, nameToAddress("user1"))), + ) + assert.NoErrorf(t, err, "failed to connect new block") + + } } func TestContractQuery(t *testing.T) { - code := readLuaCode("contract_query.lua") - require.NotEmpty(t, code, "failed to read query.lua") + code := readLuaCode(t, "contract_query.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock( - NewLuaTxDeploy("user1", "query", 0, code), - NewLuaTxCall("user1", "query", 2, `{"Name":"inc", "Args":[]}`), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxDeploy("user1", "query", 0, code), + NewLuaTxCall("user1", "query", 2, `{"Name":"inc", "Args":[]}`), + ) + require.NoErrorf(t, err, "failed to connect new block") - query, err := bc.GetAccountState("query") - require.NoErrorf(t, err, "failed to get account state") - assert.Equalf(t, int64(2), query.GetBalanceBigInt().Int64(), "not equal balance") + query, err := bc.GetAccountState("query") + require.NoErrorf(t, err, "failed to get account state") + assert.Equalf(t, int64(2), query.GetBalanceBigInt().Int64(), "not equal balance") - err = bc.Query("query", `{"Name":"inc", "Args":[]}`, "set not permitted in query", "") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("query", `{"Name":"inc", "Args":[]}`, "set not permitted in query", "") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("query", `{"Name":"query", "Args":["key1"]}`, "", "1") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("query", `{"Name":"query", "Args":["key1"]}`, "", "1") + require.NoErrorf(t, err, "failed to query") + + } } func TestContractCall(t *testing.T) { - code := readLuaCode("contract_call_1.lua") - require.NotEmpty(t, code, "failed to read contract_call_1.lua") - code2 := readLuaCode("contract_call_2.lua") - require.NotEmpty(t, code2, "failed to read contract_call_2.lua") + code := readLuaCode(t, "contract_call_1.lua") + code2 := readLuaCode(t, "contract_call_2.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "counter", 0, code).Constructor("[1]"), - NewLuaTxCall("user1", "counter", 0, `{"Name":"inc", "Args":[]}`), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "counter", 0, code).Constructor("[1]"), + NewLuaTxCall("user1", "counter", 0, `{"Name":"inc", "Args":[]}`), + ) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.Query("counter", `{"Name":"get", "Args":[]}`, "", "2") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("counter", `{"Name":"get", "Args":[]}`, "", "2") + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock( - NewLuaTxDeploy("user1", "caller", 0, code2).Constructor(fmt.Sprintf(`["%s"]`, nameToAddress("counter"))), - NewLuaTxCall("user1", "caller", 0, `{"Name":"add", "Args":[]}`), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxDeploy("user1", "caller", 0, code2).Constructor(fmt.Sprintf(`["%s"]`, nameToAddress("counter"))), + NewLuaTxCall("user1", "caller", 0, `{"Name":"add", "Args":[]}`), + ) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.Query("caller", `{"Name":"get", "Args":[]}`, "", "3") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("caller", `{"Name":"get", "Args":[]}`, "", "3") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("caller", `{"Name":"dget", "Args":[]}`, "", "99") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("caller", `{"Name":"dget", "Args":[]}`, "", "99") + require.NoErrorf(t, err, "failed to query") - tx := NewLuaTxCall("user1", "caller", 0, `{"Name":"dadd", "Args":[]}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to connect new block") + tx := NewLuaTxCall("user1", "caller", 0, `{"Name":"dadd", "Args":[]}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to connect new block") - receipt := bc.GetReceipt(tx.Hash()) - assert.Equalf(t, `99`, receipt.GetRet(), "contract Call ret error") + receipt := bc.GetReceipt(tx.Hash()) + assert.Equalf(t, `99`, receipt.GetRet(), "contract Call ret error") - tx = NewLuaTxCall("user1", "caller", 0, `{"Name":"dadd", "Args":[]}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to connect new block") + tx = NewLuaTxCall("user1", "caller", 0, `{"Name":"dadd", "Args":[]}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to connect new block") - receipt = bc.GetReceipt(tx.Hash()) - assert.Equalf(t, `100`, receipt.GetRet(), "contract Call ret error") + receipt = bc.GetReceipt(tx.Hash()) + assert.Equalf(t, `100`, receipt.GetRet(), "contract Call ret error") - err = bc.Query("caller", `{"Name":"get", "Args":[]}`, "", "3") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("caller", `{"Name":"get", "Args":[]}`, "", "3") + require.NoErrorf(t, err, "failed to query") + + } } func TestContractPingpongCall(t *testing.T) { - code := readLuaCode("contract_pingpongcall_1.lua") - require.NotEmpty(t, code, "failed to read contract_pingpongcall_1.lua") - code2 := readLuaCode("contract_pingpongcall_2.lua") - require.NotEmpty(t, code2, "failed to read contract_pingpongcall_2.lua") + code := readLuaCode(t, "contract_pingpongcall_1.lua") + code2 := readLuaCode(t, "contract_pingpongcall_2.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "a", 0, code), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "a", 0, code), + ) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "b", 0, code2).Constructor(fmt.Sprintf(`["%s"]`, nameToAddress("a")))) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "b", 0, code2).Constructor(fmt.Sprintf(`["%s"]`, nameToAddress("a")))) + require.NoErrorf(t, err, "failed to connect new block") - tx := NewLuaTxCall("user1", "a", 0, fmt.Sprintf(`{"Name":"start", "Args":["%s"]}`, nameToAddress("b"))) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to connect new block") + tx := NewLuaTxCall("user1", "a", 0, fmt.Sprintf(`{"Name":"start", "Args":["%s"]}`, nameToAddress("b"))) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.Query("a", `{"Name":"get", "Args":[]}`, "", `"callback"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("a", `{"Name":"get", "Args":[]}`, "", `"callback"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("b", `{"Name":"get", "Args":[]}`, "", `"called"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("b", `{"Name":"get", "Args":[]}`, "", `"called"`) + require.NoErrorf(t, err, "failed to query") + + } } func TestRollback(t *testing.T) { - code := readLuaCode("rollback.lua") - require.NotEmpty(t, code, "failed to read rollback.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + code := readLuaCode(t, "rollback.lua") - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) - require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "query", 0, code), NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`)) - require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`), NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`)) - require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`), NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`)) - require.NoErrorf(t, err, "failed to connect new block") + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.Query("query", `{"Name":"query", "Args":["key1"]}`, "", "5") - require.NoErrorf(t, err, "failed to query") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) + require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "query", 0, code), NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`)) + require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`), NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`)) + require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`), NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`)) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.DisConnectBlock() - require.NoErrorf(t, err, "failed to disconnect block") + err = bc.Query("query", `{"Name":"query", "Args":["key1"]}`, "", "5") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("query", `{"Name":"query", "Args":["key1"]}`, "", "3") - require.NoErrorf(t, err, "failed to query") + err = bc.DisConnectBlock() + require.NoErrorf(t, err, "failed to disconnect block") - err = bc.DisConnectBlock() - require.NoErrorf(t, err, "failed to disconnect block") + err = bc.Query("query", `{"Name":"query", "Args":["key1"]}`, "", "3") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("query", `{"Name":"query", "Args":["key1"]}`, "", "1") - require.NoErrorf(t, err, "failed to query") + err = bc.DisConnectBlock() + require.NoErrorf(t, err, "failed to disconnect block") - err = bc.ConnectBlock(NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`)) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.Query("query", `{"Name":"query", "Args":["key1"]}`, "", "1") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("query", `{"Name":"query", "Args":["key1"]}`, "", "2") - require.NoErrorf(t, err, "failed to query") + err = bc.ConnectBlock(NewLuaTxCall("user1", "query", 0, `{"Name":"inc", "Args":[]}`)) + require.NoErrorf(t, err, "failed to connect new block") + + err = bc.Query("query", `{"Name":"query", "Args":["key1"]}`, "", "2") + require.NoErrorf(t, err, "failed to query") + + } } func TestAbi(t *testing.T) { - codeNoAbi := readLuaCode("abi_no.lua") - require.NotEmpty(t, codeNoAbi, "failed to read abi_no.lua") - codeEmpty := readLuaCode("abi_empty.lua") - require.NotEmpty(t, codeEmpty, "failed to read abi_empty.lua") - codeLocalFunc := readLuaCode("abi_localfunc.lua") - require.NotEmpty(t, codeLocalFunc, "failed to read abi_localfunc.lua") + codeNoAbi := readLuaCode(t, "abi_no.lua") + codeEmpty := readLuaCode(t, "abi_empty.lua") + codeLocalFunc := readLuaCode(t, "abi_localfunc.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() + + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "a", 0, codeNoAbi)) + require.Errorf(t, err, fmt.Sprintf("expected err : %s, buf got nil", "no exported functions")) + require.Containsf(t, err.Error(), "no exported functions", "not contains error message") - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "a", 0, codeNoAbi)) - require.Errorf(t, err, fmt.Sprintf("expected err : %s, buf got nil", "no exported functions")) - require.Containsf(t, err.Error(), "no exported functions", "not contains error message") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "a", 0, codeEmpty)) + require.Errorf(t, err, fmt.Sprintf("expected err : %s, buf got nil", "no exported functions.")) + require.Containsf(t, err.Error(), "no exported functions.", "not contains error message") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "a", 0, codeEmpty)) - require.Errorf(t, err, fmt.Sprintf("expected err : %s, buf got nil", "no exported functions.")) - require.Containsf(t, err.Error(), "no exported functions.", "not contains error message") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "a", 0, codeLocalFunc)) + require.Errorf(t, err, fmt.Sprintf("expected err : %s, buf got nil", "global function expected")) + require.Containsf(t, err.Error(), "global function expected", "not contains error message") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "a", 0, codeLocalFunc)) - require.Errorf(t, err, fmt.Sprintf("expected err : %s, buf got nil", "global function expected")) - require.Containsf(t, err.Error(), "global function expected", "not contains error message") + } } func TestGetABI(t *testing.T) { - code := readLuaCode("getabi.lua") - require.NotEmpty(t, code, "failed to read getabi.lua") + code := readLuaCode(t, "getabi.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() + + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "hello", 0, code)) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "hello", 0, code)) - require.NoErrorf(t, err, "failed to connect new block") + abi, err := bc.GetABI("hello") + require.NoErrorf(t, err, "failed to get abi") - abi, err := bc.GetABI("hello") - require.NoErrorf(t, err, "failed to get abi") + jsonAbi, err := json.Marshal(abi) + require.NoErrorf(t, err, "failed to marshal abi") + require.Equalf(t, `{"version":"0.2","language":"lua","functions":[{"name":"hello","arguments":[{"name":"say"}]}],"state_variables":[{"name":"Say","type":"value"}]}`, string(jsonAbi), "not equal abi") - jsonAbi, err := json.Marshal(abi) - require.NoErrorf(t, err, "failed to marshal abi") - require.Equalf(t, `{"version":"0.2","language":"lua","functions":[{"name":"hello","arguments":[{"name":"say"}]}],"state_variables":[{"name":"Say","type":"value"}]}`, string(jsonAbi), "not equal abi") + } } func TestPayable(t *testing.T) { - code := readLuaCode("payable.lua") - require.NotEmpty(t, code, "failed to read payable.lua") + code := readLuaCode(t, "payable.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "payable", 1, code)) - require.Errorf(t, err, "expected: 'constructor' is not payable") - require.Containsf(t, err.Error(), "'constructor' is not payable", "not contains error message") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "payable", 1, code)) + require.Errorf(t, err, "expected: 'constructor' is not payable") + require.Containsf(t, err.Error(), "'constructor' is not payable", "not contains error message") - err = bc.ConnectBlock(NewLuaTxCall("user1", "payable", 0, `{"Name":"save", "Args": ["blahblah"]}`).Fail("not found contract")) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "payable", 0, `{"Name":"save", "Args": ["blahblah"]}`).Fail("not found contract")) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "payable", 0, code), NewLuaTxCall("user1", "payable", 0, `{"Name":"save", "Args": ["blahblah"]}`)) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "payable", 0, code), NewLuaTxCall("user1", "payable", 0, `{"Name":"save", "Args": ["blahblah"]}`)) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.Query("payable", `{"Name":"load"}`, "", `"blahblah"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("payable", `{"Name":"load"}`, "", `"blahblah"`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "payable", 1, `{"Name":"save", "Args": ["payed"]}`)) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "payable", 1, `{"Name":"save", "Args": ["payed"]}`)) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.Query("payable", `{"Name":"load"}`, "", `"payed"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("payable", `{"Name":"load"}`, "", `"payed"`) + require.NoErrorf(t, err, "failed to query") + + } } func TestDefault(t *testing.T) { - code := readLuaCode("default.lua") - require.NotEmpty(t, code, "failed to read default.lua") + code := readLuaCode(t, "default.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "default", 0, code), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "default", 0, code), + ) + require.NoErrorf(t, err, "failed to connect new block") - tx := NewLuaTxCall("user1", "default", 0, "") - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to connect new block") + tx := NewLuaTxCall("user1", "default", 0, "") + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to connect new block") - receipt := bc.GetReceipt(tx.Hash()) - require.Equalf(t, `"default"`, receipt.GetRet(), "contract Call ret error") + receipt := bc.GetReceipt(tx.Hash()) + require.Equalf(t, `"default"`, receipt.GetRet(), "contract Call ret error") - err = bc.ConnectBlock(NewLuaTxCall("user1", "default", 1, "").Fail(`'default' is not payable`)) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "default", 1, "").Fail(`'default' is not payable`)) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.Query("default", `{"Name":"a"}`, "not found function: a", "") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("default", `{"Name":"a"}`, "not found function: a", "") + require.NoErrorf(t, err, "failed to query") + + } } func TestReturn(t *testing.T) { - code := readLuaCode("return_1.lua") - require.NotEmpty(t, code, "failed to read return_1.lua") - code2 := readLuaCode("return_2.lua") - require.NotEmpty(t, code, "failed to read return_2.lua") + code := readLuaCode(t, "return_1.lua") + code2 := readLuaCode(t, "return_2.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "return_num", 0, code), - NewLuaTxCall("user1", "return_num", 0, `{"Name":"return_num", "Args":[]}`), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "return_num", 0, code), + NewLuaTxCall("user1", "return_num", 0, `{"Name":"return_num", "Args":[]}`), + ) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.Query("return_num", `{"Name":"return_num", "Args":[]}`, "", "10") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("return_num", `{"Name":"return_num", "Args":[]}`, "", "10") + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "foo", 0, code2)) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "foo", 0, code2)) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.Query("foo", `{"Name":"foo", "Args":[]}`, "", "[1,2,3]") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("foo", `{"Name":"foo", "Args":[]}`, "", "[1,2,3]") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("foo", `{"Name":"foo2", "Args":["foo314"]}`, "", `"foo314"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("foo", `{"Name":"foo2", "Args":["foo314"]}`, "", `"foo314"`) + require.NoErrorf(t, err, "failed to query") + + } } func TestReturnUData(t *testing.T) { - code := readLuaCode("return_udata.lua") - require.NotEmpty(t, code, "failed to read return_udata.lua") + code := readLuaCode(t, "return_udata.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "rs-return", 0, code), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "rs-return", 0, code), + ) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxCall("user1", "rs-return", 0, `{"Name": "test_die", "Args":[]}`).Fail(`unsupport type: userdata`)) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "rs-return", 0, `{"Name": "test_die", "Args":[]}`).Fail(`unsupport type: userdata`)) + require.NoErrorf(t, err, "failed to connect new block") + + } } func TestEvent(t *testing.T) { - code := readLuaCode("event.lua") - require.NotEmpty(t, code, "failed to read event.lua") + code := readLuaCode(t, "event.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "event", 0, code), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "event", 0, code), + ) + require.NoErrorf(t, err, "failed to connect new block") + + err = bc.ConnectBlock(NewLuaTxCall("user1", "event", 0, `{"Name": "test_ev", "Args":[]}`)) + require.NoErrorf(t, err, "failed to connect new block") + + } - err = bc.ConnectBlock(NewLuaTxCall("user1", "event", 0, `{"Name": "test_ev", "Args":[]}`)) - require.NoErrorf(t, err, "failed to connect new block") } func TestView(t *testing.T) { - code := readLuaCode("view.lua") - require.NotEmpty(t, code, "failed to read view.lua") + code := readLuaCode(t, "view.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "view", 0, code), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "view", 0, code), + ) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "test_view", "Args":[]}`).Fail("[Contract.Event] event not permitted in query")) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "test_view", "Args":[]}`).Fail("[Contract.Event] event not permitted in query")) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.Query("view", `{"Name":"k", "Args":[10]}`, "", "10") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("view", `{"Name":"k", "Args":[10]}`, "", "10") + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "tx_in_view_function", "Args":[]}`).Fail("[Contract.Event] event not permitted in query")) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "tx_in_view_function", "Args":[]}`).Fail("[Contract.Event] event not permitted in query")) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "tx_after_view_function", "Args":[]}`)) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "tx_after_view_function", "Args":[]}`)) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "k2", "Args":[]}`).Fail("[Contract.Event] event not permitted in query")) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "k2", "Args":[]}`).Fail("[Contract.Event] event not permitted in query")) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "k3", "Args":[]}`)) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "k3", "Args":[]}`)) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "sqltest", "Args":[]}`).Fail("not permitted in view function")) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "view", 0, `{"Name": "sqltest", "Args":[]}`).Fail("not permitted in view function")) + require.NoErrorf(t, err, "failed to connect new block") + + } } func TestDeploy(t *testing.T) { - code := readLuaCode("deploy.lua") - require.NotEmpty(t, code, "failed to read deploy.lua") + code := readLuaCode(t, "deploy.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "deploy", uint64(types.Aergo/2), code), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "deploy", uint64(types.Aergo/2), code), + ) + require.NoErrorf(t, err, "failed to connect new block") - tx := NewLuaTxCall("user1", "deploy", 0, `{"Name":"hello"}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to connect new block") + tx := NewLuaTxCall("user1", "deploy", 0, `{"Name":"hello"}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to connect new block") - receipt := bc.GetReceipt(tx.Hash()) - assert.Equalf(t, `["AmgKtCaGjH4XkXwny2Jb1YH5gdsJGJh78ibWEgLmRWBS5LMfQuTf","Hello world"]`, receipt.GetRet(), "contract Call ret error") + receipt := bc.GetReceipt(tx.Hash()) + assert.Equalf(t, `["AmgKtCaGjH4XkXwny2Jb1YH5gdsJGJh78ibWEgLmRWBS5LMfQuTf","Hello world"]`, receipt.GetRet(), "contract Call ret error") - err = bc.Query("deploy", `{"Name":"helloQuery", "Args":["AmgKtCaGjH4XkXwny2Jb1YH5gdsJGJh78ibWEgLmRWBS5LMfQuTf"]}`, "", `"Hello world"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("deploy", `{"Name":"helloQuery", "Args":["AmgKtCaGjH4XkXwny2Jb1YH5gdsJGJh78ibWEgLmRWBS5LMfQuTf"]}`, "", `"Hello world"`) + require.NoErrorf(t, err, "failed to query") - tx = NewLuaTxCall("user1", "deploy", 0, `{"Name":"testConst"}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to connect new block") + tx = NewLuaTxCall("user1", "deploy", 0, `{"Name":"testConst"}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to connect new block") - receipt = bc.GetReceipt(tx.Hash()) - assert.Equalf(t, `["Amhmj6kKZz7mPstBAPJWRe1e8RHP7bZ5pV35XatqTHMWeAVSyMkc","Hello world2"]`, receipt.GetRet(), "contract Call ret error") + receipt = bc.GetReceipt(tx.Hash()) + assert.Equalf(t, `["Amhmj6kKZz7mPstBAPJWRe1e8RHP7bZ5pV35XatqTHMWeAVSyMkc","Hello world2"]`, receipt.GetRet(), "contract Call ret error") - deployAcc, err := bc.GetAccountState("deploy") - require.NoErrorf(t, err, "failed to get account state") - assert.Equalf(t, int64(types.Aergo/2-100), deployAcc.GetBalanceBigInt().Int64(), "not same balance") + deployAcc, err := bc.GetAccountState("deploy") + require.NoErrorf(t, err, "failed to get account state") + assert.Equalf(t, int64(types.Aergo/2-100), deployAcc.GetBalanceBigInt().Int64(), "not same balance") - deployAcc, err = bc.GetAccountState("deploy") - require.NoErrorf(t, err, "failed to get account state") + deployAcc, err = bc.GetAccountState("deploy") + require.NoErrorf(t, err, "failed to get account state") - tx = NewLuaTxCall("user1", "deploy", 0, `{"Name":"testFail"}`) - err = bc.ConnectBlock(tx) - require.Errorf(t, err, "expect err : `constructor` is not payable") + tx = NewLuaTxCall("user1", "deploy", 0, `{"Name":"testFail"}`) + err = bc.ConnectBlock(tx) + require.Errorf(t, err, "expect err : `constructor` is not payable") - deployAcc, err = bc.GetAccountState("deploy") - require.NoErrorf(t, err, "failed to get account state") - assert.Equalf(t, int64(2), int64(deployAcc.Nonce), "not same nonce") + deployAcc, err = bc.GetAccountState("deploy") + require.NoErrorf(t, err, "failed to get account state") + assert.Equalf(t, int64(2), int64(deployAcc.Nonce), "not same nonce") - tx = NewLuaTxCall("user1", "deploy", 0, `{"Name":"testPcall"}`) - err = bc.ConnectBlock(tx) - require.Errorf(t, err, "expect err : cannot find contract Amhs9v8EeAAWrrvEFrvMng4UksHRsR7wN1iLqKkXw5bqMV18JP3h") + tx = NewLuaTxCall("user1", "deploy", 0, `{"Name":"testPcall"}`) + err = bc.ConnectBlock(tx) + require.Errorf(t, err, "expect err : cannot find contract Amhs9v8EeAAWrrvEFrvMng4UksHRsR7wN1iLqKkXw5bqMV18JP3h") - deployAcc, err = bc.GetAccountState("deploy") - require.NoErrorf(t, err, "failed to get account state") - assert.Equalf(t, int64(2), int64(deployAcc.Nonce), "nonce rollback failed") + deployAcc, err = bc.GetAccountState("deploy") + require.NoErrorf(t, err, "failed to get account state") + assert.Equalf(t, int64(2), int64(deployAcc.Nonce), "nonce rollback failed") - receipt = bc.GetReceipt(tx.Hash()) - assert.Containsf(t, receipt.GetRet(), "cannot find contract", "contract Call ret error") + receipt = bc.GetReceipt(tx.Hash()) + assert.Containsf(t, receipt.GetRet(), "cannot find contract", "contract Call ret error") + + } } func TestDeploy2(t *testing.T) { - code := readLuaCode("deploy2.lua") - require.NotEmpty(t, code, "failed to read deploy2.lua") + code := readLuaCode(t, "deploy2.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - oneAergo := types.NewAmount(1, types.Aergo) - halfAergo := new(big.Int).Div(oneAergo, big.NewInt(2)) + oneAergo := types.NewAmount(1, types.Aergo) + halfAergo := new(big.Int).Div(oneAergo, big.NewInt(2)) - err = bc.ConnectBlock( - NewLuaTxAccountBig("user1", oneAergo), - NewLuaTxDeployBig("user1", "deploy", halfAergo, code), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccountBig("user1", oneAergo), + NewLuaTxDeployBig("user1", "deploy", halfAergo, code), + ) + require.NoErrorf(t, err, "failed to connect new block") + + tx := NewLuaTxCall("user1", "deploy", 0, `{"Name":"hello"}`).Fail(`not permitted state referencing at global scope`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to connect new block") + + } - tx := NewLuaTxCall("user1", "deploy", 0, `{"Name":"hello"}`).Fail(`not permitted state referencing at global scope`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to connect new block") } func TestNDeploy(t *testing.T) { - code := readLuaCode("deployn.lua") - require.NotEmpty(t, code, "failed to read deployn.lua") + code := readLuaCode(t, "deployn.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "n-deploy", 0, code), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "n-deploy", 100000, code), + NewLuaTxCall("user1", "n-deploy", 200000, `{"Name":"testall"}`), + ) + require.NoErrorf(t, err, "failed to connect new block") + + } } func xestInfiniteLoop(t *testing.T) { - code := readLuaCode("infiniteloop.lua") - require.NotEmpty(t, code, "failed to read infiniteloop.lua") + code := readLuaCode(t, "infiniteloop.lua") - bc, err := LoadDummyChain(SetTimeout(50)) - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetTimeout(50), SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "loop", 0, code), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "loop", 0, code), + ) + require.NoErrorf(t, err, "failed to connect new block") - errTimeout := "exceeded the maximum instruction count" + errTimeout := "exceeded the maximum instruction count" - err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"infiniteLoop"}`)) - require.Errorf(t, err, "expected: %v", errTimeout) - require.Containsf(t, err.Error(), errTimeout, "not contain timeout error") + err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"infiniteLoop"}`)) + require.Errorf(t, err, "expected: %v", errTimeout) + require.Containsf(t, err.Error(), errTimeout, "not contain timeout error") - err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"catch"}`)) - require.Errorf(t, err, "expected: %v", errTimeout) - require.Containsf(t, err.Error(), errTimeout, "not contain timeout error") + err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"catch"}`)) + require.Errorf(t, err, "expected: %v", errTimeout) + require.Containsf(t, err.Error(), errTimeout, "not contain timeout error") - err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"contract_catch"}`)) - require.Errorf(t, err, "expected: %v", errTimeout) - require.Containsf(t, err.Error(), errTimeout, "not contain timeout error") + err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"contract_catch"}`)) + require.Errorf(t, err, "expected: %v", errTimeout) + require.Containsf(t, err.Error(), errTimeout, "not contain timeout error") - err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"infiniteCall"}`).Fail("stack overflow")) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"infiniteCall"}`).Fail("stack overflow")) + require.NoErrorf(t, err, "failed to connect new block") + + } } func TestInfiniteLoopOnPubNet(t *testing.T) { - code := readLuaCode("infiniteloop.lua") - require.NotEmpty(t, code, "failed to read infiniteloop.lua") + code := readLuaCode(t, "infiniteloop.lua") - bc, err := LoadDummyChain(SetTimeout(50), SetPubNet()) - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetTimeout(50), SetPubNet(), SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "loop", 0, code), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "loop", 0, code), + ) + require.NoErrorf(t, err, "failed to connect new block") - errTimeout := contract.VmTimeoutError{} + errTimeout := contract.VmTimeoutError{} - err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"infiniteLoop"}`)) - require.Errorf(t, err, "expected: %v", errTimeout) - require.Containsf(t, err.Error(), errTimeout.Error(), "not contain timeout error") + err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"infiniteLoop"}`)) + require.Errorf(t, err, "expected: %v", errTimeout) + require.Containsf(t, err.Error(), errTimeout.Error(), "not contain timeout error") - err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"catch"}`)) - require.Errorf(t, err, "expected: %v", errTimeout) - require.Containsf(t, err.Error(), errTimeout.Error(), "not contain timeout error") + err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"catch"}`)) + require.Errorf(t, err, "expected: %v", errTimeout) + require.Containsf(t, err.Error(), errTimeout.Error(), "not contain timeout error") - err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"contract_catch"}`)) - require.Errorf(t, err, "expected: %v", errTimeout) - require.Containsf(t, err.Error(), errTimeout.Error(), "not contain timeout error") + err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"contract_catch"}`)) + require.Errorf(t, err, "expected: %v", errTimeout) + require.Containsf(t, err.Error(), errTimeout.Error(), "not contain timeout error") - err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"infiniteCall"}`).Fail("stack overflow")) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "loop", 0, `{"Name":"infiniteCall"}`).Fail("stack overflow")) + require.NoErrorf(t, err, "failed to connect new block") + } } func TestUpdateSize(t *testing.T) { - code := readLuaCode("updatesize.lua") - require.NotEmpty(t, code, "failed to read updatesize.lua") + code := readLuaCode(t, "updatesize.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "loop", 0, code), - NewLuaTxCall("user1", "loop", 0, `{"Name":"infiniteLoop"}`), - ) - errMsg := "exceeded size of updates in the state database" - require.Errorf(t, err, "expected: %s", errMsg) - require.Containsf(t, err.Error(), errMsg, "error message not same as expected") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "loop", 0, code), + NewLuaTxCall("user1", "loop", 0, `{"Name":"infiniteLoop"}`), + ) + errMsg := "exceeded size of updates in the state database" + require.Errorf(t, err, "expected: %s", errMsg) + require.Containsf(t, err.Error(), errMsg, "error message not same as expected") + + } } func TestTimeoutCnt(t *testing.T) { - code := readLuaCode("timeout_1.lua") - require.NotEmpty(t, code, "failed to read timeout_1.lua") + code := readLuaCode(t, "timeout_1.lua") + code2 := readLuaCode(t, "timeout_2.lua") - code2 := readLuaCode("timeout_2.lua") - require.NotEmpty(t, code, "failed to read timeout_2.lua") + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetTimeout(500), SetPubNet(), SetHardForkVersion(version)) // timeout 500 milliseconds + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - bc, err := LoadDummyChain(SetTimeout(500), SetPubNet()) // timeout 500 milliseconds - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "timeout-cnt", 0, code), + ) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "timeout-cnt", 0, code), - ) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.ConnectBlock(NewLuaTxCall("user1", "timeout-cnt", 0, `{"Name": "infinite_loop"}`).Fail("contract timeout")) + require.NoErrorf(t, err, "failed to connect new block") - err = bc.ConnectBlock(NewLuaTxCall("user1", "timeout-cnt", 0, `{"Name": "infinite_loop"}`).Fail("contract timeout")) - require.NoErrorf(t, err, "failed to connect new block") + err = bc.Query("timeout-cnt", `{"Name": "infinite_loop"}`, "exceeded the maximum instruction count") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("timeout-cnt", `{"Name": "infinite_loop"}`, "exceeded the maximum instruction count") - require.NoErrorf(t, err, "failed to query") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "timeout-cnt2", 0, code2)) + require.NoErrorf(t, err, "failed to deploy new tx") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "timeout-cnt2", 0, code2)) - require.NoErrorf(t, err, "failed to deploy new tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "timeout-cnt2", 0, `{"Name": "a"}`).Fail("contract timeout")) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "timeout-cnt2", 0, `{"Name": "a"}`).Fail("contract timeout")) - require.NoErrorf(t, err, "failed to call tx") + } } func TestSnapshot(t *testing.T) { - code := readLuaCode("snapshot.lua") - require.NotEmpty(t, code, "failed to read snapshot.lua") + code := readLuaCode(t, "snapshot.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "snap", 0, code), - ) - require.NoErrorf(t, err, "failed to deploy contract") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "snap", 0, code), + ) + require.NoErrorf(t, err, "failed to deploy contract") - err = bc.ConnectBlock(NewLuaTxCall("user1", "snap", 0, `{"Name": "inc", "Args":[]}`)) - assert.NoErrorf(t, err, "failed to call contract") + err = bc.ConnectBlock(NewLuaTxCall("user1", "snap", 0, `{"Name": "inc", "Args":[]}`)) + assert.NoErrorf(t, err, "failed to call contract") - err = bc.ConnectBlock(NewLuaTxCall("user1", "snap", 0, `{"Name": "inc", "Args":[]}`)) - assert.NoErrorf(t, err, "failed to call contract") + err = bc.ConnectBlock(NewLuaTxCall("user1", "snap", 0, `{"Name": "inc", "Args":[]}`)) + assert.NoErrorf(t, err, "failed to call contract") - err = bc.ConnectBlock(NewLuaTxCall("user1", "snap", 0, `{"Name": "inc", "Args":[]}`)) - assert.NoErrorf(t, err, "failed to call contract") + err = bc.ConnectBlock(NewLuaTxCall("user1", "snap", 0, `{"Name": "inc", "Args":[]}`)) + assert.NoErrorf(t, err, "failed to call contract") - err = bc.Query("snap", `{"Name":"query"}`, "", "[3,3,3,3]") - assert.NoErrorf(t, err, "failed to query") + err = bc.Query("snap", `{"Name":"query"}`, "", "[3,3,3,3]") + assert.NoErrorf(t, err, "failed to query") - err = bc.Query("snap", `{"Name":"query", "Args":[2]}`, "", "[1,null,null,null]") - assert.NoErrorf(t, err, "failed to query") + err = bc.Query("snap", `{"Name":"query", "Args":[2]}`, "", "[1,null,null,null]") + assert.NoErrorf(t, err, "failed to query") - err = bc.Query("snap", `{"Name":"query", "Args":[3]}`, "", "[2,2,2,2]") - assert.NoErrorf(t, err, "failed to query") + err = bc.Query("snap", `{"Name":"query", "Args":[3]}`, "", "[2,2,2,2]") + assert.NoErrorf(t, err, "failed to query") - err = bc.Query("snap", `{"Name":"query2", "Args":[]}`, "invalid argument at getsnap, need (state.array, index, blockheight)", "") - assert.NoErrorf(t, err, "failed to query") + err = bc.Query("snap", `{"Name":"query2", "Args":[]}`, "invalid argument at getsnap, need (state.array, index, blockheight)", "") + assert.NoErrorf(t, err, "failed to query") + + } } func TestKvstore(t *testing.T) { - code := readLuaCode("kvstore.lua") - require.NotEmpty(t, code, "failed to read kvstore.lua") + code := readLuaCode(t, "kvstore.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "map", 0, code), - ) - require.NoErrorf(t, err, "failed to deploy contract") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "map", 0, code), + ) + require.NoErrorf(t, err, "failed to deploy contract") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "map", 0, `{"Name":"inc", "Args":["user1"]}`), - NewLuaTxCall("user1", "map", 0, `{"Name":"setname", "Args":["eve2adam"]}`), - ) - require.NoErrorf(t, err, "failed to call contract") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "map", 0, `{"Name":"inc", "Args":["user1"]}`), + NewLuaTxCall("user1", "map", 0, `{"Name":"setname", "Args":["eve2adam"]}`), + ) + require.NoErrorf(t, err, "failed to call contract") - err = bc.ConnectBlock() - require.NoErrorf(t, err, "failed to new block") + err = bc.ConnectBlock() + require.NoErrorf(t, err, "failed to new block") - err = bc.Query("map", `{"Name":"get", "Args":["user1"]}`, "", "1") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("map", `{"Name":"get", "Args":["user1"]}`, "", "1") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("map", `{"Name":"get", "Args":["htwo"]}`, "", "null") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("map", `{"Name":"get", "Args":["htwo"]}`, "", "null") + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "map", 0, `{"Name":"inc", "Args":["user1"]}`), - NewLuaTxCall("user1", "map", 0, `{"Name":"inc", "Args":["htwo"]}`), - NewLuaTxCall("user1", "map", 0, `{"Name":"set", "Args":["wook", 100]}`), - ) - require.NoErrorf(t, err, "failed to call contract") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "map", 0, `{"Name":"inc", "Args":["user1"]}`), + NewLuaTxCall("user1", "map", 0, `{"Name":"inc", "Args":["htwo"]}`), + NewLuaTxCall("user1", "map", 0, `{"Name":"set", "Args":["wook", 100]}`), + ) + require.NoErrorf(t, err, "failed to call contract") - err = bc.Query("map", `{"Name":"get", "Args":["user1"]}`, "", "2") - assert.NoErrorf(t, err, "failed to query") + err = bc.Query("map", `{"Name":"get", "Args":["user1"]}`, "", "2") + assert.NoErrorf(t, err, "failed to query") - err = bc.Query("map", `{"Name":"get", "Args":["htwo"]}`, "", "1") - assert.NoErrorf(t, err, "failed to query") + err = bc.Query("map", `{"Name":"get", "Args":["htwo"]}`, "", "1") + assert.NoErrorf(t, err, "failed to query") - err = bc.Query("map", `{"Name":"get", "Args":["wook"]}`, "", "100") - assert.NoErrorf(t, err, "failed to query") + err = bc.Query("map", `{"Name":"get", "Args":["wook"]}`, "", "100") + assert.NoErrorf(t, err, "failed to query") - err = bc.Query("map", `{"Name":"getname"}`, "", `"eve2adam"`) - assert.NoErrorf(t, err, "failed to query") + err = bc.Query("map", `{"Name":"getname"}`, "", `"eve2adam"`) + assert.NoErrorf(t, err, "failed to query") + + } } // sql tests func TestSqlConstrains(t *testing.T) { - code := readLuaCode("sql_constrains.lua") - require.NotEmpty(t, code, "failed to read sql_constrains.lua") + code := readLuaCode(t, "sql_constrains.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "constraint", 0, code), - NewLuaTxCall("user1", "constraint", 0, `{"Name":"init"}`), - NewLuaTxCall("user1", "constraint", 0, `{"Name":"pkFail"}`).Fail("UNIQUE constraint failed: r.id"), - NewLuaTxCall("user1", "constraint", 0, `{"Name":"checkFail"}`).Fail("CHECK constraint failed: r"), - NewLuaTxCall("user1", "constraint", 0, `{"Name":"fkFail"}`).Fail("FOREIGN KEY constraint failed"), - NewLuaTxCall("user1", "constraint", 0, `{"Name":"notNullFail"}`).Fail("NOT NULL constraint failed: r.nonull"), - NewLuaTxCall("user1", "constraint", 0, `{"Name":"uniqueFail"}`).Fail("UNIQUE constraint failed: r.only"), - ) - require.NoErrorf(t, err, "failed to call contract") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "constraint", 0, code), + NewLuaTxCall("user1", "constraint", 0, `{"Name":"init"}`), + NewLuaTxCall("user1", "constraint", 0, `{"Name":"pkFail"}`).Fail("UNIQUE constraint failed: r.id"), + NewLuaTxCall("user1", "constraint", 0, `{"Name":"checkFail"}`).Fail("CHECK constraint failed: r"), + NewLuaTxCall("user1", "constraint", 0, `{"Name":"fkFail"}`).Fail("FOREIGN KEY constraint failed"), + NewLuaTxCall("user1", "constraint", 0, `{"Name":"notNullFail"}`).Fail("NOT NULL constraint failed: r.nonull"), + NewLuaTxCall("user1", "constraint", 0, `{"Name":"uniqueFail"}`).Fail("UNIQUE constraint failed: r.only"), + ) + require.NoErrorf(t, err, "failed to call contract") + + } } func TestSqlAutoincrement(t *testing.T) { - code := readLuaCode("sql_autoincrement.lua") - require.NotEmpty(t, code, "failed to read sql_autoincrement.lua") + code := readLuaCode(t, "sql_autoincrement.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "auto", 0, code), - NewLuaTxCall("user1", "auto", 0, `{"Name":"init"}`), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "auto", 0, code), + NewLuaTxCall("user1", "auto", 0, `{"Name":"init"}`), + ) + require.NoErrorf(t, err, "failed to deploy") - tx := NewLuaTxCall("user1", "auto", 0, `{"Name":"get"}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx := NewLuaTxCall("user1", "auto", 0, `{"Name":"get"}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") + + } } func TestSqlOnConflict(t *testing.T) { - code := readLuaCode("sql_onconflict.lua") - require.NotEmpty(t, code, "failed to read sql_onconflict.lua") + code := readLuaCode(t, "sql_onconflict.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "on_conflict", 0, code), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "on_conflict", 0, code), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["insert into t values (2)"]}`), - NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["insert into t values (3),(2),(4)"]}`).Fail(`UNIQUE constraint failed: t.col`), - ) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["insert into t values (2)"]}`), + NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["insert into t values (3),(2),(4)"]}`).Fail(`UNIQUE constraint failed: t.col`), + ) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("on_conflict", `{"name":"get"}`, "", `[1,2]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("on_conflict", `{"name":"get"}`, "", `[1,2]`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["replace into t values (2)"]}`), - NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["insert or ignore into t values (3),(2),(4)"]}`), - ) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["replace into t values (2)"]}`), + NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["insert or ignore into t values (3),(2),(4)"]}`), + ) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("on_conflict", `{"name":"get"}`, "", `[1,2,3,4]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("on_conflict", `{"name":"get"}`, "", `[1,2,3,4]`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["insert into t values (5)"]}`), - NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["insert or rollback into t values (5)"]}`).Fail("syntax error"), - ) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["insert into t values (5)"]}`), + NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec", "args": ["insert or rollback into t values (5)"]}`).Fail("syntax error"), + ) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("on_conflict", `{"name":"get"}`, "", `[1,2,3,4,5]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("on_conflict", `{"name":"get"}`, "", `[1,2,3,4,5]`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec_pcall", "args": ["insert or fail into t values (6),(7),(5),(8),(9)"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "on_conflict", 0, `{"name":"stmt_exec_pcall", "args": ["insert or fail into t values (6),(7),(5),(8),(9)"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("on_conflict", `{"name":"get"}`, "", `[1,2,3,4,5,6,7]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("on_conflict", `{"name":"get"}`, "", `[1,2,3,4,5,6,7]`) + require.NoErrorf(t, err, "failed to query") + + } } func TestSqlDupCol(t *testing.T) { - code := readLuaCode("sql_dupcol.lua") - require.NotEmpty(t, code, "failed to read sql_dupcol.lua") + code := readLuaCode(t, "sql_dupcol.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "dup_col", 0, code), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "dup_col", 0, code), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.Query("dup_col", `{"name":"get"}`, `too many duplicate column name "1+1", max: 5`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("dup_col", `{"name":"get"}`, `too many duplicate column name "1+1", max: 5`) + require.NoErrorf(t, err, "failed to query") + + } } func TestSqlVmSimple(t *testing.T) { - code := readLuaCode("sql_vm_simple.lua") - require.NotEmpty(t, code, "failed to read sql_vm_simple.lua") + code := readLuaCode(t, "sql_vm_simple.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "simple-query", 0, code), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "simple-query", 0, code), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "simple-query", 0, `{"Name": "createAndInsert", "Args":[]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "simple-query", 0, `{"Name": "createAndInsert", "Args":[]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("simple-query", `{"Name": "query", "Args":[]}`, "", `[2,3.1,"X Hello Blockchain",2,3.1,"Y Hello Blockchain",2,3.1,"Z Hello Blockchain"]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("simple-query", `{"Name": "query", "Args":[]}`, "", `[2,3.1,"X Hello Blockchain",2,3.1,"Y Hello Blockchain",2,3.1,"Z Hello Blockchain"]`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("simple-query", `{"Name": "count", "Args":[]}`, "", `3`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("simple-query", `{"Name": "count", "Args":[]}`, "", `3`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "simple-query", 0, `{"Name": "createAndInsert", "Args":[]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "simple-query", 0, `{"Name": "createAndInsert", "Args":[]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("simple-query", `{"Name": "count", "Args":[]}`, "", `6`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("simple-query", `{"Name": "count", "Args":[]}`, "", `6`) + require.NoErrorf(t, err, "failed to query") - err = bc.DisConnectBlock() - require.NoErrorf(t, err, "failed to disconnect block") + err = bc.DisConnectBlock() + require.NoErrorf(t, err, "failed to disconnect block") - err = bc.Query("simple-query", `{"Name": "count", "Args":[]}`, "", `3`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("simple-query", `{"Name": "count", "Args":[]}`, "", `3`) + require.NoErrorf(t, err, "failed to query") - err = bc.DisConnectBlock() - require.NoErrorf(t, err, "failed to disconnect block") + err = bc.DisConnectBlock() + require.NoErrorf(t, err, "failed to disconnect block") - err = bc.DisConnectBlock() - require.NoErrorf(t, err, "failed to disconnect block") + err = bc.DisConnectBlock() + require.NoErrorf(t, err, "failed to disconnect block") - // there is only a genesis block - err = bc.Query("simple-query", `{"Name": "count", "Args":[]}`, "not found contract", "") - require.NoErrorf(t, err, "failed to query") + // there is only a genesis block + err = bc.Query("simple-query", `{"Name": "count", "Args":[]}`, "not found contract", "") + require.NoErrorf(t, err, "failed to query") + + } } func TestSqlVmFail(t *testing.T) { - code := readLuaCode("sql_vm_fail.lua") - require.NotEmpty(t, code, "failed to read sql_vm_fail.lua") + code := readLuaCode(t, "sql_vm_fail.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "fail", 0, code), - NewLuaTxCall("user1", "fail", 0, `{"Name":"init"}`), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "fail", 0, code), + NewLuaTxCall("user1", "fail", 0, `{"Name":"init"}`), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "fail", 0, `{"Name":"add", "Args":[1]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "fail", 0, `{"Name":"add", "Args":[1]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "fail", 0, `{"Name":"add", "Args":[2]}`), - NewLuaTxCall("user1", "fail", 0, `{"Name":"addFail", "Args":[3]}`).Fail(`near "set": syntax error`), - NewLuaTxCall("user1", "fail", 0, `{"Name":"add", "Args":[4]}`), - ) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "fail", 0, `{"Name":"add", "Args":[2]}`), + NewLuaTxCall("user1", "fail", 0, `{"Name":"addFail", "Args":[3]}`).Fail(`near "set": syntax error`), + NewLuaTxCall("user1", "fail", 0, `{"Name":"add", "Args":[4]}`), + ) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "fail", 0, `{"Name":"add", "Args":[5]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "fail", 0, `{"Name":"add", "Args":[5]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("fail", `{"Name":"get"}`, "", "12") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("fail", `{"Name":"get"}`, "", "12") + require.NoErrorf(t, err, "failed to query") - err = bc.DisConnectBlock() - require.NoErrorf(t, err, "failed to disconnect block") + err = bc.DisConnectBlock() + require.NoErrorf(t, err, "failed to disconnect block") - err = bc.Query("fail", `{"Name":"get"}`, "", "7") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("fail", `{"Name":"get"}`, "", "7") + require.NoErrorf(t, err, "failed to query") + + } } func TestSqlVmPubNet(t *testing.T) { - code := readLuaCode("sql_vm_pubnet.lua") - require.NotEmpty(t, code, "failed to read sql_vm_pubnet.lua") + code := readLuaCode(t, "sql_vm_pubnet.lua") - bc, err := LoadDummyChain(SetPubNet()) - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetPubNet(), SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "simple-query", 0, code), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "simple-query", 0, code), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "simple-query", 0, `{"Name": "createAndInsert", "Args":[]}`).Fail(`attempt to index global 'db'`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "simple-query", 0, `{"Name": "createAndInsert", "Args":[]}`).Fail(`attempt to index global 'db'`)) + require.NoErrorf(t, err, "failed to call tx") + + } } func TestSqlVmDateTime(t *testing.T) { - code := readLuaCode("sql_vm_datetime.lua") - require.NotEmpty(t, code, "failed to read sql_vm_datetime.lua") + code := readLuaCode(t, "sql_vm_datetime.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "datetime", 0, code), - NewLuaTxCall("user1", "datetime", 0, `{"Name":"init"}`), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "datetime", 0, code), + NewLuaTxCall("user1", "datetime", 0, `{"Name":"init"}`), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "datetime", 0, `{"Name":"nowNull"}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "datetime", 0, `{"Name":"nowNull"}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "datetime", 0, `{"Name":"localtimeNull"}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "datetime", 0, `{"Name":"localtimeNull"}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("datetime", `{"Name":"get"}`, "", `[{"bool":0},{"bool":1},{"bool":1,"date":"1970-01-01 02:46:40"},{"bool":0,"date":"2004-11-23"}]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("datetime", `{"Name":"get"}`, "", `[{"bool":0},{"bool":1},{"bool":1,"date":"1970-01-01 02:46:40"},{"bool":0,"date":"2004-11-23"}]`) + require.NoErrorf(t, err, "failed to query") + + } } func TestSqlVmCustomer(t *testing.T) { - code := readLuaCode("sql_vm_customer.lua") - require.NotEmpty(t, code, "failed to read sql_vm_customer.lua") + code := readLuaCode(t, "sql_vm_customer.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "customer", 0, code), - NewLuaTxCall("user1", "customer", 0, `{"Name":"createTable"}`), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "customer", 0, code), + NewLuaTxCall("user1", "customer", 0, `{"Name":"createTable"}`), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "customer", 0, `{"Name":"insert", "Args":["id1","passwd1","name1","20180524","010-1234-5678"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "customer", 0, `{"Name":"insert", "Args":["id1","passwd1","name1","20180524","010-1234-5678"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "customer", 0, `{"Name":"insert", "Args":["id2","passwd2","name2","20180524","010-1234-5678"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "customer", 0, `{"Name":"insert", "Args":["id2","passwd2","name2","20180524","010-1234-5678"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "customer", 0, `{"Name":"update", "Args":["id2","passwd3"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "customer", 0, `{"Name":"update", "Args":["id2","passwd3"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("customer", `{"Name":"count"}`, "", "2") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("customer", `{"Name":"count"}`, "", "2") + require.NoErrorf(t, err, "failed to query") - err = bc.DisConnectBlock() - require.NoErrorf(t, err, "failed to disconnect block") + err = bc.DisConnectBlock() + require.NoErrorf(t, err, "failed to disconnect block") - err = bc.Query("customer", `{"Name":"query", "Args":["id2"]}`, "", `[{"birth":"20180524","id":"id2","mobile":"010-1234-5678","name":"name2","passwd":"passwd2"}]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("customer", `{"Name":"query", "Args":["id2"]}`, "", `[{"birth":"20180524","id":"id2","mobile":"010-1234-5678","name":"name2","passwd":"passwd2"}]`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "customer", 0, `{"Name":"delete", "Args":["id2"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "customer", 0, `{"Name":"delete", "Args":["id2"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("customer", `{"Name":"query", "Args":["id2"]}`, "", `{}`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("customer", `{"Name":"query", "Args":["id2"]}`, "", `{}`) + require.NoErrorf(t, err, "failed to query") + + } } func TestSqlVmDataType(t *testing.T) { - code := readLuaCode("sql_vm_datatype.lua") - require.NotEmpty(t, code, "failed to read sql_vm_datatype.lua") + code := readLuaCode(t, "sql_vm_datatype.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "datatype", 0, code), - NewLuaTxCall("user1", "datatype", 0, `{"Name":"createDataTypeTable"}`), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "datatype", 0, code), + NewLuaTxCall("user1", "datatype", 0, `{"Name":"createDataTypeTable"}`), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "datatype", 0, `{"Name":"insertDataTypeTable"}`), - NewLuaTxCall("user1", "datatype", 0, `{"Name":"insertDataTypeTable"}`), - NewLuaTxCall("user1", "datatype", 0, `{"Name":"insertDataTypeTable"}`), - ) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "datatype", 0, `{"Name":"insertDataTypeTable"}`), + NewLuaTxCall("user1", "datatype", 0, `{"Name":"insertDataTypeTable"}`), + NewLuaTxCall("user1", "datatype", 0, `{"Name":"insertDataTypeTable"}`), + ) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "datatype", 0, `{"Name":"insertDataTypeTable"}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "datatype", 0, `{"Name":"insertDataTypeTable"}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("datatype", `{"Name":"queryOrderByDesc"}`, "", `[{"blockheight1":3,"char1":"fgh","float1":3.14,"int1":1,"var1":"ABCD"},{"blockheight1":2,"char1":"fgh","float1":3.14,"int1":1,"var1":"ABCD"},{"blockheight1":2,"char1":"fgh","float1":3.14,"int1":1,"var1":"ABCD"},{"blockheight1":2,"char1":"fgh","float1":3.14,"int1":1,"var1":"ABCD"}]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("datatype", `{"Name":"queryOrderByDesc"}`, "", `[{"blockheight1":3,"char1":"fgh","float1":3.14,"int1":1,"var1":"ABCD"},{"blockheight1":2,"char1":"fgh","float1":3.14,"int1":1,"var1":"ABCD"},{"blockheight1":2,"char1":"fgh","float1":3.14,"int1":1,"var1":"ABCD"},{"blockheight1":2,"char1":"fgh","float1":3.14,"int1":1,"var1":"ABCD"}]`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("datatype", `{"Name":"queryGroupByBlockheight1"}`, "", `[{"avg_float1":3.14,"blockheight1":2,"count1":3,"sum_int1":3},{"avg_float1":3.14,"blockheight1":3,"count1":1,"sum_int1":1}]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("datatype", `{"Name":"queryGroupByBlockheight1"}`, "", `[{"avg_float1":3.14,"blockheight1":2,"count1":3,"sum_int1":3},{"avg_float1":3.14,"blockheight1":3,"count1":1,"sum_int1":1}]`) + require.NoErrorf(t, err, "failed to query") + + } } func TestSqlVmFunction(t *testing.T) { - code := readLuaCode("sql_vm_function.lua") - require.NotEmpty(t, code, "failed to read sql_vm_function.lua") + code := readLuaCode(t, "sql_vm_function.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "fns", 0, code), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "fns", 0, code), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.Query("fns", `{"Name":"sql_func"}`, "", `[3,1,6]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("fns", `{"Name":"sql_func"}`, "", `[3,1,6]`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("fns", `{"Name":"abs_func"}`, "", `[1,0,1]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("fns", `{"Name":"abs_func"}`, "", `[1,0,1]`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("fns", `{"Name":"typeof_func"}`, "", `["integer","text","real","null"]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("fns", `{"Name":"typeof_func"}`, "", `["integer","text","real","null"]`) + require.NoErrorf(t, err, "failed to query") + + } } func TestSqlVmBook(t *testing.T) { - code := readLuaCode("sql_vm_book.lua") - require.NotEmpty(t, code, "failed to read sql_vm_book.lua") + code := readLuaCode(t, "sql_vm_book.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "book", 0, code), - NewLuaTxCall("user1", "book", 0, `{"Name":"createTable"}`), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "book", 0, code), + NewLuaTxCall("user1", "book", 0, `{"Name":"createTable"}`), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "book", 0, `{"Name":"makeBook"}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "book", 0, `{"Name":"makeBook"}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "book", 0, `{"Name":"copyBook"}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "book", 0, `{"Name":"copyBook"}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("book", `{"Name":"viewCopyBook"}`, "", `[100,"value=1"]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("book", `{"Name":"viewCopyBook"}`, "", `[100,"value=1"]`) + require.NoErrorf(t, err, "failed to query") + + } } func TestSqlVmDateformat(t *testing.T) { - code := readLuaCode("sql_vm_dateformat.lua") - require.NotEmpty(t, code, "failed to read sql_vm_dateformat.lua") + code := readLuaCode(t, "sql_vm_dateformat.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "data_format", 0, code), - NewLuaTxCall("user1", "data_format", 0, `{"Name":"init"}`), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "data_format", 0, code), + NewLuaTxCall("user1", "data_format", 0, `{"Name":"init"}`), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.Query("data_format", `{"Name":"get"}`, "", `[["2004-10-24","2004-10-24 11:11:11","20041024111111"],["2018-05-28","2018-05-28 10:45:38","20180528104538"]]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("data_format", `{"Name":"get"}`, "", `[["2004-10-24","2004-10-24 11:11:11","20041024111111"],["2018-05-28","2018-05-28 10:45:38","20180528104538"]]`) + require.NoErrorf(t, err, "failed to query") + + } } func TestSqlVmRecursiveData(t *testing.T) { - code := readLuaCode("sql_vm_recursivedata.lua") - require.NotEmpty(t, code, "failed to read sql_vm_recursivedata.lua") + code := readLuaCode(t, "sql_vm_recursivedata.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - tx := NewLuaTxCall("user1", "r", 0, `{"Name":"r"}`) - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "r", 0, code), - tx, - ) - require.Errorf(t, err, "expect err") - require.Equalf(t, "nested table error", err.Error(), "expect err") + tx := NewLuaTxCall("user1", "r", 0, `{"Name":"r"}`) + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "r", 0, code), + tx, + ) + require.Errorf(t, err, "expect err") + require.Equalf(t, "nested table error", err.Error(), "expect err") + + } } func TestSqlJdbc(t *testing.T) { - code := readLuaCode("sql_jdbc.lua") - require.NotEmpty(t, code, "failed to read sql_jdbc.lua") + code := readLuaCode(t, "sql_jdbc.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "jdbc", 0, code), - NewLuaTxCall("user1", "jdbc", 0, `{"Name":"init"}`), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "jdbc", 0, code), + NewLuaTxCall("user1", "jdbc", 0, `{"Name":"init"}`), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.Query("jdbc", `{"Name":"query", "Args":["select a,b,c from total"]}`, "", - `{"colcnt":3,"colmetas":{"colcnt":3,"decltypes":["int","int","text"],"names":["a","b","c"]},"data":[[1,{},"2"],[2,2,"3"],[3,2,"3"],[4,2,"3"],[5,2,"3"],[6,2,"3"],[7,2,"3"]],"rowcnt":7,"snap":"2"}`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("jdbc", `{"Name":"query", "Args":["select a,b,c from total"]}`, "", + `{"colcnt":3,"colmetas":{"colcnt":3,"decltypes":["int","int","text"],"names":["a","b","c"]},"data":[[1,{},"2"],[2,2,"3"],[3,2,"3"],[4,2,"3"],[5,2,"3"],[6,2,"3"],[7,2,"3"]],"rowcnt":7,"snap":"2"}`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("jdbc", `{"Name":"getmeta", "Args":["select a,b,?+1 from total"]}`, "", - `[{"colcnt":3,"decltypes":["int","int",""],"names":["a","b","?+1"]},1]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("jdbc", `{"Name":"getmeta", "Args":["select a,b,?+1 from total"]}`, "", + `[{"colcnt":3,"decltypes":["int","int",""],"names":["a","b","?+1"]},1]`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "jdbc", 0, `{"Name": "exec", "Args":["insert into total values (3,4,5)"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "jdbc", 0, `{"Name": "exec", "Args":["insert into total values (3,4,5)"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("jdbc", `{"Name":"query", "Args":["select a,b,c from total"]}`, "", - `{"colcnt":3,"colmetas":{"colcnt":3,"decltypes":["int","int","text"],"names":["a","b","c"]},"data":[[1,{},"2"],[2,2,"3"],[3,2,"3"],[4,2,"3"],[5,2,"3"],[6,2,"3"],[7,2,"3"],[3,4,"5"]],"rowcnt":8,"snap":"3"}`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("jdbc", `{"Name":"query", "Args":["select a,b,c from total"]}`, "", + `{"colcnt":3,"colmetas":{"colcnt":3,"decltypes":["int","int","text"],"names":["a","b","c"]},"data":[[1,{},"2"],[2,2,"3"],[3,2,"3"],[4,2,"3"],[5,2,"3"],[6,2,"3"],[7,2,"3"],[3,4,"5"]],"rowcnt":8,"snap":"3"}`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("jdbc", `{"Name":"queryS", "Args":["2", "select a,b,c from total"]}`, "", - `{"colcnt":3,"colmetas":{"colcnt":3,"decltypes":["int","int","text"],"names":["a","b","c"]},"data":[[1,{},"2"],[2,2,"3"],[3,2,"3"],[4,2,"3"],[5,2,"3"],[6,2,"3"],[7,2,"3"]],"rowcnt":7,"snap":"3"}`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("jdbc", `{"Name":"queryS", "Args":["2", "select a,b,c from total"]}`, "", + `{"colcnt":3,"colmetas":{"colcnt":3,"decltypes":["int","int","text"],"names":["a","b","c"]},"data":[[1,{},"2"],[2,2,"3"],[3,2,"3"],[4,2,"3"],[5,2,"3"],[6,2,"3"],[7,2,"3"]],"rowcnt":7,"snap":"3"}`) + require.NoErrorf(t, err, "failed to query") + + } } func TestTypeMaxString(t *testing.T) { - code := readLuaCode("type_maxstring.lua") - require.NotEmpty(t, code, "failed to read type_maxstring.lua") + code := readLuaCode(t, "type_maxstring.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "oom", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "oom", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - errMsg := "not enough memory" - err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"oom"}`).Fail(errMsg)) - require.NoErrorf(t, err, "failed to call tx") + errMsg := "not enough memory" + err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"oom"}`).Fail(errMsg)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"p"}`).Fail(errMsg)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"p"}`).Fail(errMsg)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"cp"}`).Fail(errMsg)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"cp"}`).Fail(errMsg)) + require.NoErrorf(t, err, "failed to call tx") + + } } func TestTypeMaxStringOnPubNet(t *testing.T) { - code := readLuaCode("type_maxstring.lua") - require.NotEmpty(t, code, "failed to read type_maxstring.lua") + code := readLuaCode(t, "type_maxstring.lua") - bc, err := LoadDummyChain(SetPubNet()) - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version), SetPubNet()) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "oom", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "oom", 0, code)) + require.NoErrorf(t, err, "failed to deploy") + + errMsg := "string length overflow" + errMsg1 := "not enough memory" + var travis bool + if os.Getenv("TRAVIS") == "true" { + travis = true + } + err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"oom"}`)) + require.Errorf(t, err, "expected: %s", errMsg) + if !strings.Contains(err.Error(), errMsg) && !strings.Contains(err.Error(), errMsg1) { + t.Error(err) + } + err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"p"}`)) + if err != nil && (!travis || !strings.Contains(err.Error(), errMsg1)) { + t.Error(err) + } + err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"cp"}`)) + if err != nil && (!travis || !strings.Contains(err.Error(), errMsg1)) { + t.Error(err) + } - errMsg := "string length overflow" - errMsg1 := "not enough memory" - var travis bool - if os.Getenv("TRAVIS") == "true" { - travis = true - } - err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"oom"}`)) - require.Errorf(t, err, "expected: %s", errMsg) - if !strings.Contains(err.Error(), errMsg) && !strings.Contains(err.Error(), errMsg1) { - t.Error(err) - } - err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"p"}`)) - if err != nil && (!travis || !strings.Contains(err.Error(), errMsg1)) { - t.Error(err) - } - err = bc.ConnectBlock(NewLuaTxCall("user1", "oom", 0, `{"Name":"cp"}`)) - if err != nil && (!travis || !strings.Contains(err.Error(), errMsg1)) { - t.Error(err) } } func TestTypeNsec(t *testing.T) { - code := readLuaCode("type_nsec.lua") - require.NotEmpty(t, code, "failed to read type_nsec.lua") + code := readLuaCode(t, "type_nsec.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "nsec", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "nsec", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "nsec", 0, `{"Name": "test_nsec"}`).Fail(`attempt to call global 'nsec' (a nil value)`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "nsec", 0, `{"Name": "test_nsec"}`).Fail(`attempt to call global 'nsec' (a nil value)`)) + require.NoErrorf(t, err, "failed to call tx") + + } } func TestTypeUtf(t *testing.T) { - code := readLuaCode("type_utf.lua") - require.NotEmpty(t, code, "failed to read type_utf.lua") + code := readLuaCode(t, "type_utf.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "utf", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "utf", 0, code)) + require.NoErrorf(t, err, "failed to deploy") + + err = bc.Query("utf", `{"Name":"query"}`, "", "") + assert.NoErrorf(t, err, "failed to query") - err = bc.Query("utf", `{"Name":"query"}`, "", "") - assert.NoErrorf(t, err, "failed to query") + err = bc.Query("utf", `{"Name":"query2"}`, "", `["E8D4A51000","00"]`) + assert.NoErrorf(t, err, "failed to query") - err = bc.Query("utf", `{"Name":"query2"}`, "", `["E8D4A51000","00"]`) - assert.NoErrorf(t, err, "failed to query") + err = bc.Query("utf", `{"Name":"query3"}`, "bignum not allowed negative value", "") + assert.NoErrorf(t, err, "failed to query") - err = bc.Query("utf", `{"Name":"query3"}`, "bignum not allowed negative value", "") - assert.NoErrorf(t, err, "failed to query") + } } func TestTypeDupVar(t *testing.T) { - code := readLuaCode("type_dupvar_1.lua") - require.NotEmpty(t, code, "failed to read type_dupvar_1.lua") - code2 := readLuaCode("type_dupvar_2.lua") - require.NotEmpty(t, code, "failed to read type_dupvar_2.lua") + code := readLuaCode(t, "type_dupvar_1.lua") + code2 := readLuaCode(t, "type_dupvar_2.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) - require.NoErrorf(t, err, "failed to new tx") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) + require.NoErrorf(t, err, "failed to new tx") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "dupVar", 0, code)) - require.Errorf(t, err, "error expect | duplicated variable: 'Var1'") - if !strings.Contains(err.Error(), "duplicated variable: 'Var1'") { - t.Error(err) - } + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "dupVar", 0, code)) + require.Errorf(t, err, "error expect | duplicated variable: 'Var1'") + if !strings.Contains(err.Error(), "duplicated variable: 'Var1'") { + t.Error(err) + } - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "dupVar1", 0, code2)) - require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "dupVar1", 0, `{"Name": "Work"}`).Fail("duplicated variable: 'Var1'")) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "dupVar1", 0, code2)) + require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxCall("user1", "dupVar1", 0, `{"Name": "Work"}`).Fail("duplicated variable: 'Var1'")) + require.NoErrorf(t, err, "failed to call tx") + + } } func TestTypeByteKey(t *testing.T) { - code := readLuaCode("type_bytekey.lua") - require.NotEmpty(t, code, "failed to read type_bytekey.lua") + code := readLuaCode(t, "type_bytekey.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "bk", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "bk", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.Query("bk", `{"Name":"get"}`, "", `["kk","kk"]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("bk", `{"Name":"get"}`, "", `["kk","kk"]`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("bk", `{"Name":"getcre"}`, "", fmt.Sprintf(`"%s"`, nameToAddress("user1"))) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("bk", `{"Name":"getcre"}`, "", fmt.Sprintf(`"%s"`, nameToAddress("user1"))) + require.NoErrorf(t, err, "failed to query") + + } } func TestTypeArray(t *testing.T) { - code := readLuaCode("type_array.lua") - require.NotEmpty(t, code, "failed to read type_array.lua") + code := readLuaCode(t, "type_array.lua") - code2 := readLuaCode("type_array_overflow.lua") - require.NotEmpty(t, code, "failed to read type_array_overflow.lua") + code2 := readLuaCode(t, "type_array_overflow.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "array", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "array", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[1]}`), - NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[0]}`).Fail("index out of range"), - NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[1]}`), - NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[1.00000001]}`).Fail("integer expected, got number"), - NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":["1"]}`).Fail("integer expected, got string)"), - NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[true]}`).Fail("integer expected, got boolean"), - NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[[1, 2]]}`).Fail("integer expected, got table"), - NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[null]}`).Fail("integer expected, got nil)"), - NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[{}]}`).Fail("integer expected, got table)"), - NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[""]}`).Fail("integer expected, got string)"), - NewLuaTxCall("user1", "array", 0, `{"Name":"set", "Args":[2,"user1"]}`), - ) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[1]}`), + NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[0]}`).Fail("index out of range"), + NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[1]}`), + NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[1.00000001]}`).Fail("integer expected, got number"), + NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":["1"]}`).Fail("integer expected, got string)"), + NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[true]}`).Fail("integer expected, got boolean"), + NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[[1, 2]]}`).Fail("integer expected, got table"), + NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[null]}`).Fail("integer expected, got nil)"), + NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[{}]}`).Fail("integer expected, got table)"), + NewLuaTxCall("user1", "array", 0, `{"Name":"inc", "Args":[""]}`).Fail("integer expected, got string)"), + NewLuaTxCall("user1", "array", 0, `{"Name":"set", "Args":[2,"user1"]}`), + ) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("array", `{"Name":"get", "Args":[11]}`, "index out of range", "") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("array", `{"Name":"get", "Args":[11]}`, "index out of range", "") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("array", `{"Name":"get", "Args":[1]}`, "", "2") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("array", `{"Name":"get", "Args":[1]}`, "", "2") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("array", `{"Name":"get", "Args":[2]}`, "", `"user1"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("array", `{"Name":"get", "Args":[2]}`, "", `"user1"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("array", `{"Name":"len"}`, "", `10`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("array", `{"Name":"len"}`, "", `10`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("array", `{"Name":"iter"}`, "", `[2,"user1","nil","nil","nil","nil","nil","nil","nil","nil"]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("array", `{"Name":"iter"}`, "", `[2,"user1","nil","nil","nil","nil","nil","nil","nil","nil"]`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "overflow", 0, code2)) - errMsg := "integer expected, got number" - require.Errorf(t, err, "expect no error") - require.Containsf(t, err.Error(), errMsg, "err not match") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "overflow", 0, code2)) + errMsg := "integer expected, got number" + require.Errorf(t, err, "expect no error") + require.Containsf(t, err.Error(), errMsg, "err not match") + + } } func TestTypeMultiArray(t *testing.T) { - code := readLuaCode("type_multiarray_1.lua") - require.NotEmpty(t, code, "failed to read type_multiarray_1.lua") + code := readLuaCode(t, "type_multiarray_1.lua") + code2 := readLuaCode(t, "type_multiarray_2.lua") - code2 := readLuaCode("type_multiarray_2.lua") - require.NotEmpty(t, code, "failed to read type_multiarray_2.lua") + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "ma", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "ma", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxCall("user1", "ma", 0, `{"Name": "inc", "Args":[]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "ma", 0, `{"Name": "inc", "Args":[]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "ma", 0, `{"Name": "inc", "Args":[]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "ma", 0, `{"Name": "inc", "Args":[]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.Query("ma", fmt.Sprintf(`{"Name":"query", "Args":["%s"]}`, nameToAddress("user1")), "", "[2,2,2,null,10,11]") + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("ma", fmt.Sprintf(`{"Name":"query", "Args":["%s"]}`, nameToAddress("user1")), "", "[2,2,2,null,10,11]") - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "ma", 0, `{"Name": "del", "Args":[]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "ma", 0, `{"Name": "del", "Args":[]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.Query("ma", fmt.Sprintf(`{"Name":"query", "Args":["%s"]}`, nameToAddress("user1")), "", "[2,2,null,null,10,11]") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("ma", fmt.Sprintf(`{"Name":"query", "Args":["%s"]}`, nameToAddress("user1")), "", "[2,2,null,null,10,11]") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("ma", `{"Name":"iter"}`, "", `{"1,10":"k","10,5":"l"}`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("ma", `{"Name":"iter"}`, "", `{"1,10":"k","10,5":"l"}`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("ma", `{"Name":"seterror"}`, "", ``) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("ma", `{"Name":"seterror"}`, "", ``) - require.NoErrorf(t, err, "failed to query") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "ma", 0, code2)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "ma", 0, code2)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.Query("ma", `{"Name":"query", "Args":[]}`, "", `["A","B",null,null,"A","B","v1"]`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("ma", `{"Name":"query", "Args":[]}`, "", `["A","B",null,null,"A","B","v1"]`) - require.NoErrorf(t, err, "failed to query") + tx := NewLuaTxCall("user1", "ma", 0, `{"Name": "abc", "Args":[]}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - tx := NewLuaTxCall("user1", "ma", 0, `{"Name": "abc", "Args":[]}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + receipt := bc.GetReceipt(tx.Hash()) + require.Equalf(t, `["C","D","A","B","v3"]`, receipt.GetRet(), "contract Call ret error") - receipt := bc.GetReceipt(tx.Hash()) - require.Equalf(t, `["C","D","A","B","v3"]`, receipt.GetRet(), "contract Call ret error") + err = bc.Query("ma", `{"Name":"query", "Args":[]}`, "", `["A","B","C","D","A","B","v3"]`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("ma", `{"Name":"query", "Args":[]}`, "", `["A","B","C","D","A","B","v3"]`) - require.NoErrorf(t, err, "failed to query") + } } func TestTypeArrayArg(t *testing.T) { - code := readLuaCode("type_arrayarg.lua") - require.NotEmpty(t, code, "failed to read type_arrayarg.lua") + code := readLuaCode(t, "type_arrayarg.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "a", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "a", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.Query("a", `{"Name": "copy", "Args":[1, 2, 3]}`, "table expected", "") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("a", `{"Name": "copy", "Args":[1, 2, 3]}`, "table expected", "") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("a", `{"Name": "copy", "Args":[[1, 2, 3]]}`, "", "[1,2,3]") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("a", `{"Name": "copy", "Args":[[1, 2, 3]]}`, "", "[1,2,3]") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("a", `{"Name": "two_arr", "Args":[[1, 2, 3],[4, 5]]}`, "", "[3,2]") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("a", `{"Name": "two_arr", "Args":[[1, 2, 3],[4, 5]]}`, "", "[3,2]") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("a", `{"Name": "mixed_args", "Args":[[1, 2, 3], {"name": "user2", "age": 39}, 7]}`, "", `[[1,2,3],{"age":39,"name":"user2"},7]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("a", `{"Name": "mixed_args", "Args":[[1, 2, 3], {"name": "user2", "age": 39}, 7]}`, "", `[[1,2,3],{"age":39,"name":"user2"},7]`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("a", `{"Name": "mixed_args", "Args":[ + err = bc.Query("a", `{"Name": "mixed_args", "Args":[ [[1, 2, 3],["first", "second"]], {"name": "user2", "age": 39, "address": {"state": "XXX-do", "city": "YYY-si"}}, "end" ]}`, "", `[[[1,2,3],["first","second"]],{"address":{"city":"YYY-si","state":"XXX-do"},"age":39,"name":"user2"},"end"]`, - ) - require.NoErrorf(t, err, "failed to query") + ) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("a", `{"Name": "mixed_args", "Args":[ + err = bc.Query("a", `{"Name": "mixed_args", "Args":[ [{"name": "wook", "age": 50}, {"name": "hook", "age": 42}], {"name": "user2", "age": 39, "scores": [10, 20, 30, 40, 50]}, "hmm..." ]}`, "", `[[{"age":50,"name":"wook"},{"age":42,"name":"hook"}],{"age":39,"name":"user2","scores":[10,20,30,40,50]},"hmm..."]`, - ) - require.NoErrorf(t, err, "failed to query") + ) + require.NoErrorf(t, err, "failed to query") + + } } func TestTypeMapKey(t *testing.T) { - code := readLuaCode("type_mapkey.lua") - require.NotEmpty(t, code, "failed to read type_mapkey.lua") + code := readLuaCode(t, "type_mapkey.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "a", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "a", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.Query("a", `{"Name":"getCount", "Args":[1]}`, "", "null") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("a", `{"Name":"getCount", "Args":[1]}`, "", "null") + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "a", 0, `{"Name":"setCount", "Args":[1, 10]}`), - NewLuaTxCall("user1", "a", 0, `{"Name":"setCount", "Args":["1", 20]}`).Fail("(number expected, got string)"), - NewLuaTxCall("user1", "a", 0, `{"Name":"setCount", "Args":[1.1, 30]}`), - ) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "a", 0, `{"Name":"setCount", "Args":[1, 10]}`), + NewLuaTxCall("user1", "a", 0, `{"Name":"setCount", "Args":["1", 20]}`).Fail("(number expected, got string)"), + NewLuaTxCall("user1", "a", 0, `{"Name":"setCount", "Args":[1.1, 30]}`), + ) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("a", `{"Name":"getCount", "Args":["1"]}`, "(number expected, got string)", "") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("a", `{"Name":"getCount", "Args":["1"]}`, "(number expected, got string)", "") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("a", `{"Name":"getCount", "Args":[1]}`, "", "10") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("a", `{"Name":"getCount", "Args":[1]}`, "", "10") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("a", `{"Name":"getCount", "Args":[1.1]}`, "", "30") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("a", `{"Name":"getCount", "Args":[1.1]}`, "", "30") + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "a", 0, `{"Name":"setCount", "Args":[true, 40]}`).Fail(`invalid key type: 'boolean', state.map: 'counts'`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "a", 0, `{"Name":"setCount", "Args":[true, 40]}`).Fail(`invalid key type: 'boolean', state.map: 'counts'`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "a", 0, `{"Name":"delCount", "Args":[1.1]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "a", 0, `{"Name":"delCount", "Args":[1.1]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("a", `{"Name":"getCount", "Args":[1.1]}`, "", "null") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("a", `{"Name":"getCount", "Args":[1.1]}`, "", "null") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("a", `{"Name":"getCount", "Args":[2]}`, "", "null") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("a", `{"Name":"getCount", "Args":[2]}`, "", "null") + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "x", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "x", 0, code)) + require.NoErrorf(t, err, "failed to deploy") + + err = bc.ConnectBlock( + NewLuaTxCall("user1", "x", 0, `{"Name":"setCount", "Args":["1", 10]}`), + NewLuaTxCall("user1", "x", 0, `{"Name":"setCount", "Args":[1, 20]}`).Fail("string expected, got number)"), + NewLuaTxCall("user1", "x", 0, `{"Name":"setCount", "Args":["third", 30]}`), + ) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "x", 0, `{"Name":"setCount", "Args":["1", 10]}`), - NewLuaTxCall("user1", "x", 0, `{"Name":"setCount", "Args":[1, 20]}`).Fail("string expected, got number)"), - NewLuaTxCall("user1", "x", 0, `{"Name":"setCount", "Args":["third", 30]}`), - ) - require.NoErrorf(t, err, "failed to call tx") + err = bc.Query("x", `{"Name":"getCount", "Args":["1"]}`, "", "10") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("x", `{"Name":"getCount", "Args":["1"]}`, "", "10") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("x", `{"Name":"getCount", "Args":["third"]}`, "", "30") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("x", `{"Name":"getCount", "Args":["third"]}`, "", "30") - require.NoErrorf(t, err, "failed to query") + } } func TestTypeStateVarFieldUpdate(t *testing.T) { - code := readLuaCode("type_statevarfieldupdate.lua") - require.NotEmpty(t, code, "failed to read type_statevarfieldupdate.lua") + code := readLuaCode(t, "type_statevarfieldupdate.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "c", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "c", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "c", 0, `{"Name":"InvalidUpdateAge", "Args":[10]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "c", 0, `{"Name":"InvalidUpdateAge", "Args":[10]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("c", `{"Name":"GetPerson"}`, "", `{"address":"blahblah...","age":38,"name":"user2"}`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("c", `{"Name":"GetPerson"}`, "", `{"address":"blahblah...","age":38,"name":"user2"}`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "c", 0, `{"Name":"ValidUpdateAge", "Args":[10]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "c", 0, `{"Name":"ValidUpdateAge", "Args":[10]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("c", `{"Name":"GetPerson"}`, "", `{"address":"blahblah...","age":10,"name":"user2"}`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("c", `{"Name":"GetPerson"}`, "", `{"address":"blahblah...","age":10,"name":"user2"}`) + require.NoErrorf(t, err, "failed to query") + + } } func TestTypeDatetime(t *testing.T) { - code := readLuaCode("type_datetime.lua") - require.NotEmpty(t, code, "failed to read type_datetime.lua") + code := readLuaCode(t, "type_datetime.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "datetime", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "datetime", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.Query("datetime", `{"Name": "CreateDate"}`, "", `"1998-09-17 02:48:10"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("datetime", `{"Name": "CreateDate"}`, "", `"1998-09-17 02:48:10"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("datetime", `{"Name": "Extract", "Args":["%x"]}`, "", `"09/17/98"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("datetime", `{"Name": "Extract", "Args":["%x"]}`, "", `"09/17/98"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("datetime", `{"Name": "Extract", "Args":["%X"]}`, "", `"02:48:10"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("datetime", `{"Name": "Extract", "Args":["%X"]}`, "", `"02:48:10"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("datetime", `{"Name": "Extract", "Args":["%A"]}`, "", `"Thursday"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("datetime", `{"Name": "Extract", "Args":["%A"]}`, "", `"Thursday"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("datetime", `{"Name": "Extract", "Args":["%I:%M:%S %p"]}`, "", `"02:48:10 AM"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("datetime", `{"Name": "Extract", "Args":["%I:%M:%S %p"]}`, "", `"02:48:10 AM"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("datetime", `{"Name": "Difftime"}`, "", `2890`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("datetime", `{"Name": "Difftime"}`, "", `2890`) + require.NoErrorf(t, err, "failed to query") + + } } func TestTypeDynamicArray(t *testing.T) { - code := readLuaCode("type_dynamicarray_zerolen.lua") - require.NotEmpty(t, code, "failed to read type_dynamicarray_zerolen.lua") + code := readLuaCode(t, "type_dynamicarray_zerolen.lua") + code2 := readLuaCode(t, "type_dynamicarray.lua") - code2 := readLuaCode("type_dynamicarray.lua") - require.NotEmpty(t, code, "failed to read type_dynamicarray.lua") + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) + require.NoErrorf(t, err, "failed to new account") + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "zeroLen", 0, code)) + require.Errorf(t, err, "no error | expected: the array length must be greater than zero") + require.Containsf(t, err.Error(), "the array length must be greater than zero", "wrong error message") - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo)) - require.NoErrorf(t, err, "failed to new account") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "zeroLen", 0, code)) - require.Errorf(t, err, "no error | expected: the array length must be greater than zero") - require.Containsf(t, err.Error(), "the array length must be greater than zero", "wrong error message") + tx := NewLuaTxDeploy("user1", "dArr", 0, code2) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to deploy") - tx := NewLuaTxDeploy("user1", "dArr", 0, code2) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to deploy") + err = bc.Query("dArr", `{"Name": "Length"}`, "", "0") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("dArr", `{"Name": "Length"}`, "", "0") - require.NoErrorf(t, err, "failed to query") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "dArr", 0, `{"Name": "Append", "Args": [10]}`), + NewLuaTxCall("user1", "dArr", 0, `{"Name": "Append", "Args": [20]}`), + ) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "dArr", 0, `{"Name": "Append", "Args": [10]}`), - NewLuaTxCall("user1", "dArr", 0, `{"Name": "Append", "Args": [20]}`), - ) - require.NoErrorf(t, err, "failed to call tx") + err = bc.Query("dArr", `{"Name": "Get", "Args": [1]}`, "", "10") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("dArr", `{"Name": "Get", "Args": [1]}`, "", "10") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("dArr", `{"Name": "Get", "Args": [2]}`, "", "20") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("dArr", `{"Name": "Get", "Args": [2]}`, "", "20") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("dArr", `{"Name": "Get", "Args": [3]}`, "index out of range", "") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("dArr", `{"Name": "Get", "Args": [3]}`, "index out of range", "") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("dArr", `{"Name": "Length"}`, "", "2") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("dArr", `{"Name": "Length"}`, "", "2") - require.NoErrorf(t, err, "failed to query") + err = bc.ConnectBlock(NewLuaTxCall("user1", "dArr", 0, `{"Name": "Append", "Args": [30]}`), + NewLuaTxCall("user1", "dArr", 0, `{"Name": "Append", "Args": [40]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "dArr", 0, `{"Name": "Append", "Args": [30]}`), - NewLuaTxCall("user1", "dArr", 0, `{"Name": "Append", "Args": [40]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.Query("dArr", `{"Name": "Length"}`, "", "4") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("dArr", `{"Name": "Length"}`, "", "4") - require.NoErrorf(t, err, "failed to query") + err = bc.ConnectBlock(NewLuaTxCall("user1", "dArr", 0, `{"Name": "Set", "Args": [3, 50]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "dArr", 0, `{"Name": "Set", "Args": [3, 50]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.Query("dArr", `{"Name": "Get", "Args": [3]}`, "", "50") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("dArr", `{"Name": "Get", "Args": [3]}`, "", "50") - require.NoErrorf(t, err, "failed to query") + } } func TestTypeCrypto(t *testing.T) { - code := readLuaCode("type_crypto.lua") - require.NotEmpty(t, code, "failed to read type_crypto.lua") + code := readLuaCode(t, "type_crypto.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "crypto", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "crypto", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.Query("crypto", `{"Name": "get", "Args" : ["ab\u0000\u442a"]}`, "", `"0xc58f6dca13e4bba90a326d8605042862fe87c63a64a9dd0e95608a2ee68dc6f0"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("crypto", `{"Name": "get", "Args" : ["ab\u0000\u442a"]}`, "", `"0xc58f6dca13e4bba90a326d8605042862fe87c63a64a9dd0e95608a2ee68dc6f0"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("crypto", `{"Name": "get", "Args" : ["0x616200e490aa"]}`, "", `"0xc58f6dca13e4bba90a326d8605042862fe87c63a64a9dd0e95608a2ee68dc6f0"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("crypto", `{"Name": "get", "Args" : ["0x616200e490aa"]}`, "", `"0xc58f6dca13e4bba90a326d8605042862fe87c63a64a9dd0e95608a2ee68dc6f0"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("crypto", `{"Name": "checkEther", "Args" : []}`, "", `true`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("crypto", `{"Name": "checkEther", "Args" : []}`, "", `true`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("crypto", `{"Name": "checkAergo", "Args" : []}`, "", `true`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("crypto", `{"Name": "checkAergo", "Args" : []}`, "", `true`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("crypto", `{"Name": "keccak256", "Args" : ["0x616263"]}`, "", `"0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("crypto", `{"Name": "keccak256", "Args" : ["0x616263"]}`, "", `"0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("crypto", `{"Name": "keccak256", "Args" : ["0x616572676F"]}`, "", `"0xe98bb03ab37161f8bbfe131f711dcccf3002a9cd9ec31bbd52edf181f7ab09a0"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("crypto", `{"Name": "keccak256", "Args" : ["0x616572676F"]}`, "", `"0xe98bb03ab37161f8bbfe131f711dcccf3002a9cd9ec31bbd52edf181f7ab09a0"`) + require.NoErrorf(t, err, "failed to query") + + } } func TestTypeBignum(t *testing.T) { - bignum := readLuaCode("type_bignum.lua") - require.NotEmpty(t, bignum, "failed to read type_bignum.lua") - callee := readLuaCode("type_bignum_callee.lua") - require.NotEmpty(t, bignum, "failed to read type_bignum_callee.lua") + bignum := readLuaCode(t, "type_bignum.lua") + callee := readLuaCode(t, "type_bignum_callee.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "bigNum", uint64(types.Gaer)*50, bignum), - NewLuaTxDeploy("user1", "add", 0, callee), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "bigNum", uint64(types.Gaer)*50, bignum), + NewLuaTxDeploy("user1", "add", 0, callee), + ) + require.NoErrorf(t, err, "failed to deploy") - tx := NewLuaTxCall("user1", "bigNum", 0, fmt.Sprintf(`{"Name":"test", "Args":["%s"]}`, nameToAddress("user1"))) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx := NewLuaTxCall("user1", "bigNum", 0, fmt.Sprintf(`{"Name":"test", "Args":["%s"]}`, nameToAddress("user1"))) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - receipt := bc.GetReceipt(tx.Hash()) - assert.Equalf(t, `"25000000000"`, receipt.GetRet(), "contract Call ret error") + receipt := bc.GetReceipt(tx.Hash()) + assert.Equalf(t, `"25000000000"`, receipt.GetRet(), "contract Call ret error") - tx = NewLuaTxCall("user1", "bigNum", 0, fmt.Sprintf(`{"Name":"sendS", "Args":["%s"]}`, nameToAddress("user1"))) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx = NewLuaTxCall("user1", "bigNum", 0, fmt.Sprintf(`{"Name":"sendS", "Args":["%s"]}`, nameToAddress("user1"))) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - receipt = bc.GetReceipt(tx.Hash()) - assert.Equalf(t, `"23999900001"`, receipt.GetRet(), "contract Call ret error") + receipt = bc.GetReceipt(tx.Hash()) + assert.Equalf(t, `"23999900001"`, receipt.GetRet(), "contract Call ret error") - tx = NewLuaTxCall("user1", "bigNum", 0, `{"Name":"testBignum", "Args":[]}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx = NewLuaTxCall("user1", "bigNum", 0, `{"Name":"testBignum", "Args":[]}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - receipt = bc.GetReceipt(tx.Hash()) - assert.Equalf(t, `"999999999999999999999999999999"`, receipt.GetRet(), "contract Call ret error") + receipt = bc.GetReceipt(tx.Hash()) + assert.Equalf(t, `"999999999999999999999999999999"`, receipt.GetRet(), "contract Call ret error") - err = bc.Query("bigNum", `{"Name":"argBignum", "Args":[{"_bignum":"99999999999999999999999999"}]}`, "", `"100000000000000000000000000"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("bigNum", `{"Name":"argBignum", "Args":[{"_bignum":"99999999999999999999999999"}]}`, "", `"100000000000000000000000000"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("bigNum", fmt.Sprintf(`{"Name":"calladdBignum", "Args":["%s", {"_bignum":"999999999999999999"}]}`, nameToAddress("add")), "", `"1000000000000000004"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("bigNum", fmt.Sprintf(`{"Name":"calladdBignum", "Args":["%s", {"_bignum":"999999999999999999"}]}`, nameToAddress("add")), "", `"1000000000000000004"`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("bigNum", `{"Name":"checkBignum"}`, "", `[false,true,false]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("bigNum", `{"Name":"checkBignum"}`, "", `[false,true,false]`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("bigNum", `{"Name":"calcBignum"}`, "bignum divide by zero", "") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("bigNum", `{"Name":"calcBignum"}`, "bignum divide by zero", "") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("bigNum", `{"Name":"negativeBignum"}`, "bignum not allowed negative value", "") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("bigNum", `{"Name":"negativeBignum"}`, "bignum not allowed negative value", "") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("bigNum", `{"Name":"byteBignum"}`, "", `{"_bignum":"177"}`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("bigNum", `{"Name":"byteBignum"}`, "", `{"_bignum":"177"}`) + require.NoErrorf(t, err, "failed to query") + + } } func TestBignumValues(t *testing.T) { @@ -2160,418 +2255,432 @@ func checkRandomIntValue(v string, min, max int) error { } func TestTypeRandom(t *testing.T) { - code := readLuaCode("type_random.lua") - require.NotEmpty(t, code, "failed to read type_random.lua") + code := readLuaCode(t, "type_random.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "random", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "random", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "random", 0, `{"Name": "random", "Args":[]}`).Fail("1 or 2 arguments required")) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "random", 0, `{"Name": "random", "Args":[]}`).Fail("1 or 2 arguments required")) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCall("user1", "random", 0, `{"Name": "random", "Args":[0]}`).Fail("the maximum value must be greater than zero")) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "random", 0, `{"Name": "random", "Args":[0]}`).Fail("the maximum value must be greater than zero")) + require.NoErrorf(t, err, "failed to call tx") - tx := NewLuaTxCall("user1", "random", 0, `{"Name": "random", "Args":[3]}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx := NewLuaTxCall("user1", "random", 0, `{"Name": "random", "Args":[3]}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - receipt := bc.GetReceipt(tx.Hash()) - err = checkRandomIntValue(receipt.GetRet(), 1, 3) - require.NoErrorf(t, err, "failed to check random value") + receipt := bc.GetReceipt(tx.Hash()) + err = checkRandomIntValue(receipt.GetRet(), 1, 3) + require.NoErrorf(t, err, "failed to check random value") - tx = NewLuaTxCall("user1", "random", 0, `{"Name": "random", "Args":[3, 10]}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx = NewLuaTxCall("user1", "random", 0, `{"Name": "random", "Args":[3, 10]}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - receipt = bc.GetReceipt(tx.Hash()) - err = checkRandomIntValue(receipt.GetRet(), 3, 10) - require.NoErrorf(t, err, "failed to check random value") + receipt = bc.GetReceipt(tx.Hash()) + err = checkRandomIntValue(receipt.GetRet(), 3, 10) + require.NoErrorf(t, err, "failed to check random value") - err = bc.Query("random", `{"Name": "random", "Args":[1]}`, "", "1") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("random", `{"Name": "random", "Args":[1]}`, "", "1") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("random", `{"Name": "random", "Args":[4,4]}`, "", "4") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("random", `{"Name": "random", "Args":[4,4]}`, "", "4") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("random", `{"Name": "random", "Args":[0,4]}`, "system.random: the minimum value must be greater than zero", "") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("random", `{"Name": "random", "Args":[0,4]}`, "system.random: the minimum value must be greater than zero", "") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("random", `{"Name": "random", "Args":[3,1]}`, "system.random: the maximum value must be greater than the minimum value", "") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("random", `{"Name": "random", "Args":[3,1]}`, "system.random: the maximum value must be greater than the minimum value", "") + require.NoErrorf(t, err, "failed to query") + + } } func TestTypeSparseTable(t *testing.T) { - code := readLuaCode("type_sparsetable.lua") - require.NotEmpty(t, code, "failed to read type_sparsetable.lua") + code := readLuaCode(t, "type_sparsetable.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - tx := NewLuaTxCall("user1", "r", 0, `{"Name":"r"}`) - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "r", 0, code), tx) - require.NoErrorf(t, err, "failed to new account, deploy, call") + tx := NewLuaTxCall("user1", "r", 0, `{"Name":"r"}`) + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "r", 0, code), tx) + require.NoErrorf(t, err, "failed to new account, deploy, call") - receipt := bc.GetReceipt(tx.Hash()) - require.Equalf(t, `1`, receipt.GetRet(), "contract Call ret error") + receipt := bc.GetReceipt(tx.Hash()) + require.Equalf(t, `1`, receipt.GetRet(), "contract Call ret error") + + } } func TestTypeJson(t *testing.T) { - code := readLuaCode("type_json.lua") - require.NotEmpty(t, code, "failed to read type_json.lua") + code := readLuaCode(t, "type_json.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "json", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "json", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["[1,2,3]"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["[1,2,3]"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("json", `{"Name":"get", "Args":[]}`, "", "[1,2,3]") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("json", `{"Name":"get", "Args":[]}`, "", "[1,2,3]") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("json", `{"Name":"getenc", "Args":[]}`, "", `"[1,2,3]"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("json", `{"Name":"getenc", "Args":[]}`, "", `"[1,2,3]"`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["{\"key1\":[1,2,3], \"run\", \"key2\":5, [4,5,6]}"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["{\"key1\":[1,2,3], \"run\", \"key2\":5, [4,5,6]}"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("json", `{"Name":"get", "Args":[]}`, "", `{"1":"run","2":[4,5,6],"key1":[1,2,3],"key2":5}`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("json", `{"Name":"get", "Args":[]}`, "", `{"1":"run","2":[4,5,6],"key1":[1,2,3],"key2":5}`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("json", `{"Name":"getenc", "Args":[]}`, "", `"{\"1\":\"run\",\"2\":[4,5,6],\"key1\":[1,2,3],\"key2\":5}"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("json", `{"Name":"getenc", "Args":[]}`, "", `"{\"1\":\"run\",\"2\":[4,5,6],\"key1\":[1,2,3],\"key2\":5}"`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["{\"key1\":{\"arg1\": 1,\"arg2\":null, \"arg3\":[]}, \"key2\":[5,4,3]}"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["{\"key1\":{\"arg1\": 1,\"arg2\":null, \"arg3\":[]}, \"key2\":[5,4,3]}"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("json", `{"Name":"get", "Args":[]}`, "", `{"key1":{"arg1":1,"arg3":{}},"key2":[5,4,3]}`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("json", `{"Name":"get", "Args":[]}`, "", `{"key1":{"arg1":1,"arg3":{}},"key2":[5,4,3]}`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("json", `{"Name":"getenc", "Args":[]}`, "", `"{\"key1\":{\"arg1\":1,\"arg3\":{}},\"key2\":[5,4,3]}"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("json", `{"Name":"getenc", "Args":[]}`, "", `"{\"key1\":{\"arg1\":1,\"arg3\":{}},\"key2\":[5,4,3]}"`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["{\"key1\":[1,2,3], \"key1\":5}"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["{\"key1\":[1,2,3], \"key1\":5}"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("json", `{"Name":"get", "Args":[]}`, "", `{"key1":5}`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("json", `{"Name":"get", "Args":[]}`, "", `{"key1":5}`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["[\"\\\"hh\\t\",\"2\",3]"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["[\"\\\"hh\\t\",\"2\",3]"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("json", `{"Name":"get", "Args":[]}`, "", `["\"hh\u0009","2",3]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("json", `{"Name":"get", "Args":[]}`, "", `["\"hh\u0009","2",3]`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("json", `{"Name":"getlen", "Args":[]}`, "", `["\"hh\u0009",4]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("json", `{"Name":"getlen", "Args":[]}`, "", `["\"hh\u0009",4]`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("json", `{"Name":"getenc", "Args":[]}`, "", `"[\"\\\"hh\\u0009\",\"2\",3]"`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("json", `{"Name":"getenc", "Args":[]}`, "", `"[\"\\\"hh\\u0009\",\"2\",3]"`) + require.NoErrorf(t, err, "failed to query") - tx := NewLuaTxCall("user1", "json", 100, `{"Name":"getAmount"}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") - receipt := bc.GetReceipt(tx.Hash()) - require.Equalf(t, `"100"`, receipt.GetRet(), "contract Call ret error") + tx := NewLuaTxCall("user1", "json", 100, `{"Name":"getAmount"}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") + receipt := bc.GetReceipt(tx.Hash()) + require.Equalf(t, `"100"`, receipt.GetRet(), "contract Call ret error") - err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["{\"key1\":[1,2,3], \"key1\":5}}"]}`).Fail("not proper json format")) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "json", 0, `{"Name":"set", "Args":["{\"key1\":[1,2,3], \"key1\":5}}"]}`).Fail("not proper json format")) + require.NoErrorf(t, err, "failed to call tx") + + } } // feature tests func TestFeatureVote(t *testing.T) { - code := readLuaCode("feature_vote.lua") - require.NotEmpty(t, code, "failed to read feature_vote.lua") + code := readLuaCode(t, "feature_vote.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("owner", 1, types.Aergo), - NewLuaTxDeploy("owner", "vote", 0, code), - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxAccount("user10", 1, types.Aergo), - NewLuaTxAccount("user11", 1, types.Aergo), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("owner", 1, types.Aergo), + NewLuaTxDeploy("owner", "vote", 0, code), + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxAccount("user10", 1, types.Aergo), + NewLuaTxAccount("user11", 1, types.Aergo), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock( - NewLuaTxCall("owner", "vote", 0, `{"Name":"addCandidate", "Args":["candidate1"]}`), - NewLuaTxCall("owner", "vote", 0, `{"Name":"addCandidate", "Args":["candidate2"]}`), - NewLuaTxCall("owner", "vote", 0, `{"Name":"addCandidate", "Args":["candidate3"]}`), - ) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock( + NewLuaTxCall("owner", "vote", 0, `{"Name":"addCandidate", "Args":["candidate1"]}`), + NewLuaTxCall("owner", "vote", 0, `{"Name":"addCandidate", "Args":["candidate2"]}`), + NewLuaTxCall("owner", "vote", 0, `{"Name":"addCandidate", "Args":["candidate3"]}`), + ) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("vote", `{"Name":"getCandidates"}`, "", `[{"count":"0","id":0,"name":"candidate1"},{"count":"0","id":1,"name":"candidate2"},{"count":"0","id":2,"name":"candidate3"}]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("vote", `{"Name":"getCandidates"}`, "", `[{"count":"0","id":0,"name":"candidate1"},{"count":"0","id":1,"name":"candidate2"},{"count":"0","id":2,"name":"candidate3"}]`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock(NewLuaTxCall("user1", "vote", 0, `{"Name":"addCandidate", "Args":["candidate4"]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "vote", 0, `{"Name":"addCandidate", "Args":["candidate4"]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("vote", `{"Name":"getCandidates"}`, "", `[{"count":"0","id":0,"name":"candidate1"},{"count":"0","id":1,"name":"candidate2"},{"count":"0","id":2,"name":"candidate3"}]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("vote", `{"Name":"getCandidates"}`, "", `[{"count":"0","id":0,"name":"candidate1"},{"count":"0","id":1,"name":"candidate2"},{"count":"0","id":2,"name":"candidate3"}]`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock( - // register voter - NewLuaTxCall("owner", "vote", 0, fmt.Sprintf(`{"Name":"registerVoter", "Args":["%s"]}`, nameToAddress("user10"))), - NewLuaTxCall("owner", "vote", 0, fmt.Sprintf(`{"Name":"registerVoter", "Args":["%s"]}`, nameToAddress("user10"))), - NewLuaTxCall("owner", "vote", 0, fmt.Sprintf(`{"Name":"registerVoter", "Args":["%s"]}`, nameToAddress("user11"))), - NewLuaTxCall("owner", "vote", 0, fmt.Sprintf(`{"Name":"registerVoter", "Args":["%s"]}`, nameToAddress("user1"))), - // vote - NewLuaTxCall("user1", "vote", 0, `{"Name":"vote", "Args":["user1"]}`), - NewLuaTxCall("user1", "vote", 0, `{"Name":"vote", "Args":["user1"]}`), - NewLuaTxCall("user1", "vote", 0, `{"Name":"vote", "Args":["user2"]}`), - NewLuaTxCall("user1", "vote", 0, `{"Name":"vote", "Args":["user2"]}`), - NewLuaTxCall("user1", "vote", 0, `{"Name":"vote", "Args":["user3"]}`), - ) - require.NoErrorf(t, err, "failed to call tx | vote error") + err = bc.ConnectBlock( + // register voter + NewLuaTxCall("owner", "vote", 0, fmt.Sprintf(`{"Name":"registerVoter", "Args":["%s"]}`, nameToAddress("user10"))), + NewLuaTxCall("owner", "vote", 0, fmt.Sprintf(`{"Name":"registerVoter", "Args":["%s"]}`, nameToAddress("user10"))), + NewLuaTxCall("owner", "vote", 0, fmt.Sprintf(`{"Name":"registerVoter", "Args":["%s"]}`, nameToAddress("user11"))), + NewLuaTxCall("owner", "vote", 0, fmt.Sprintf(`{"Name":"registerVoter", "Args":["%s"]}`, nameToAddress("user1"))), + // vote + NewLuaTxCall("user1", "vote", 0, `{"Name":"vote", "Args":["user1"]}`), + NewLuaTxCall("user1", "vote", 0, `{"Name":"vote", "Args":["user1"]}`), + NewLuaTxCall("user1", "vote", 0, `{"Name":"vote", "Args":["user2"]}`), + NewLuaTxCall("user1", "vote", 0, `{"Name":"vote", "Args":["user2"]}`), + NewLuaTxCall("user1", "vote", 0, `{"Name":"vote", "Args":["user3"]}`), + ) + require.NoErrorf(t, err, "failed to call tx | vote error") - err = bc.Query("vote", `{"Name":"getCandidates"}`, "", `[{"count":"0","id":0,"name":"candidate1"},{"count":"0","id":1,"name":"candidate2"},{"count":"0","id":2,"name":"candidate3"}]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("vote", `{"Name":"getCandidates"}`, "", `[{"count":"0","id":0,"name":"candidate1"},{"count":"0","id":1,"name":"candidate2"},{"count":"0","id":2,"name":"candidate3"}]`) + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock( - NewLuaTxCall("user11", "vote", 0, `{"Name":"vote", "Args":["candidate1"]}`), - NewLuaTxCall("user10", "vote", 0, `{"Name":"vote", "Args":["candidate1"]}`), - ) - require.NoErrorf(t, err, "failed to call tx | vote error") + err = bc.ConnectBlock( + NewLuaTxCall("user11", "vote", 0, `{"Name":"vote", "Args":["candidate1"]}`), + NewLuaTxCall("user10", "vote", 0, `{"Name":"vote", "Args":["candidate1"]}`), + ) + require.NoErrorf(t, err, "failed to call tx | vote error") - err = bc.Query("vote", `{"Name":"getCandidates"}`, "", `[{"count":"2","id":0,"name":"candidate1"},{"count":"0","id":1,"name":"candidate2"},{"count":"0","id":2,"name":"candidate3"}]`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("vote", `{"Name":"getCandidates"}`, "", `[{"count":"2","id":0,"name":"candidate1"},{"count":"0","id":1,"name":"candidate2"},{"count":"0","id":2,"name":"candidate3"}]`) + require.NoErrorf(t, err, "failed to query") + + } } func TestFeatureGovernance(t *testing.T) { - code := readLuaCode("feature_governance.lua") - require.NotEmpty(t, code, "failed to read feature_governance.lua") + code := readLuaCode(t, "feature_governance.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "gov", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "gov", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - amount := types.NewAmount(40000, types.Aergo) // 40,000 aergo - err = bc.ConnectBlock(NewLuaTxCallBig("user1", "gov", amount, `{"Name": "test_gov", "Args":[]}`)) - require.NoErrorf(t, err, "failed to call tx") + amount := types.NewAmount(40000, types.Aergo) // 40,000 aergo + err = bc.ConnectBlock(NewLuaTxCallBig("user1", "gov", amount, `{"Name": "test_gov", "Args":[]}`)) + require.NoErrorf(t, err, "failed to call tx") - oldstaking, err := bc.GetStaking("gov") - require.NoErrorf(t, err, "failed to get staking") + oldstaking, err := bc.GetStaking("gov") + require.NoErrorf(t, err, "failed to get staking") - oldgov, err := bc.GetAccountState("gov") - require.NoErrorf(t, err, "failed to get gov account state") + oldgov, err := bc.GetAccountState("gov") + require.NoErrorf(t, err, "failed to get gov account state") - tx := NewLuaTxCall("user1", "gov", 0, `{"Name": "test_pcall", "Args":[]}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx := NewLuaTxCall("user1", "gov", 0, `{"Name": "test_pcall", "Args":[]}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - staking, err := bc.GetStaking("gov") - require.NoErrorf(t, err, "failed to get staking") + staking, err := bc.GetStaking("gov") + require.NoErrorf(t, err, "failed to get staking") - gov, err := bc.GetAccountState("gov") - require.NoErrorf(t, err, "failed to get gov account state") - require.Equalf(t, oldstaking.Amount, staking.Amount, "pcall error, staking amount should be same") - require.Equalf(t, oldgov.GetBalance(), gov.GetBalance(), "pcall error, gov balance should be same") + gov, err := bc.GetAccountState("gov") + require.NoErrorf(t, err, "failed to get gov account state") + require.Equalf(t, oldstaking.Amount, staking.Amount, "pcall error, staking amount should be same") + require.Equalf(t, oldgov.GetBalance(), gov.GetBalance(), "pcall error, gov balance should be same") - tx = NewLuaTxCall("user1", "gov", 0, `{"Name": "error_case", "Args":[]}`) - err = bc.ConnectBlock(tx) - require.Errorf(t, err, "expect error | less time has passed") + tx = NewLuaTxCall("user1", "gov", 0, `{"Name": "error_case", "Args":[]}`) + err = bc.ConnectBlock(tx) + require.Errorf(t, err, "expect error | less time has passed") + + newstaking, err := bc.GetStaking("gov") + require.NoErrorf(t, err, "failed to get staking") - newstaking, err := bc.GetStaking("gov") - require.NoErrorf(t, err, "failed to get staking") + newgov, err := bc.GetAccountState("gov") + require.NoErrorf(t, err, "failed to get gov account state") - newgov, err := bc.GetAccountState("gov") - require.NoErrorf(t, err, "failed to get gov account state") + require.Equalf(t, oldstaking.Amount, newstaking.Amount, "pcall error, staking amount should be same") + require.Equalf(t, oldgov.GetBalance(), newgov.GetBalance(), "pcall error, gov balance should be same") - require.Equalf(t, oldstaking.Amount, newstaking.Amount, "pcall error, staking amount should be same") - require.Equalf(t, oldgov.GetBalance(), newgov.GetBalance(), "pcall error, gov balance should be same") + } } func TestFeaturePcallRollback(t *testing.T) { - code := readLuaCode("feature_pcallrollback_1.lua") - require.NotEmpty(t, code, "failed to read feature_pcallrollback_1.lua") - code2 := readLuaCode("feature_pcallrollback_2.lua") - require.NotEmpty(t, code, "failed to read feature_pcallrollback_2.lua") - code3 := readLuaCode("feature_pcallrollback_3.lua") - require.NotEmpty(t, code, "failed to read feature_pcallrollback_3.lua") + code := readLuaCode(t, "feature_pcallrollback_1.lua") + code2 := readLuaCode(t, "feature_pcallrollback_2.lua") + code3 := readLuaCode(t, "feature_pcallrollback_3.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxDeploy("user1", "counter", 10, code).Constructor("[0]"), - NewLuaTxCall("user1", "counter", 15, `{"Name":"inc", "Args":[]}`), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxDeploy("user1", "counter", 10, code).Constructor("[0]"), + NewLuaTxCall("user1", "counter", 15, `{"Name":"inc", "Args":[]}`), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.Query("counter", `{"Name":"get", "Args":[]}`, "", "1") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("counter", `{"Name":"get", "Args":[]}`, "", "1") + require.NoErrorf(t, err, "failed to query") - err = bc.ConnectBlock( - NewLuaTxDeploy("user1", "caller", 10, code2).Constructor(fmt.Sprintf(`["%s"]`, nameToAddress("counter"))), - NewLuaTxCall("user1", "caller", 15, `{"Name":"add", "Args":[]}`), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxDeploy("user1", "caller", 10, code2).Constructor(fmt.Sprintf(`["%s"]`, nameToAddress("counter"))), + NewLuaTxCall("user1", "caller", 15, `{"Name":"add", "Args":[]}`), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCall("user1", "caller", 0, `{"Name":"sql", "Args":[]}`)) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user1", "caller", 0, `{"Name":"sql", "Args":[]}`)) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("caller", `{"Name":"get", "Args":[]}`, "", "2") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("caller", `{"Name":"get", "Args":[]}`, "", "2") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("caller", `{"Name":"sqlget", "Args":[]}`, "", "2") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("caller", `{"Name":"sqlget", "Args":[]}`, "", "2") + require.NoErrorf(t, err, "failed to query") - tx := NewLuaTxCall("user1", "caller", 0, `{"Name":"getOrigin", "Args":[]}`) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx := NewLuaTxCall("user1", "caller", 0, `{"Name":"getOrigin", "Args":[]}`) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - receipt := bc.GetReceipt(tx.Hash()) - require.Equalf(t, "\""+nameToAddress("user1")+"\"", receipt.GetRet(), "contract Call ret error") + receipt := bc.GetReceipt(tx.Hash()) + require.Equalf(t, "\""+nameToAddress("user1")+"\"", receipt.GetRet(), "contract Call ret error") - bc, err = LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + bc, err = LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxAccount("bong", 0, 0), - NewLuaTxDeploy("user1", "counter", 0, code3), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxAccount("bong", 0, 0), + NewLuaTxDeploy("user1", "counter", 0, code3), + ) + require.NoErrorf(t, err, "failed to deploy") - tx = NewLuaTxCall("user1", "counter", 20, fmt.Sprintf(`{"Name":"set", "Args":["%s"]}`, nameToAddress("bong"))) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx = NewLuaTxCall("user1", "counter", 20, fmt.Sprintf(`{"Name":"set", "Args":["%s"]}`, nameToAddress("bong"))) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("counter", `{"Name":"get", "Args":[]}`, "", "1") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("counter", `{"Name":"get", "Args":[]}`, "", "1") + require.NoErrorf(t, err, "failed to query") - err = bc.Query("counter", `{"Name":"getBalance", "Args":[]}`, "", "\"18\"") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("counter", `{"Name":"getBalance", "Args":[]}`, "", "\"18\"") + require.NoErrorf(t, err, "failed to query") - state, err := bc.GetAccountState("bong") - require.NoErrorf(t, err, "failed to get account state") - assert.Equal(t, int64(2), state.GetBalanceBigInt().Int64(), "balance error") + state, err := bc.GetAccountState("bong") + require.NoErrorf(t, err, "failed to get account state") + assert.Equal(t, int64(2), state.GetBalanceBigInt().Int64(), "balance error") - tx = NewLuaTxCall("user1", "counter", 10, fmt.Sprintf(`{"Name":"set2", "Args":["%s"]}`, nameToAddress("bong"))) - err = bc.ConnectBlock(tx) - require.NoErrorf(t, err, "failed to call tx") + tx = NewLuaTxCall("user1", "counter", 10, fmt.Sprintf(`{"Name":"set2", "Args":["%s"]}`, nameToAddress("bong"))) + err = bc.ConnectBlock(tx) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("counter", `{"Name":"get", "Args":[]}`, "", "2") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("counter", `{"Name":"get", "Args":[]}`, "", "2") + require.NoErrorf(t, err, "failed to query") + + state, err = bc.GetAccountState("bong") + require.NoErrorf(t, err, "failed to get account state") + assert.Equal(t, int64(3), state.GetBalanceBigInt().Int64(), "balance error") - state, err = bc.GetAccountState("bong") - require.NoErrorf(t, err, "failed to get account state") - assert.Equal(t, int64(3), state.GetBalanceBigInt().Int64(), "balance error") + } } func TestFeaturePcallNested(t *testing.T) { - code := readLuaCode("feature_pcallnested.lua") - require.NotEmpty(t, code, "failed to read feature_pcallnested.lua") + code := readLuaCode(t, "feature_pcallnested.lua") - bc, err := LoadDummyChain() - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccount("user1", 1, types.Aergo), - NewLuaTxAccount("bong", 0, 0), - NewLuaTxDeploy("user1", "pcall", uint64(types.Aergo)*10, code), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccount("user1", 1, types.Aergo), + NewLuaTxAccount("bong", 0, 0), + NewLuaTxDeploy("user1", "pcall", uint64(types.Aergo)*10, code), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock( - NewLuaTxCall("user1", "pcall", 0, fmt.Sprintf(`{"Name":"pcall1", "Args":["%s", "%s"]}`, - nameToAddress("pcall"), nameToAddress("bong"))), - ) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock( + NewLuaTxCall("user1", "pcall", 0, fmt.Sprintf(`{"Name":"pcall1", "Args":["%s", "%s"]}`, + nameToAddress("pcall"), nameToAddress("bong"))), + ) + require.NoErrorf(t, err, "failed to call tx") - err = bc.Query("pcall", fmt.Sprintf(`{"Name":"map", "Args":["%s"]}`, nameToAddress("pcall")), "", "2") - require.NoErrorf(t, err, "failed to query") + err = bc.Query("pcall", fmt.Sprintf(`{"Name":"map", "Args":["%s"]}`, nameToAddress("pcall")), "", "2") + require.NoErrorf(t, err, "failed to query") - state, err := bc.GetAccountState("bong") - require.NoErrorf(t, err, "failed to get account state") - assert.Equal(t, int64(types.Aergo), state.GetBalanceBigInt().Int64(), "balance error") + state, err := bc.GetAccountState("bong") + require.NoErrorf(t, err, "failed to get account state") + assert.Equal(t, int64(types.Aergo), state.GetBalanceBigInt().Int64(), "balance error") + + } } func TestFeatureLuaCryptoVerifyProof(t *testing.T) { - code := readLuaCode("feature_luacryptoverifyproof.lua") - require.NotEmpty(t, code, "failed to read feature_luacryptoverifyproof.lua") + code := readLuaCode(t, "feature_luacryptoverifyproof.lua") - bc, err := LoadDummyChain(SetPubNet()) - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "eth", 0, code)) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock(NewLuaTxAccount("user1", 1, types.Aergo), NewLuaTxDeploy("user1", "eth", 0, code)) + require.NoErrorf(t, err, "failed to deploy") - err = bc.Query("eth", `{"Name":"verifyProofRaw"}`, "", `true`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("eth", `{"Name":"verifyProofRaw"}`, "", `true`) + require.NoErrorf(t, err, "failed to query") - err = bc.Query("eth", `{"Name":"verifyProofHex"}`, "", `true`) - require.NoErrorf(t, err, "failed to query") + err = bc.Query("eth", `{"Name":"verifyProofHex"}`, "", `true`) + require.NoErrorf(t, err, "failed to query") + } } func TestFeatureFeeDelegation(t *testing.T) { - code := readLuaCode("feature_feedelegation_1.lua") - require.NotEmpty(t, code, "failed to read feature_feedelegation_1.lua") - code2 := readLuaCode("feature_feedelegation_2.lua") - require.NotEmpty(t, code, "failed to read feature_feedelegation_2.lua") + code := readLuaCode(t, "feature_feedelegation_1.lua") + code2 := readLuaCode(t, "feature_feedelegation_2.lua") - bc, err := LoadDummyChain(SetPubNet()) - require.NoErrorf(t, err, "failed to create dummy chain") - defer bc.Release() + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(SetPubNet(), SetHardForkVersion(version)) + require.NoErrorf(t, err, "failed to create dummy chain") + defer bc.Release() - err = bc.ConnectBlock( - NewLuaTxAccountBig("user1", types.NewAmount(100, types.Aergo)), - NewLuaTxAccount("user2", 0, 0), - NewLuaTxDeploy("user1", "fd", 0, code), - NewLuaTxSendBig("user1", "fd", types.NewAmount(50, types.Aergo)), - ) - require.NoErrorf(t, err, "failed to deploy") + err = bc.ConnectBlock( + NewLuaTxAccountBig("user1", types.NewAmount(100, types.Aergo)), + NewLuaTxAccount("user2", 0, 0), + NewLuaTxDeploy("user1", "fd", 0, code), + NewLuaTxSendBig("user1", "fd", types.NewAmount(50, types.Aergo)), + ) + require.NoErrorf(t, err, "failed to deploy") - err = bc.ConnectBlock(NewLuaTxCallFeeDelegate("user2", "fd", 0, `{"Name": "check_delegation", "Args":[]}`).Fail("check_delegation function is not declared of fee delegation")) - require.NoErrorf(t, err, "failed to call check_delegation") + err = bc.ConnectBlock(NewLuaTxCallFeeDelegate("user2", "fd", 0, `{"Name": "check_delegation", "Args":[]}`).Fail("check_delegation function is not declared of fee delegation")) + require.NoErrorf(t, err, "failed to call check_delegation") - err = bc.ConnectBlock(NewLuaTxCall("user2", "fd", 0, `{"Name": "query", "Args":[]}`).Fail("not enough balance")) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCall("user2", "fd", 0, `{"Name": "query", "Args":[]}`).Fail("not enough balance")) + require.NoErrorf(t, err, "failed to call tx") - err = bc.ConnectBlock(NewLuaTxCallFeeDelegate("user2", "fd", 0, `{"Name": "query", "Args":[]}`).Fail("fee delegation is not allowed")) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(NewLuaTxCallFeeDelegate("user2", "fd", 0, `{"Name": "query", "Args":[]}`).Fail("fee delegation is not allowed")) + require.NoErrorf(t, err, "failed to call tx") - contract1, err := bc.GetAccountState("fd") - require.NoErrorf(t, err, "failed to get contract") + contract1, err := bc.GetAccountState("fd") + require.NoErrorf(t, err, "failed to get contract") - tx := NewLuaTxCallFeeDelegate("user2", "fd", 0, `{"Name": "query", "Args":["arg"]}`) - err = bc.ConnectBlock( - NewLuaTxCall("user1", "fd", 0, fmt.Sprintf(`{"Name":"reg", "Args":["%s"]}`, nameToAddress("user2"))), - tx, - ) - require.NoErrorf(t, err, "failed to call tx") + tx := NewLuaTxCallFeeDelegate("user2", "fd", 0, `{"Name": "query", "Args":["arg"]}`) + err = bc.ConnectBlock( + NewLuaTxCall("user1", "fd", 0, fmt.Sprintf(`{"Name":"reg", "Args":["%s"]}`, nameToAddress("user2"))), + tx, + ) + require.NoErrorf(t, err, "failed to call tx") - contract2, err := bc.GetAccountState("fd") - require.NoErrorf(t, err, "failed to get contract") - require.NotEqualf(t, contract1.GetBalanceBigInt().Int64(), contract2.GetBalanceBigInt().Int64(), "balance is not changed") + contract2, err := bc.GetAccountState("fd") + require.NoErrorf(t, err, "failed to get contract") + require.NotEqualf(t, contract1.GetBalanceBigInt().Int64(), contract2.GetBalanceBigInt().Int64(), "balance is not changed") - err = bc.ConnectBlock(tx.Fail("fee delegation is not allowed")) - require.NoErrorf(t, err, "failed to call tx") + err = bc.ConnectBlock(tx.Fail("fee delegation is not allowed")) + require.NoErrorf(t, err, "failed to call tx") + + err = bc.ConnectBlock(NewLuaTxDeploy("user1", "fd2", 0, code2)) + require.Errorf(t, err, "expect error") + require.Containsf(t, err.Error(), "no 'check_delegation' function", "invalid error message") - err = bc.ConnectBlock(NewLuaTxDeploy("user1", "fd2", 0, code2)) - require.Errorf(t, err, "expect error") - require.Containsf(t, err.Error(), "no 'check_delegation' function", "invalid error message") + } } /* @@ -2595,7 +2704,8 @@ func TestFeatureFeeDelegationLoop(t *testing.T) { abi.payable(default) abi.fee_delegation(query_no) ` - bc, err := LoadDummyChain(OnPubNet) + for version := min_version; version <= max_version; version++ { + bc, err := LoadDummyChain(OnPubNet, SetHardForkVersion(version)) if err != nil { t.Errorf("failed to create test database: %v", err) } @@ -2637,15 +2747,15 @@ const ( ) // utility function for tests -func readLuaCode(file string) (luaCode string) { +func readLuaCode(t *testing.T, file string) (luaCode string) { + t.Helper() _, filename, _, ok := runtime.Caller(0) if ok != true { return "" } raw, err := os.ReadFile(filepath.Join(filepath.Dir(filename), "test_files", file)) - if err != nil { - return "" - } + require.NoErrorf(t, err, "failed to read "+filename) + require.NotEmpty(t, raw, "failed to read "+filename) return string(raw) } diff --git a/go.mod b/go.mod index 157d5e2a5..55f9e9cd0 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/funkygao/golib v0.0.0-20180314131852-90d4905c1961 github.com/gofrs/uuid v3.2.0+incompatible github.com/golang/mock v1.3.1 - github.com/golang/protobuf v1.3.3 + github.com/golang/protobuf v1.5.3 github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 github.com/hashicorp/golang-lru v0.5.1 github.com/improbable-eng/grpc-web v0.9.6 @@ -42,16 +42,16 @@ require ( github.com/spf13/viper v1.5.0 github.com/stretchr/testify v1.8.4 github.com/willf/bloom v2.0.3+incompatible - golang.org/x/crypto v0.10.0 - golang.org/x/net v0.11.0 - google.golang.org/grpc v1.21.1 + golang.org/x/crypto v0.11.0 + google.golang.org/grpc v1.56.2 + google.golang.org/protobuf v1.31.0 ) require ( github.com/Workiva/go-datastructures v1.0.50 // indirect github.com/beorn7/perks v1.0.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e // indirect github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect github.com/dgraph-io/badger/v3 v3.2103.2 // indirect @@ -59,11 +59,11 @@ require ( github.com/dustin/go-humanize v1.0.0 // indirect github.com/funkygao/assert v0.0.0-20160929004900-4a267e33bc79 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect + github.com/golang/glog v1.1.0 // indirect github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/flatbuffers v1.12.1 // indirect - github.com/google/uuid v1.1.1 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/gorilla/websocket v1.4.1 // indirect github.com/hashicorp/hcl v1.0.1-0.20180906183839-65a6292f0157 // indirect github.com/huin/goupnp v1.0.0 // indirect @@ -123,7 +123,7 @@ require ( github.com/pkg/term v0.0.0-20190109203006-aa71e9d9e942 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.0.0 // indirect - github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect + github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect github.com/prometheus/common v0.4.1 // indirect github.com/prometheus/procfs v0.0.2 // indirect github.com/rs/cors v1.6.0 // indirect @@ -146,12 +146,15 @@ require ( github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect go.opencensus.io v0.22.5 // indirect golang.org/x/mod v0.8.0 // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/term v0.9.0 // indirect - golang.org/x/text v0.10.0 // indirect + golang.org/x/net v0.12.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/term v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect golang.org/x/tools v0.6.0 // indirect - google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect + google.golang.org/grpc/examples v0.0.0-20230724170852-2aa261560586 // indirect gopkg.in/yaml.v2 v2.2.8 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index ba5c1cd4a..0e8dfab42 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,9 @@ github.com/c-bata/go-prompt v0.2.3 h1:jjCS+QhG/sULBhAaBdjb2PlMRVaKXQgn+4yzaauvs2 github.com/c-bata/go-prompt v0.2.3/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -100,8 +101,9 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -111,8 +113,10 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -121,11 +125,13 @@ github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6 github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -397,8 +403,9 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= @@ -510,8 +517,8 @@ golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -534,8 +541,8 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -544,7 +551,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -565,15 +573,15 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -593,20 +601,26 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb h1:i1Ppqkc3WQXikh8bXiwHqAN5Rv3/qDCcRk0/Otx73BY= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI= +google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc/examples v0.0.0-20230724170852-2aa261560586 h1:3cBl7oDZlRZ9VAnaA9QglQNOY+ZP2wZJyGpiz1uuAuU= +google.golang.org/grpc/examples v0.0.0-20230724170852-2aa261560586/go.mod h1:YYPcVQPFEuZQrEwqV6D//WM2s4HnWXtvFr/kII5NKbI= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/mempool/mempool.go b/mempool/mempool.go index b16209d02..64bc9219f 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -586,12 +586,7 @@ func (mp *MemPool) getNameDest(account []byte, owner bool) []byte { return account } - nameState, err := mp.getAccountState([]byte(types.AergoName)) - if err != nil { - mp.Error().Str("for name", string(account)).Msgf("failed to get state %s", types.AergoName) - return nil - } - scs, err := mp.stateDB.OpenContractState(types.ToAccountID([]byte(types.AergoName)), nameState) + scs, err := mp.stateDB.GetNameAccountState() if err != nil { mp.Error().Str("for name", string(account)).Msgf("failed to open contract %s", types.AergoName) return nil @@ -681,7 +676,7 @@ func (mp *MemPool) validateTx(tx types.Transaction, account types.Address) error return err } case types.AergoName: - systemcs, err := mp.stateDB.OpenContractStateAccount(types.ToAccountID([]byte(types.AergoSystem))) + systemcs, err := mp.stateDB.GetSystemAccountState() if err != nil { return err } @@ -693,7 +688,7 @@ func (mp *MemPool) validateTx(tx types.Transaction, account types.Address) error return err } case types.AergoEnterprise: - enterprisecs, err := mp.stateDB.OpenContractStateAccount(types.ToAccountID([]byte(types.AergoEnterprise))) + enterprisecs, err := mp.stateDB.GetEnterpriseAccountState() if err != nil { return err } diff --git a/polaris/server/prpc.go b/polaris/server/prpc.go index 5e046c6ac..8c1451aeb 100644 --- a/polaris/server/prpc.go +++ b/polaris/server/prpc.go @@ -180,6 +180,8 @@ type PRPCServer struct { hub *component.ComponentHub actorHelper p2pcommon.ActorService + + types.UnimplementedPolarisRPCServiceServer } func (rs *PRPCServer) NodeState(ctx context.Context, in *types.NodeReq) (*types.SingleBytes, error) { diff --git a/rpc/admin.go b/rpc/admin.go index 9d04da4a1..064243f3f 100644 --- a/rpc/admin.go +++ b/rpc/admin.go @@ -21,6 +21,8 @@ type AdminService struct { *component.ComponentHub *log.Logger run func() + + types.UnimplementedAdminRPCServiceServer } func NewAdminService(conf *config.RPCConfig, hub *component.ComponentHub) *AdminService { diff --git a/rpc/grpcserver.go b/rpc/grpcserver.go index 9036ba5a5..554efcfe4 100644 --- a/rpc/grpcserver.go +++ b/rpc/grpcserver.go @@ -66,6 +66,8 @@ type AergoRPCService struct { clientAuthLock sync.RWMutex clientAuthOn bool clientAuth map[string]Authentication + + types.UnimplementedAergoRPCServiceServer } // FIXME remove redundant constants diff --git a/state/chainstatedb.go b/state/chainstatedb.go index 1709cfdb7..dd5a00eba 100644 --- a/state/chainstatedb.go +++ b/state/chainstatedb.go @@ -102,7 +102,7 @@ func (sdb *ChainStateDB) SetGenesis(genesis *types.Genesis, bpInit func(*StateDB } aid := types.ToAccountID([]byte(types.AergoSystem)) - scs, err := stateDB.OpenContractStateAccount(aid) + scs, err := stateDB.GetSystemAccountState() if err != nil { return err } diff --git a/state/contract.go b/state/contract.go index 1e7ef6095..a0b9a9998 100644 --- a/state/contract.go +++ b/state/contract.go @@ -17,6 +17,7 @@ func (states *StateDB) OpenContractStateAccount(aid types.AccountID) (*ContractS } return states.OpenContractState(aid, st) } + func (states *StateDB) OpenContractState(aid types.AccountID, st *types.State) (*ContractState, error) { storage := states.cache.get(aid) if storage == nil { diff --git a/tests/common.sh b/tests/common.sh index 3dba9bd69..d0884c4b4 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -1,4 +1,26 @@ +get_deploy_args() { + contract_file=$1 + + #if [ "$fork_version" -ge "4" ]; then + # deploy_args="$contract_file" + #else + ../bin/aergoluac --payload $contract_file > payload.out + deploy_args="--payload `cat payload.out`" + #fi + +} + +deploy() { + + get_deploy_args $1 + + txhash=$(../bin/aergocli --keystore . --password bmttest \ + contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ + $deploy_args | jq .hash | sed 's/"//g') + +} + get_receipt() { txhash=$1 counter=0 diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 77820eb97..bb5defb65 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -88,6 +88,7 @@ check ./test-gas-op.sh check ./test-gas-bf.sh check ./test-gas-verify-proof.sh check ./test-gas-per-function-v2.sh +check ./test-contract-deploy.sh # change the hardfork version set_version 3 @@ -99,6 +100,7 @@ check ./test-gas-op.sh check ./test-gas-bf.sh check ./test-gas-verify-proof.sh check ./test-gas-per-function-v3.sh +check ./test-contract-deploy.sh # change the hardfork version set_version 4 diff --git a/tests/test-contract-deploy.sh b/tests/test-contract-deploy.sh new file mode 100755 index 000000000..8774a6e93 --- /dev/null +++ b/tests/test-contract-deploy.sh @@ -0,0 +1,129 @@ +set -e +source common.sh + +fork_version=$1 + + +echo "-- deploy ARC1 factory --" + +deploy ../contract/vm_dummy/test_files/arc1-factory.lua + +get_receipt $txhash + +status=$(cat receipt.json | jq .status | sed 's/"//g') +arc1_address=$(cat receipt.json | jq .contractAddress | sed 's/"//g') + +assert_equals "$status" "CREATED" + + +echo "-- deploy ARC2 factory --" + +deploy ../contract/vm_dummy/test_files/arc2-factory.lua + +get_receipt $txhash + +status=$(cat receipt.json | jq .status | sed 's/"//g') +arc2_address=$(cat receipt.json | jq .contractAddress | sed 's/"//g') + +assert_equals "$status" "CREATED" + + +echo "-- deploy caller contract --" + +get_deploy_args ../contract/vm_dummy/test_files/token-deployer.lua + +txhash=$(../bin/aergocli --keystore . --password bmttest \ + contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ + $deploy_args "[\"$arc1_address\",\"$arc2_address\"]" | jq .hash | sed 's/"//g') + +get_receipt $txhash + +status=$(cat receipt.json | jq .status | sed 's/"//g') +deployer_address=$(cat receipt.json | jq .contractAddress | sed 's/"//g') + +assert_equals "$status" "CREATED" + + +echo "-- deploy 1 ARC1 contract --" + +txhash=$(../bin/aergocli --keystore . --password bmttest \ + contract call AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ + $arc1_address new_token '["Test","TST",18,1000,{"burnable":true, "mintable":true, "pausable":true, "blacklist":true, "all_approval":true, "limited_approval":true}]' | jq .hash | sed 's/"//g') + +get_receipt $txhash + +status=$(cat receipt.json | jq .status | sed 's/"//g') +ret=$(cat receipt.json | jq .ret | sed 's/"//g') +gasUsed=$(cat receipt.json | jq .gasUsed | sed 's/"//g') + +assert_equals "$status" "SUCCESS" +#assert_equals "$ret" "{}" +#assert_equals "$gasUsed" "117861" + + +echo "-- deploy 1 ARC2 contract --" + +txhash=$(../bin/aergocli --keystore . --password bmttest \ + contract call AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ + $arc2_address new_arc2_nft '["Test NFT 1","NFT1",null,{"burnable":true, "mintable":true, "metadata":true, "pausable":true, "blacklist":true, "approval":true, "searchable":true, "non_transferable":true, "recallable":true}]' | jq .hash | sed 's/"//g') + +get_receipt $txhash + +status=$(cat receipt.json | jq .status | sed 's/"//g') +ret=$(cat receipt.json | jq .ret | sed 's/"//g') +gasUsed=$(cat receipt.json | jq .gasUsed | sed 's/"//g') + +assert_equals "$status" "SUCCESS" +#assert_equals "$ret" "{}" +#assert_equals "$gasUsed" "117861" + + +echo "-- deploy 1 ARC1 and 1 ARC2 contracts --" + +txhash=$(../bin/aergocli --keystore . --password bmttest \ + contract call AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ + $deployer_address deploy_tokens '[1,1]' | jq .hash | sed 's/"//g') + +get_receipt $txhash + +status=$(cat receipt.json | jq .status | sed 's/"//g') +ret=$(cat receipt.json | jq .ret | sed 's/"//g') +gasUsed=$(cat receipt.json | jq .gasUsed | sed 's/"//g') + +assert_equals "$status" "SUCCESS" +#assert_equals "$ret" "{}" +#assert_equals "$gasUsed" "117861" + + +echo "-- deploy 2 ARC1 and 2 ARC2 contracts --" + +txhash=$(../bin/aergocli --keystore . --password bmttest \ + contract call AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ + $deployer_address deploy_tokens '[2,2]' | jq .hash | sed 's/"//g') + +get_receipt $txhash + +status=$(cat receipt.json | jq .status | sed 's/"//g') +ret=$(cat receipt.json | jq .ret | sed 's/"//g') +gasUsed=$(cat receipt.json | jq .gasUsed | sed 's/"//g') + +assert_equals "$status" "SUCCESS" +#assert_equals "$ret" "{}" +#assert_equals "$gasUsed" "117861" + + +echo "-- deploy 3 ARC1 and 3 ARC2 contracts --" + +txhash=$(../bin/aergocli --keystore . --password bmttest \ + contract call AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ + $deployer_address deploy_tokens '[3,3]' | jq .hash | sed 's/"//g') + +get_receipt $txhash + +status=$(cat receipt.json | jq .status | sed 's/"//g') +ret=$(cat receipt.json | jq .ret | sed 's/"//g') +gasUsed=$(cat receipt.json | jq .gasUsed | sed 's/"//g') + +assert_equals "$status" "SUCCESS" +#assert_equals "$ret" "{}" +#assert_equals "$gasUsed" "117861" diff --git a/tests/test-gas-bf.sh b/tests/test-gas-bf.sh index 0665d2372..252231d28 100755 --- a/tests/test-gas-bf.sh +++ b/tests/test-gas-bf.sh @@ -6,11 +6,7 @@ fork_version=$1 echo "-- deploy --" -../bin/aergoluac --payload ../contract/vm_dummy/test_files/gas_bf.lua > payload.out - -txhash=$(../bin/aergocli --keystore . --password bmttest \ - contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ - --payload `cat payload.out` | jq .hash | sed 's/"//g') +deploy ../contract/vm_dummy/test_files/gas_bf.lua get_receipt $txhash diff --git a/tests/test-gas-deploy.sh b/tests/test-gas-deploy.sh index 75ba50fe7..21cc42d43 100755 --- a/tests/test-gas-deploy.sh +++ b/tests/test-gas-deploy.sh @@ -6,11 +6,7 @@ fork_version=$1 echo "-- deploy --" -../bin/aergoluac --payload ../contract/vm_dummy/test_files/gas_deploy.lua > payload.out - -txhash=$(../bin/aergocli --keystore . --password bmttest \ - contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ - --payload `cat payload.out` | jq .hash | sed 's/"//g') +deploy ../contract/vm_dummy/test_files/gas_deploy.lua get_receipt $txhash diff --git a/tests/test-gas-op.sh b/tests/test-gas-op.sh index 790d34809..6ee1cc2d5 100755 --- a/tests/test-gas-op.sh +++ b/tests/test-gas-op.sh @@ -6,11 +6,7 @@ fork_version=$1 echo "-- deploy --" -../bin/aergoluac --payload ../contract/vm_dummy/test_files/gas_op.lua > payload.out - -txhash=$(../bin/aergocli --keystore . --password bmttest \ - contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ - --payload `cat payload.out` | jq .hash | sed 's/"//g') +deploy ../contract/vm_dummy/test_files/gas_op.lua get_receipt $txhash diff --git a/tests/test-gas-per-function-v2.sh b/tests/test-gas-per-function-v2.sh index 8b5432c73..3fd16a4a8 100755 --- a/tests/test-gas-per-function-v2.sh +++ b/tests/test-gas-per-function-v2.sh @@ -6,11 +6,7 @@ fork_version=$1 echo "-- deploy --" -../bin/aergoluac --payload ../contract/vm_dummy/test_files/gas_per_function.lua > payload.out - -txhash=$(../bin/aergocli --keystore . --password bmttest \ - contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ - --payload `cat payload.out` | jq .hash | sed 's/"//g') +deploy ../contract/vm_dummy/test_files/gas_per_function.lua get_receipt $txhash diff --git a/tests/test-gas-per-function-v3.sh b/tests/test-gas-per-function-v3.sh index bff9d0764..abe5ad2ee 100755 --- a/tests/test-gas-per-function-v3.sh +++ b/tests/test-gas-per-function-v3.sh @@ -6,11 +6,7 @@ fork_version=$1 echo "-- deploy --" -../bin/aergoluac --payload ../contract/vm_dummy/test_files/gas_per_function.lua > payload.out - -txhash=$(../bin/aergocli --keystore . --password bmttest \ - contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ - --payload `cat payload.out` | jq .hash | sed 's/"//g') +deploy ../contract/vm_dummy/test_files/gas_per_function.lua get_receipt $txhash diff --git a/tests/test-gas-verify-proof.sh b/tests/test-gas-verify-proof.sh index 2e4e6cd4c..3fcf2d601 100755 --- a/tests/test-gas-verify-proof.sh +++ b/tests/test-gas-verify-proof.sh @@ -6,11 +6,7 @@ fork_version=$1 echo "-- deploy --" -../bin/aergoluac --payload ../contract/vm_dummy/test_files/feature_luacryptoverifyproof.lua > payload.out - -txhash=$(../bin/aergocli --keystore . --password bmttest \ - contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ - --payload `cat payload.out` | jq .hash | sed 's/"//g') +deploy ../contract/vm_dummy/test_files/feature_luacryptoverifyproof.lua get_receipt $txhash diff --git a/tests/test-max-call-depth.sh b/tests/test-max-call-depth.sh index 41f90f5c9..ba5aadae7 100755 --- a/tests/test-max-call-depth.sh +++ b/tests/test-max-call-depth.sh @@ -1,6 +1,8 @@ set -e source common.sh +fork_version=$1 + # deploy 66 identical contracts using test-max-call-depth-2.lua # and store the returned addresses in an array @@ -13,13 +15,13 @@ declare -a addresses account_state=$(../bin/aergocli getstate --address AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R) nonce=$(echo $account_state | jq .nonce | sed 's/"//g') -../bin/aergoluac --payload test-max-call-depth-2.lua > payload.out +get_deploy_args test-max-call-depth-2.lua for i in {1..66} do txhash=$(../bin/aergocli --keystore . --password bmttest --nonce $(($nonce+$i)) \ contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ - --payload `cat payload.out` | jq .hash | sed 's/"//g') + $deploy_args | jq .hash | sed 's/"//g') txhashes[$i]=$txhash done @@ -136,7 +138,7 @@ echo "-- deploy 66 contracts --" account_state=$(../bin/aergocli getstate --address AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R) nonce=$(echo $account_state | jq .nonce | sed 's/"//g') -../bin/aergoluac --payload test-max-call-depth-3.lua > payload.out +get_deploy_args test-max-call-depth-3.lua declare -a txhashes declare -a addresses @@ -145,7 +147,7 @@ for i in {1..66} do txhash=$(../bin/aergocli --keystore . --password bmttest --nonce $(($nonce+$i)) \ contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ - --payload `cat payload.out` | jq .hash | sed 's/"//g') + $deploy_args | jq .hash | sed 's/"//g') txhashes[$i]=$txhash done @@ -279,7 +281,7 @@ echo "-- deploy 4 contracts --" account_state=$(../bin/aergocli getstate --address AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R) nonce=$(echo $account_state | jq .nonce | sed 's/"//g') -../bin/aergoluac --payload test-max-call-depth-2.lua > payload.out +get_deploy_args test-max-call-depth-2.lua declare -a txhashes declare -a addresses @@ -288,7 +290,7 @@ for i in {1..4} do txhash=$(../bin/aergocli --keystore . --password bmttest --nonce $(($nonce+$i)) \ contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ - --payload `cat payload.out` | jq .hash | sed 's/"//g') + $deploy_args | jq .hash | sed 's/"//g') txhashes[$i]=$txhash done @@ -417,7 +419,7 @@ echo "-- deploy 2 contracts --" account_state=$(../bin/aergocli getstate --address AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R) nonce=$(echo $account_state | jq .nonce | sed 's/"//g') -../bin/aergoluac --payload test-max-call-depth-2.lua > payload.out +get_deploy_args test-max-call-depth-2.lua declare -a txhashes declare -a addresses @@ -426,7 +428,7 @@ for i in {1..2} do txhash=$(../bin/aergocli --keystore . --password bmttest --nonce $(($nonce+$i)) \ contract deploy AmPpcKvToDCUkhT1FJjdbNvR4kNDhLFJGHkSqfjWe3QmHm96qv4R \ - --payload `cat payload.out` | jq .hash | sed 's/"//g') + $deploy_args | jq .hash | sed 's/"//g') txhashes[$i]=$txhash done diff --git a/types/account.pb.go b/types/account.pb.go index 6fd616ed4..08ea66579 100644 --- a/types/account.pb.go +++ b/types/account.pb.go @@ -1,113 +1,206 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.15.8 // source: account.proto package types -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type Account struct { - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Account) Reset() { *m = Account{} } -func (m *Account) String() string { return proto.CompactTextString(m) } -func (*Account) ProtoMessage() {} -func (*Account) Descriptor() ([]byte, []int) { - return fileDescriptor_account_e10f85a88c481e81, []int{0} -} -func (m *Account) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Account.Unmarshal(m, b) + Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` } -func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Account.Marshal(b, m, deterministic) -} -func (dst *Account) XXX_Merge(src proto.Message) { - xxx_messageInfo_Account.Merge(dst, src) + +func (x *Account) Reset() { + *x = Account{} + if protoimpl.UnsafeEnabled { + mi := &file_account_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Account) XXX_Size() int { - return xxx_messageInfo_Account.Size(m) + +func (x *Account) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Account) XXX_DiscardUnknown() { - xxx_messageInfo_Account.DiscardUnknown(m) + +func (*Account) ProtoMessage() {} + +func (x *Account) ProtoReflect() protoreflect.Message { + mi := &file_account_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Account proto.InternalMessageInfo +// Deprecated: Use Account.ProtoReflect.Descriptor instead. +func (*Account) Descriptor() ([]byte, []int) { + return file_account_proto_rawDescGZIP(), []int{0} +} -func (m *Account) GetAddress() []byte { - if m != nil { - return m.Address +func (x *Account) GetAddress() []byte { + if x != nil { + return x.Address } return nil } type AccountList struct { - Accounts []*Account `protobuf:"bytes,1,rep,name=accounts" json:"accounts,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AccountList) Reset() { *m = AccountList{} } -func (m *AccountList) String() string { return proto.CompactTextString(m) } -func (*AccountList) ProtoMessage() {} -func (*AccountList) Descriptor() ([]byte, []int) { - return fileDescriptor_account_e10f85a88c481e81, []int{1} -} -func (m *AccountList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AccountList.Unmarshal(m, b) + Accounts []*Account `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` } -func (m *AccountList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AccountList.Marshal(b, m, deterministic) -} -func (dst *AccountList) XXX_Merge(src proto.Message) { - xxx_messageInfo_AccountList.Merge(dst, src) + +func (x *AccountList) Reset() { + *x = AccountList{} + if protoimpl.UnsafeEnabled { + mi := &file_account_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AccountList) XXX_Size() int { - return xxx_messageInfo_AccountList.Size(m) + +func (x *AccountList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AccountList) XXX_DiscardUnknown() { - xxx_messageInfo_AccountList.DiscardUnknown(m) + +func (*AccountList) ProtoMessage() {} + +func (x *AccountList) ProtoReflect() protoreflect.Message { + mi := &file_account_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AccountList proto.InternalMessageInfo +// Deprecated: Use AccountList.ProtoReflect.Descriptor instead. +func (*AccountList) Descriptor() ([]byte, []int) { + return file_account_proto_rawDescGZIP(), []int{1} +} -func (m *AccountList) GetAccounts() []*Account { - if m != nil { - return m.Accounts +func (x *AccountList) GetAccounts() []*Account { + if x != nil { + return x.Accounts } return nil } -func init() { - proto.RegisterType((*Account)(nil), "types.Account") - proto.RegisterType((*AccountList)(nil), "types.AccountList") +var File_account_proto protoreflect.FileDescriptor + +var file_account_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x23, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x39, 0x0a, 0x0b, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x08, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x08, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x42, 0x08, 0x5a, 0x06, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_account_proto_rawDescOnce sync.Once + file_account_proto_rawDescData = file_account_proto_rawDesc +) + +func file_account_proto_rawDescGZIP() []byte { + file_account_proto_rawDescOnce.Do(func() { + file_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_account_proto_rawDescData) + }) + return file_account_proto_rawDescData } -func init() { proto.RegisterFile("account.proto", fileDescriptor_account_e10f85a88c481e81) } +var file_account_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_account_proto_goTypes = []interface{}{ + (*Account)(nil), // 0: types.Account + (*AccountList)(nil), // 1: types.AccountList +} +var file_account_proto_depIdxs = []int32{ + 0, // 0: types.AccountList.accounts:type_name -> types.Account + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} -var fileDescriptor_account_e10f85a88c481e81 = []byte{ - // 110 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0x4c, 0x4e, 0xce, - 0x2f, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2d, 0xa9, 0x2c, 0x48, 0x2d, - 0x56, 0x52, 0xe6, 0x62, 0x77, 0x84, 0x88, 0x0b, 0x49, 0x70, 0xb1, 0x27, 0xa6, 0xa4, 0x14, 0xa5, - 0x16, 0x17, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x04, 0xc1, 0xb8, 0x4a, 0x96, 0x5c, 0xdc, 0x50, - 0x45, 0x3e, 0x99, 0xc5, 0x25, 0x42, 0x5a, 0x5c, 0x1c, 0x50, 0xb3, 0x40, 0x2a, 0x99, 0x35, 0xb8, - 0x8d, 0xf8, 0xf4, 0xc0, 0xa6, 0xe9, 0x41, 0x55, 0x05, 0xc1, 0xe5, 0x93, 0xd8, 0xc0, 0xb6, 0x19, - 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x7d, 0x9c, 0x50, 0x7e, 0x00, 0x00, 0x00, +func init() { file_account_proto_init() } +func file_account_proto_init() { + if File_account_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Account); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_account_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_account_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_account_proto_goTypes, + DependencyIndexes: file_account_proto_depIdxs, + MessageInfos: file_account_proto_msgTypes, + }.Build() + File_account_proto = out.File + file_account_proto_rawDesc = nil + file_account_proto_goTypes = nil + file_account_proto_depIdxs = nil } diff --git a/types/admin.pb.go b/types/admin.pb.go index ed3153efc..f15e7256f 100644 --- a/types/admin.pb.go +++ b/types/admin.pb.go @@ -1,152 +1,80 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.15.8 // source: admin.proto package types import ( - fmt "fmt" - - proto "github.com/golang/protobuf/proto" - - math "math" - - context "golang.org/x/net/context" - - grpc "google.golang.org/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// AdminRPCServiceClient is the client API for AdminRPCService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AdminRPCServiceClient interface { - // Returns the TX-relasted statistics of the current mempool. - MempoolTxStat(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SingleBytes, error) - // Returns the TX-relasted statistics of the current mempool. - MempoolTx(ctx context.Context, in *AccountList, opts ...grpc.CallOption) (*SingleBytes, error) -} - -type adminRPCServiceClient struct { - cc *grpc.ClientConn -} - -func NewAdminRPCServiceClient(cc *grpc.ClientConn) AdminRPCServiceClient { - return &adminRPCServiceClient{cc} -} - -func (c *adminRPCServiceClient) MempoolTxStat(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SingleBytes, error) { - out := new(SingleBytes) - err := c.cc.Invoke(ctx, "/types.AdminRPCService/MempoolTxStat", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *adminRPCServiceClient) MempoolTx(ctx context.Context, in *AccountList, opts ...grpc.CallOption) (*SingleBytes, error) { - out := new(SingleBytes) - err := c.cc.Invoke(ctx, "/types.AdminRPCService/MempoolTx", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) -// AdminRPCServiceServer is the server API for AdminRPCService service. -type AdminRPCServiceServer interface { - // Returns the TX-relasted statistics of the current mempool. - MempoolTxStat(context.Context, *Empty) (*SingleBytes, error) - // Returns the TX-relasted statistics of the current mempool. - MempoolTx(context.Context, *AccountList) (*SingleBytes, error) +var File_admin_proto protoreflect.FileDescriptor + +var file_admin_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x1a, 0x09, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x7d, + 0x0a, 0x0f, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x52, 0x50, 0x43, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x33, 0x0a, 0x0d, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, 0x6c, 0x54, 0x78, 0x53, 0x74, + 0x61, 0x74, 0x12, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x1a, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x09, 0x4d, 0x65, 0x6d, 0x70, 0x6f, 0x6f, + 0x6c, 0x54, 0x78, 0x12, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x00, 0x42, 0x08, 0x5a, + 0x06, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func RegisterAdminRPCServiceServer(s *grpc.Server, srv AdminRPCServiceServer) { - s.RegisterService(&_AdminRPCService_serviceDesc, srv) +var file_admin_proto_goTypes = []interface{}{ + (*Empty)(nil), // 0: types.Empty + (*AccountList)(nil), // 1: types.AccountList + (*SingleBytes)(nil), // 2: types.SingleBytes } - -func _AdminRPCService_MempoolTxStat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdminRPCServiceServer).MempoolTxStat(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AdminRPCService/MempoolTxStat", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdminRPCServiceServer).MempoolTxStat(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) +var file_admin_proto_depIdxs = []int32{ + 0, // 0: types.AdminRPCService.MempoolTxStat:input_type -> types.Empty + 1, // 1: types.AdminRPCService.MempoolTx:input_type -> types.AccountList + 2, // 2: types.AdminRPCService.MempoolTxStat:output_type -> types.SingleBytes + 2, // 3: types.AdminRPCService.MempoolTx:output_type -> types.SingleBytes + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } -func _AdminRPCService_MempoolTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AccountList) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AdminRPCServiceServer).MempoolTx(ctx, in) +func init() { file_admin_proto_init() } +func file_admin_proto_init() { + if File_admin_proto != nil { + return } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AdminRPCService/MempoolTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AdminRPCServiceServer).MempoolTx(ctx, req.(*AccountList)) - } - return interceptor(ctx, in, info, handler) -} - -var _AdminRPCService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "types.AdminRPCService", - HandlerType: (*AdminRPCServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "MempoolTxStat", - Handler: _AdminRPCService_MempoolTxStat_Handler, + file_rpc_proto_init() + file_account_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, }, - { - MethodName: "MempoolTx", - Handler: _AdminRPCService_MempoolTx_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "admin.proto", -} - -func init() { proto.RegisterFile("admin.proto", fileDescriptor_admin_dc33129327e562d2) } - -var fileDescriptor_admin_dc33129327e562d2 = []byte{ - // 147 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4e, 0x4c, 0xc9, 0xcd, - 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2d, 0xa9, 0x2c, 0x48, 0x2d, 0x96, 0xe2, - 0x2c, 0x2a, 0x48, 0x86, 0x88, 0x48, 0xf1, 0x26, 0x26, 0x27, 0xe7, 0x97, 0xe6, 0x95, 0x40, 0xb8, - 0x46, 0xb5, 0x5c, 0xfc, 0x8e, 0x20, 0xf5, 0x41, 0x01, 0xce, 0xc1, 0xa9, 0x45, 0x65, 0x99, 0xc9, - 0xa9, 0x42, 0xc6, 0x5c, 0xbc, 0xbe, 0xa9, 0xb9, 0x05, 0xf9, 0xf9, 0x39, 0x21, 0x15, 0xc1, 0x25, - 0x89, 0x25, 0x42, 0x3c, 0x7a, 0x60, 0x53, 0xf4, 0x5c, 0x73, 0x0b, 0x4a, 0x2a, 0xa5, 0x84, 0xa0, - 0xbc, 0xe0, 0xcc, 0xbc, 0xf4, 0x9c, 0x54, 0xa7, 0xca, 0x92, 0xd4, 0x62, 0x25, 0x06, 0x21, 0x53, - 0x2e, 0x4e, 0xb8, 0x26, 0x21, 0x98, 0x12, 0x47, 0x88, 0x55, 0x3e, 0x99, 0xc5, 0x25, 0xd8, 0xb5, - 0x25, 0xb1, 0x81, 0x5d, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x92, 0xc9, 0x09, 0xab, 0xb5, - 0x00, 0x00, 0x00, + GoTypes: file_admin_proto_goTypes, + DependencyIndexes: file_admin_proto_depIdxs, + }.Build() + File_admin_proto = out.File + file_admin_proto_rawDesc = nil + file_admin_proto_goTypes = nil + file_admin_proto_depIdxs = nil } diff --git a/types/admin_grpc.pb.go b/types/admin_grpc.pb.go new file mode 100644 index 000000000..d1638c08f --- /dev/null +++ b/types/admin_grpc.pb.go @@ -0,0 +1,150 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.15.8 +// source: admin.proto + +package types + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AdminRPCService_MempoolTxStat_FullMethodName = "/types.AdminRPCService/MempoolTxStat" + AdminRPCService_MempoolTx_FullMethodName = "/types.AdminRPCService/MempoolTx" +) + +// AdminRPCServiceClient is the client API for AdminRPCService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AdminRPCServiceClient interface { + // Returns the TX-relasted statistics of the current mempool. + MempoolTxStat(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SingleBytes, error) + // Returns the TX-relasted statistics of the current mempool. + MempoolTx(ctx context.Context, in *AccountList, opts ...grpc.CallOption) (*SingleBytes, error) +} + +type adminRPCServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAdminRPCServiceClient(cc grpc.ClientConnInterface) AdminRPCServiceClient { + return &adminRPCServiceClient{cc} +} + +func (c *adminRPCServiceClient) MempoolTxStat(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SingleBytes, error) { + out := new(SingleBytes) + err := c.cc.Invoke(ctx, AdminRPCService_MempoolTxStat_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminRPCServiceClient) MempoolTx(ctx context.Context, in *AccountList, opts ...grpc.CallOption) (*SingleBytes, error) { + out := new(SingleBytes) + err := c.cc.Invoke(ctx, AdminRPCService_MempoolTx_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AdminRPCServiceServer is the server API for AdminRPCService service. +// All implementations must embed UnimplementedAdminRPCServiceServer +// for forward compatibility +type AdminRPCServiceServer interface { + // Returns the TX-relasted statistics of the current mempool. + MempoolTxStat(context.Context, *Empty) (*SingleBytes, error) + // Returns the TX-relasted statistics of the current mempool. + MempoolTx(context.Context, *AccountList) (*SingleBytes, error) + mustEmbedUnimplementedAdminRPCServiceServer() +} + +// UnimplementedAdminRPCServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAdminRPCServiceServer struct { +} + +func (UnimplementedAdminRPCServiceServer) MempoolTxStat(context.Context, *Empty) (*SingleBytes, error) { + return nil, status.Errorf(codes.Unimplemented, "method MempoolTxStat not implemented") +} +func (UnimplementedAdminRPCServiceServer) MempoolTx(context.Context, *AccountList) (*SingleBytes, error) { + return nil, status.Errorf(codes.Unimplemented, "method MempoolTx not implemented") +} +func (UnimplementedAdminRPCServiceServer) mustEmbedUnimplementedAdminRPCServiceServer() {} + +// UnsafeAdminRPCServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AdminRPCServiceServer will +// result in compilation errors. +type UnsafeAdminRPCServiceServer interface { + mustEmbedUnimplementedAdminRPCServiceServer() +} + +func RegisterAdminRPCServiceServer(s grpc.ServiceRegistrar, srv AdminRPCServiceServer) { + s.RegisterService(&AdminRPCService_ServiceDesc, srv) +} + +func _AdminRPCService_MempoolTxStat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminRPCServiceServer).MempoolTxStat(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AdminRPCService_MempoolTxStat_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminRPCServiceServer).MempoolTxStat(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _AdminRPCService_MempoolTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AccountList) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminRPCServiceServer).MempoolTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AdminRPCService_MempoolTx_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminRPCServiceServer).MempoolTx(ctx, req.(*AccountList)) + } + return interceptor(ctx, in, info, handler) +} + +// AdminRPCService_ServiceDesc is the grpc.ServiceDesc for AdminRPCService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AdminRPCService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "types.AdminRPCService", + HandlerType: (*AdminRPCServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "MempoolTxStat", + Handler: _AdminRPCService_MempoolTxStat_Handler, + }, + { + MethodName: "MempoolTx", + Handler: _AdminRPCService_MempoolTx_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin.proto", +} diff --git a/types/aergo_raft.pb.go b/types/aergo_raft.pb.go new file mode 100644 index 000000000..6d7b06911 --- /dev/null +++ b/types/aergo_raft.pb.go @@ -0,0 +1,851 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.15.8 +// source: aergo_raft.proto + +package types + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// cluster member for raft consensus +type MembershipChangeType int32 + +const ( + MembershipChangeType_ADD_MEMBER MembershipChangeType = 0 + MembershipChangeType_REMOVE_MEMBER MembershipChangeType = 1 +) + +// Enum value maps for MembershipChangeType. +var ( + MembershipChangeType_name = map[int32]string{ + 0: "ADD_MEMBER", + 1: "REMOVE_MEMBER", + } + MembershipChangeType_value = map[string]int32{ + "ADD_MEMBER": 0, + "REMOVE_MEMBER": 1, + } +) + +func (x MembershipChangeType) Enum() *MembershipChangeType { + p := new(MembershipChangeType) + *p = x + return p +} + +func (x MembershipChangeType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MembershipChangeType) Descriptor() protoreflect.EnumDescriptor { + return file_aergo_raft_proto_enumTypes[0].Descriptor() +} + +func (MembershipChangeType) Type() protoreflect.EnumType { + return &file_aergo_raft_proto_enumTypes[0] +} + +func (x MembershipChangeType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MembershipChangeType.Descriptor instead. +func (MembershipChangeType) EnumDescriptor() ([]byte, []int) { + return file_aergo_raft_proto_rawDescGZIP(), []int{0} +} + +type ConfChangeState int32 + +const ( + ConfChangeState_CONF_CHANGE_STATE_PROPOSED ConfChangeState = 0 + ConfChangeState_CONF_CHANGE_STATE_SAVED ConfChangeState = 1 + ConfChangeState_CONF_CHANGE_STATE_APPLIED ConfChangeState = 2 +) + +// Enum value maps for ConfChangeState. +var ( + ConfChangeState_name = map[int32]string{ + 0: "CONF_CHANGE_STATE_PROPOSED", + 1: "CONF_CHANGE_STATE_SAVED", + 2: "CONF_CHANGE_STATE_APPLIED", + } + ConfChangeState_value = map[string]int32{ + "CONF_CHANGE_STATE_PROPOSED": 0, + "CONF_CHANGE_STATE_SAVED": 1, + "CONF_CHANGE_STATE_APPLIED": 2, + } +) + +func (x ConfChangeState) Enum() *ConfChangeState { + p := new(ConfChangeState) + *p = x + return p +} + +func (x ConfChangeState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ConfChangeState) Descriptor() protoreflect.EnumDescriptor { + return file_aergo_raft_proto_enumTypes[1].Descriptor() +} + +func (ConfChangeState) Type() protoreflect.EnumType { + return &file_aergo_raft_proto_enumTypes[1] +} + +func (x ConfChangeState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ConfChangeState.Descriptor instead. +func (ConfChangeState) EnumDescriptor() ([]byte, []int) { + return file_aergo_raft_proto_rawDescGZIP(), []int{1} +} + +type MemberAttr struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` + PeerID []byte `protobuf:"bytes,4,opt,name=peerID,proto3" json:"peerID,omitempty"` +} + +func (x *MemberAttr) Reset() { + *x = MemberAttr{} + if protoimpl.UnsafeEnabled { + mi := &file_aergo_raft_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MemberAttr) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MemberAttr) ProtoMessage() {} + +func (x *MemberAttr) ProtoReflect() protoreflect.Message { + mi := &file_aergo_raft_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MemberAttr.ProtoReflect.Descriptor instead. +func (*MemberAttr) Descriptor() ([]byte, []int) { + return file_aergo_raft_proto_rawDescGZIP(), []int{0} +} + +func (x *MemberAttr) GetID() uint64 { + if x != nil { + return x.ID + } + return 0 +} + +func (x *MemberAttr) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MemberAttr) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *MemberAttr) GetPeerID() []byte { + if x != nil { + return x.PeerID + } + return nil +} + +type MembershipChange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type MembershipChangeType `protobuf:"varint,1,opt,name=type,proto3,enum=types.MembershipChangeType" json:"type,omitempty"` + RequestID uint64 `protobuf:"varint,2,opt,name=requestID,proto3" json:"requestID,omitempty"` + Attr *MemberAttr `protobuf:"bytes,3,opt,name=attr,proto3" json:"attr,omitempty"` +} + +func (x *MembershipChange) Reset() { + *x = MembershipChange{} + if protoimpl.UnsafeEnabled { + mi := &file_aergo_raft_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MembershipChange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MembershipChange) ProtoMessage() {} + +func (x *MembershipChange) ProtoReflect() protoreflect.Message { + mi := &file_aergo_raft_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MembershipChange.ProtoReflect.Descriptor instead. +func (*MembershipChange) Descriptor() ([]byte, []int) { + return file_aergo_raft_proto_rawDescGZIP(), []int{1} +} + +func (x *MembershipChange) GetType() MembershipChangeType { + if x != nil { + return x.Type + } + return MembershipChangeType_ADD_MEMBER +} + +func (x *MembershipChange) GetRequestID() uint64 { + if x != nil { + return x.RequestID + } + return 0 +} + +func (x *MembershipChange) GetAttr() *MemberAttr { + if x != nil { + return x.Attr + } + return nil +} + +type MembershipChangeReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Attr *MemberAttr `protobuf:"bytes,1,opt,name=attr,proto3" json:"attr,omitempty"` +} + +func (x *MembershipChangeReply) Reset() { + *x = MembershipChangeReply{} + if protoimpl.UnsafeEnabled { + mi := &file_aergo_raft_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MembershipChangeReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MembershipChangeReply) ProtoMessage() {} + +func (x *MembershipChangeReply) ProtoReflect() protoreflect.Message { + mi := &file_aergo_raft_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MembershipChangeReply.ProtoReflect.Descriptor instead. +func (*MembershipChangeReply) Descriptor() ([]byte, []int) { + return file_aergo_raft_proto_rawDescGZIP(), []int{2} +} + +func (x *MembershipChangeReply) GetAttr() *MemberAttr { + if x != nil { + return x.Attr + } + return nil +} + +type HardStateInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Term uint64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` + Commit uint64 `protobuf:"varint,2,opt,name=commit,proto3" json:"commit,omitempty"` +} + +func (x *HardStateInfo) Reset() { + *x = HardStateInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_aergo_raft_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HardStateInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HardStateInfo) ProtoMessage() {} + +func (x *HardStateInfo) ProtoReflect() protoreflect.Message { + mi := &file_aergo_raft_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HardStateInfo.ProtoReflect.Descriptor instead. +func (*HardStateInfo) Descriptor() ([]byte, []int) { + return file_aergo_raft_proto_rawDescGZIP(), []int{3} +} + +func (x *HardStateInfo) GetTerm() uint64 { + if x != nil { + return x.Term + } + return 0 +} + +func (x *HardStateInfo) GetCommit() uint64 { + if x != nil { + return x.Commit + } + return 0 +} + +// data types for raft support +// GetClusterInfoRequest +type GetClusterInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BestBlockHash []byte `protobuf:"bytes,1,opt,name=bestBlockHash,proto3" json:"bestBlockHash,omitempty"` +} + +func (x *GetClusterInfoRequest) Reset() { + *x = GetClusterInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_aergo_raft_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetClusterInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterInfoRequest) ProtoMessage() {} + +func (x *GetClusterInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_aergo_raft_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterInfoRequest.ProtoReflect.Descriptor instead. +func (*GetClusterInfoRequest) Descriptor() ([]byte, []int) { + return file_aergo_raft_proto_rawDescGZIP(), []int{4} +} + +func (x *GetClusterInfoRequest) GetBestBlockHash() []byte { + if x != nil { + return x.BestBlockHash + } + return nil +} + +type GetClusterInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChainID []byte `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` + ClusterID uint64 `protobuf:"varint,2,opt,name=clusterID,proto3" json:"clusterID,omitempty"` + Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` + MbrAttrs []*MemberAttr `protobuf:"bytes,4,rep,name=mbrAttrs,proto3" json:"mbrAttrs,omitempty"` + BestBlockNo uint64 `protobuf:"varint,5,opt,name=bestBlockNo,proto3" json:"bestBlockNo,omitempty"` // best block number of this node + HardStateInfo *HardStateInfo `protobuf:"bytes,6,opt,name=hardStateInfo,proto3" json:"hardStateInfo,omitempty"` // hardstate corresponding to bestblockhash of requester +} + +func (x *GetClusterInfoResponse) Reset() { + *x = GetClusterInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_aergo_raft_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetClusterInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetClusterInfoResponse) ProtoMessage() {} + +func (x *GetClusterInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_aergo_raft_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetClusterInfoResponse.ProtoReflect.Descriptor instead. +func (*GetClusterInfoResponse) Descriptor() ([]byte, []int) { + return file_aergo_raft_proto_rawDescGZIP(), []int{5} +} + +func (x *GetClusterInfoResponse) GetChainID() []byte { + if x != nil { + return x.ChainID + } + return nil +} + +func (x *GetClusterInfoResponse) GetClusterID() uint64 { + if x != nil { + return x.ClusterID + } + return 0 +} + +func (x *GetClusterInfoResponse) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *GetClusterInfoResponse) GetMbrAttrs() []*MemberAttr { + if x != nil { + return x.MbrAttrs + } + return nil +} + +func (x *GetClusterInfoResponse) GetBestBlockNo() uint64 { + if x != nil { + return x.BestBlockNo + } + return 0 +} + +func (x *GetClusterInfoResponse) GetHardStateInfo() *HardStateInfo { + if x != nil { + return x.HardStateInfo + } + return nil +} + +type ConfChangeProgress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State ConfChangeState `protobuf:"varint,1,opt,name=State,proto3,enum=types.ConfChangeState" json:"State,omitempty"` + Err string `protobuf:"bytes,2,opt,name=Err,proto3" json:"Err,omitempty"` + Members []*MemberAttr `protobuf:"bytes,3,rep,name=Members,proto3" json:"Members,omitempty"` +} + +func (x *ConfChangeProgress) Reset() { + *x = ConfChangeProgress{} + if protoimpl.UnsafeEnabled { + mi := &file_aergo_raft_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfChangeProgress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfChangeProgress) ProtoMessage() {} + +func (x *ConfChangeProgress) ProtoReflect() protoreflect.Message { + mi := &file_aergo_raft_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfChangeProgress.ProtoReflect.Descriptor instead. +func (*ConfChangeProgress) Descriptor() ([]byte, []int) { + return file_aergo_raft_proto_rawDescGZIP(), []int{6} +} + +func (x *ConfChangeProgress) GetState() ConfChangeState { + if x != nil { + return x.State + } + return ConfChangeState_CONF_CHANGE_STATE_PROPOSED +} + +func (x *ConfChangeProgress) GetErr() string { + if x != nil { + return x.Err + } + return "" +} + +func (x *ConfChangeProgress) GetMembers() []*MemberAttr { + if x != nil { + return x.Members + } + return nil +} + +// SnapshotResponse is response message of receiving peer +type SnapshotResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status ResultStatus `protobuf:"varint,1,opt,name=status,proto3,enum=types.ResultStatus" json:"status,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *SnapshotResponse) Reset() { + *x = SnapshotResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_aergo_raft_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SnapshotResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SnapshotResponse) ProtoMessage() {} + +func (x *SnapshotResponse) ProtoReflect() protoreflect.Message { + mi := &file_aergo_raft_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SnapshotResponse.ProtoReflect.Descriptor instead. +func (*SnapshotResponse) Descriptor() ([]byte, []int) { + return file_aergo_raft_proto_rawDescGZIP(), []int{7} +} + +func (x *SnapshotResponse) GetStatus() ResultStatus { + if x != nil { + return x.Status + } + return ResultStatus_OK +} + +func (x *SnapshotResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_aergo_raft_proto protoreflect.FileDescriptor + +var file_aergo_raft_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x61, 0x65, 0x72, 0x67, 0x6f, 0x5f, 0x72, 0x61, 0x66, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x09, 0x70, 0x32, 0x70, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x62, 0x0a, 0x0a, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x74, + 0x74, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, + 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x44, 0x22, 0x88, 0x01, 0x0a, 0x10, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2f, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x44, 0x12, 0x25, 0x0a, 0x04, + 0x61, 0x74, 0x74, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x74, 0x74, 0x72, 0x52, 0x04, 0x61, + 0x74, 0x74, 0x72, 0x22, 0x3e, 0x0a, 0x15, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, + 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a, 0x04, + 0x61, 0x74, 0x74, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x74, 0x74, 0x72, 0x52, 0x04, 0x61, + 0x74, 0x74, 0x72, 0x22, 0x3b, 0x0a, 0x0d, 0x48, 0x61, 0x72, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x04, 0x74, 0x65, 0x72, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x22, 0x3d, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x65, 0x73, + 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0d, 0x62, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, + 0xf3, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, + 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2d, 0x0a, 0x08, 0x6d, 0x62, 0x72, 0x41, + 0x74, 0x74, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x74, 0x74, 0x72, 0x52, 0x08, 0x6d, + 0x62, 0x72, 0x41, 0x74, 0x74, 0x72, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x65, 0x73, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x65, + 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x12, 0x3a, 0x0a, 0x0d, 0x68, 0x61, 0x72, + 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x48, 0x61, 0x72, 0x64, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x68, 0x61, 0x72, 0x64, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x81, 0x01, 0x0a, 0x12, 0x43, 0x6f, 0x6e, 0x66, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2c, 0x0a, 0x05, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x72, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x45, 0x72, 0x72, 0x12, 0x2b, 0x0a, 0x07, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x74, 0x74, 0x72, + 0x52, 0x07, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x59, 0x0a, 0x10, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x2a, 0x39, 0x0a, 0x14, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, + 0x69, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, + 0x41, 0x44, 0x44, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, + 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x01, 0x2a, + 0x6d, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x4e, 0x46, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, + 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4e, 0x46, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, + 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x41, 0x56, 0x45, 0x44, 0x10, 0x01, 0x12, + 0x1d, 0x0a, 0x19, 0x43, 0x4f, 0x4e, 0x46, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x45, 0x5f, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x10, 0x02, 0x42, 0x08, + 0x5a, 0x06, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_aergo_raft_proto_rawDescOnce sync.Once + file_aergo_raft_proto_rawDescData = file_aergo_raft_proto_rawDesc +) + +func file_aergo_raft_proto_rawDescGZIP() []byte { + file_aergo_raft_proto_rawDescOnce.Do(func() { + file_aergo_raft_proto_rawDescData = protoimpl.X.CompressGZIP(file_aergo_raft_proto_rawDescData) + }) + return file_aergo_raft_proto_rawDescData +} + +var file_aergo_raft_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_aergo_raft_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_aergo_raft_proto_goTypes = []interface{}{ + (MembershipChangeType)(0), // 0: types.MembershipChangeType + (ConfChangeState)(0), // 1: types.ConfChangeState + (*MemberAttr)(nil), // 2: types.MemberAttr + (*MembershipChange)(nil), // 3: types.MembershipChange + (*MembershipChangeReply)(nil), // 4: types.MembershipChangeReply + (*HardStateInfo)(nil), // 5: types.HardStateInfo + (*GetClusterInfoRequest)(nil), // 6: types.GetClusterInfoRequest + (*GetClusterInfoResponse)(nil), // 7: types.GetClusterInfoResponse + (*ConfChangeProgress)(nil), // 8: types.ConfChangeProgress + (*SnapshotResponse)(nil), // 9: types.SnapshotResponse + (ResultStatus)(0), // 10: types.ResultStatus +} +var file_aergo_raft_proto_depIdxs = []int32{ + 0, // 0: types.MembershipChange.type:type_name -> types.MembershipChangeType + 2, // 1: types.MembershipChange.attr:type_name -> types.MemberAttr + 2, // 2: types.MembershipChangeReply.attr:type_name -> types.MemberAttr + 2, // 3: types.GetClusterInfoResponse.mbrAttrs:type_name -> types.MemberAttr + 5, // 4: types.GetClusterInfoResponse.hardStateInfo:type_name -> types.HardStateInfo + 1, // 5: types.ConfChangeProgress.State:type_name -> types.ConfChangeState + 2, // 6: types.ConfChangeProgress.Members:type_name -> types.MemberAttr + 10, // 7: types.SnapshotResponse.status:type_name -> types.ResultStatus + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_aergo_raft_proto_init() } +func file_aergo_raft_proto_init() { + if File_aergo_raft_proto != nil { + return + } + file_p2p_proto_init() + if !protoimpl.UnsafeEnabled { + file_aergo_raft_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MemberAttr); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aergo_raft_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MembershipChange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aergo_raft_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MembershipChangeReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aergo_raft_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HardStateInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aergo_raft_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetClusterInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aergo_raft_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetClusterInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aergo_raft_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfChangeProgress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_aergo_raft_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SnapshotResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_aergo_raft_proto_rawDesc, + NumEnums: 2, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_aergo_raft_proto_goTypes, + DependencyIndexes: file_aergo_raft_proto_depIdxs, + EnumInfos: file_aergo_raft_proto_enumTypes, + MessageInfos: file_aergo_raft_proto_msgTypes, + }.Build() + File_aergo_raft_proto = out.File + file_aergo_raft_proto_rawDesc = nil + file_aergo_raft_proto_goTypes = nil + file_aergo_raft_proto_depIdxs = nil +} diff --git a/types/blockchain.go b/types/blockchain.go index 48330ba0a..3de9e1bf3 100644 --- a/types/blockchain.go +++ b/types/blockchain.go @@ -121,9 +121,9 @@ const ( ) /* -func (s SystemValue) String() string { - return [...]string{"StakingTotal", "StakingMin", "GasPrice", "NamePrice"}[s] -} + func (s SystemValue) String() string { + return [...]string{"StakingTotal", "StakingMin", "GasPrice", "NamePrice"}[s] + } */ // ChainAccessor is an interface for a another actor module to get info of chain @@ -257,33 +257,26 @@ func (block *Block) Localtime() time.Time { // calculateBlockHash computes sha256 hash of block header. func (block *Block) calculateBlockHash() []byte { digest := sha256.New() - serializeBH(digest, block.Header) - + writeBlockHeader(digest, block.Header) return digest.Sum(nil) } -func serializeStructOmit(w io.Writer, s interface{}, stopIndex int, omit string) error { - v := reflect.Indirect(reflect.ValueOf(s)) - - var i int - for i = 0; i <= stopIndex; i++ { - if v.Type().Field(i).Name == omit { - continue - } - if err := binary.Write(w, binary.LittleEndian, v.Field(i).Interface()); err != nil { - return err - } - } - - return nil -} - -func serializeStruct(w io.Writer, s interface{}, stopIndex int) error { - v := reflect.Indirect(reflect.ValueOf(s)) - - var i int - for i = 0; i <= stopIndex; i++ { - if err := binary.Write(w, binary.LittleEndian, v.Field(i).Interface()); err != nil { +func writeBlockHeader(w io.Writer, bh *BlockHeader) error { + for _, f := range []interface{}{ + bh.ChainID, + bh.PrevBlockHash, + bh.BlockNo, + bh.Timestamp, + bh.BlocksRootHash, + bh.TxsRootHash, + bh.ReceiptsRootHash, + bh.Confirms, + bh.PubKey, + bh.CoinbaseAccount, + bh.Sign, + bh.Consensus, + } { + if err := binary.Write(w, binary.LittleEndian, f); err != nil { return err } } @@ -291,16 +284,9 @@ func serializeStruct(w io.Writer, s interface{}, stopIndex int) error { return nil } -func serializeBH(w io.Writer, bh *BlockHeader) error { - return serializeStruct(w, bh, lastIndexOfBH) -} - -func serializeBhForDigest(w io.Writer, bh *BlockHeader) error { - return serializeStructOmit(w, bh, lastIndexOfBH, "Sign") -} - -func writeBlockHeaderOld(w io.Writer, bh *BlockHeader) error { +func writeBlockHeaderOmitSign(w io.Writer, bh *BlockHeader) error { for _, f := range []interface{}{ + bh.ChainID, bh.PrevBlockHash, bh.BlockNo, bh.Timestamp, @@ -309,7 +295,8 @@ func writeBlockHeaderOld(w io.Writer, bh *BlockHeader) error { bh.ReceiptsRootHash, bh.Confirms, bh.PubKey, - bh.Sign, + bh.CoinbaseAccount, + // bh.Sign, // omit ignore sign value bh.Consensus, } { if err := binary.Write(w, binary.LittleEndian, f); err != nil { @@ -418,7 +405,7 @@ func (block *Block) Sign(privKey crypto.PrivKey) error { func (bh *BlockHeader) bytesForDigest() ([]byte, error) { var buf bytes.Buffer - if err := serializeBhForDigest(&buf, bh); err != nil { + if err := writeBlockHeaderOmitSign(&buf, bh); err != nil { return nil, err } diff --git a/types/blockchain.pb.go b/types/blockchain.pb.go index 425c3703e..c41e59e91 100644 --- a/types/blockchain.pb.go +++ b/types/blockchain.pb.go @@ -1,22 +1,24 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.15.8 // source: blockchain.proto package types -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type TxType int32 @@ -30,1678 +32,2362 @@ const ( TxType_DEPLOY TxType = 6 ) -var TxType_name = map[int32]string{ - 0: "NORMAL", - 1: "GOVERNANCE", - 2: "REDEPLOY", - 3: "FEEDELEGATION", - 4: "TRANSFER", - 5: "CALL", - 6: "DEPLOY", -} -var TxType_value = map[string]int32{ - "NORMAL": 0, - "GOVERNANCE": 1, - "REDEPLOY": 2, - "FEEDELEGATION": 3, - "TRANSFER": 4, - "CALL": 5, - "DEPLOY": 6, +// Enum value maps for TxType. +var ( + TxType_name = map[int32]string{ + 0: "NORMAL", + 1: "GOVERNANCE", + 2: "REDEPLOY", + 3: "FEEDELEGATION", + 4: "TRANSFER", + 5: "CALL", + 6: "DEPLOY", + } + TxType_value = map[string]int32{ + "NORMAL": 0, + "GOVERNANCE": 1, + "REDEPLOY": 2, + "FEEDELEGATION": 3, + "TRANSFER": 4, + "CALL": 5, + "DEPLOY": 6, + } +) + +func (x TxType) Enum() *TxType { + p := new(TxType) + *p = x + return p } func (x TxType) String() string { - return proto.EnumName(TxType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (TxType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{0} + +func (TxType) Descriptor() protoreflect.EnumDescriptor { + return file_blockchain_proto_enumTypes[0].Descriptor() } -type Block struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Header *BlockHeader `protobuf:"bytes,2,opt,name=header" json:"header,omitempty"` - Body *BlockBody `protobuf:"bytes,3,opt,name=body" json:"body,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (TxType) Type() protoreflect.EnumType { + return &file_blockchain_proto_enumTypes[0] } -func (m *Block) Reset() { *m = Block{} } -func (m *Block) String() string { return proto.CompactTextString(m) } -func (*Block) ProtoMessage() {} -func (*Block) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{0} +func (x TxType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *Block) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Block.Unmarshal(m, b) + +// Deprecated: Use TxType.Descriptor instead. +func (TxType) EnumDescriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{0} } -func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Block.Marshal(b, m, deterministic) + +type Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Header *BlockHeader `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"` + Body *BlockBody `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` } -func (dst *Block) XXX_Merge(src proto.Message) { - xxx_messageInfo_Block.Merge(dst, src) + +func (x *Block) Reset() { + *x = Block{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Block) XXX_Size() int { - return xxx_messageInfo_Block.Size(m) + +func (x *Block) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Block) XXX_DiscardUnknown() { - xxx_messageInfo_Block.DiscardUnknown(m) + +func (*Block) ProtoMessage() {} + +func (x *Block) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Block proto.InternalMessageInfo +// Deprecated: Use Block.ProtoReflect.Descriptor instead. +func (*Block) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{0} +} -func (m *Block) GetHash() []byte { - if m != nil { - return m.Hash +func (x *Block) GetHash() []byte { + if x != nil { + return x.Hash } return nil } -func (m *Block) GetHeader() *BlockHeader { - if m != nil { - return m.Header +func (x *Block) GetHeader() *BlockHeader { + if x != nil { + return x.Header } return nil } -func (m *Block) GetBody() *BlockBody { - if m != nil { - return m.Body +func (x *Block) GetBody() *BlockBody { + if x != nil { + return x.Body } return nil } type BlockHeader struct { - ChainID []byte `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` - PrevBlockHash []byte `protobuf:"bytes,2,opt,name=prevBlockHash,proto3" json:"prevBlockHash,omitempty"` - BlockNo uint64 `protobuf:"varint,3,opt,name=blockNo" json:"blockNo,omitempty"` - Timestamp int64 `protobuf:"varint,4,opt,name=timestamp" json:"timestamp,omitempty"` - BlocksRootHash []byte `protobuf:"bytes,5,opt,name=blocksRootHash,proto3" json:"blocksRootHash,omitempty"` - TxsRootHash []byte `protobuf:"bytes,6,opt,name=txsRootHash,proto3" json:"txsRootHash,omitempty"` - ReceiptsRootHash []byte `protobuf:"bytes,7,opt,name=receiptsRootHash,proto3" json:"receiptsRootHash,omitempty"` - Confirms uint64 `protobuf:"varint,8,opt,name=confirms" json:"confirms,omitempty"` - PubKey []byte `protobuf:"bytes,9,opt,name=pubKey,proto3" json:"pubKey,omitempty"` - CoinbaseAccount []byte `protobuf:"bytes,10,opt,name=coinbaseAccount,proto3" json:"coinbaseAccount,omitempty"` - Sign []byte `protobuf:"bytes,11,opt,name=sign,proto3" json:"sign,omitempty"` - Consensus []byte `protobuf:"bytes,12,opt,name=consensus,proto3" json:"consensus,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockHeader) Reset() { *m = BlockHeader{} } -func (m *BlockHeader) String() string { return proto.CompactTextString(m) } -func (*BlockHeader) ProtoMessage() {} -func (*BlockHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{1} -} -func (m *BlockHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockHeader.Unmarshal(m, b) -} -func (m *BlockHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockHeader.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChainID []byte `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` // chain identifier + PrevBlockHash []byte `protobuf:"bytes,2,opt,name=prevBlockHash,proto3" json:"prevBlockHash,omitempty"` // hash of previous block + BlockNo uint64 `protobuf:"varint,3,opt,name=blockNo,proto3" json:"blockNo,omitempty"` // block number + Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // block creation time stamp + BlocksRootHash []byte `protobuf:"bytes,5,opt,name=blocksRootHash,proto3" json:"blocksRootHash,omitempty"` // hash of root of block merkle tree + TxsRootHash []byte `protobuf:"bytes,6,opt,name=txsRootHash,proto3" json:"txsRootHash,omitempty"` // hash of root of transaction merkle tree + ReceiptsRootHash []byte `protobuf:"bytes,7,opt,name=receiptsRootHash,proto3" json:"receiptsRootHash,omitempty"` // hash of root of receipt merkle tree + Confirms uint64 `protobuf:"varint,8,opt,name=confirms,proto3" json:"confirms,omitempty"` // number of blocks this block is able to confirm + PubKey []byte `protobuf:"bytes,9,opt,name=pubKey,proto3" json:"pubKey,omitempty"` // block producer's public key + CoinbaseAccount []byte `protobuf:"bytes,10,opt,name=coinbaseAccount,proto3" json:"coinbaseAccount,omitempty"` // address of account to receive fees + Sign []byte `protobuf:"bytes,11,opt,name=sign,proto3" json:"sign,omitempty"` // block producer's signature of BlockHeader + Consensus []byte `protobuf:"bytes,12,opt,name=consensus,proto3" json:"consensus,omitempty"` // consensus meta } -func (dst *BlockHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockHeader.Merge(dst, src) + +func (x *BlockHeader) Reset() { + *x = BlockHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BlockHeader) XXX_Size() int { - return xxx_messageInfo_BlockHeader.Size(m) + +func (x *BlockHeader) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BlockHeader) XXX_DiscardUnknown() { - xxx_messageInfo_BlockHeader.DiscardUnknown(m) + +func (*BlockHeader) ProtoMessage() {} + +func (x *BlockHeader) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BlockHeader proto.InternalMessageInfo +// Deprecated: Use BlockHeader.ProtoReflect.Descriptor instead. +func (*BlockHeader) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{1} +} -func (m *BlockHeader) GetChainID() []byte { - if m != nil { - return m.ChainID +func (x *BlockHeader) GetChainID() []byte { + if x != nil { + return x.ChainID } return nil } -func (m *BlockHeader) GetPrevBlockHash() []byte { - if m != nil { - return m.PrevBlockHash +func (x *BlockHeader) GetPrevBlockHash() []byte { + if x != nil { + return x.PrevBlockHash } return nil } -func (m *BlockHeader) GetBlockNo() uint64 { - if m != nil { - return m.BlockNo +func (x *BlockHeader) GetBlockNo() uint64 { + if x != nil { + return x.BlockNo } return 0 } -func (m *BlockHeader) GetTimestamp() int64 { - if m != nil { - return m.Timestamp +func (x *BlockHeader) GetTimestamp() int64 { + if x != nil { + return x.Timestamp } return 0 } -func (m *BlockHeader) GetBlocksRootHash() []byte { - if m != nil { - return m.BlocksRootHash +func (x *BlockHeader) GetBlocksRootHash() []byte { + if x != nil { + return x.BlocksRootHash } return nil } -func (m *BlockHeader) GetTxsRootHash() []byte { - if m != nil { - return m.TxsRootHash +func (x *BlockHeader) GetTxsRootHash() []byte { + if x != nil { + return x.TxsRootHash } return nil } -func (m *BlockHeader) GetReceiptsRootHash() []byte { - if m != nil { - return m.ReceiptsRootHash +func (x *BlockHeader) GetReceiptsRootHash() []byte { + if x != nil { + return x.ReceiptsRootHash } return nil } -func (m *BlockHeader) GetConfirms() uint64 { - if m != nil { - return m.Confirms +func (x *BlockHeader) GetConfirms() uint64 { + if x != nil { + return x.Confirms } return 0 } -func (m *BlockHeader) GetPubKey() []byte { - if m != nil { - return m.PubKey +func (x *BlockHeader) GetPubKey() []byte { + if x != nil { + return x.PubKey } return nil } -func (m *BlockHeader) GetCoinbaseAccount() []byte { - if m != nil { - return m.CoinbaseAccount +func (x *BlockHeader) GetCoinbaseAccount() []byte { + if x != nil { + return x.CoinbaseAccount } return nil } -func (m *BlockHeader) GetSign() []byte { - if m != nil { - return m.Sign +func (x *BlockHeader) GetSign() []byte { + if x != nil { + return x.Sign } return nil } -func (m *BlockHeader) GetConsensus() []byte { - if m != nil { - return m.Consensus +func (x *BlockHeader) GetConsensus() []byte { + if x != nil { + return x.Consensus } return nil } type BlockBody struct { - Txs []*Tx `protobuf:"bytes,1,rep,name=txs" json:"txs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *BlockBody) Reset() { *m = BlockBody{} } -func (m *BlockBody) String() string { return proto.CompactTextString(m) } -func (*BlockBody) ProtoMessage() {} -func (*BlockBody) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{2} -} -func (m *BlockBody) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockBody.Unmarshal(m, b) -} -func (m *BlockBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockBody.Marshal(b, m, deterministic) + Txs []*Tx `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` } -func (dst *BlockBody) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockBody.Merge(dst, src) + +func (x *BlockBody) Reset() { + *x = BlockBody{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BlockBody) XXX_Size() int { - return xxx_messageInfo_BlockBody.Size(m) + +func (x *BlockBody) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BlockBody) XXX_DiscardUnknown() { - xxx_messageInfo_BlockBody.DiscardUnknown(m) + +func (*BlockBody) ProtoMessage() {} + +func (x *BlockBody) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BlockBody proto.InternalMessageInfo +// Deprecated: Use BlockBody.ProtoReflect.Descriptor instead. +func (*BlockBody) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{2} +} -func (m *BlockBody) GetTxs() []*Tx { - if m != nil { - return m.Txs +func (x *BlockBody) GetTxs() []*Tx { + if x != nil { + return x.Txs } return nil } type TxList struct { - Txs []*Tx `protobuf:"bytes,1,rep,name=txs" json:"txs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *TxList) Reset() { *m = TxList{} } -func (m *TxList) String() string { return proto.CompactTextString(m) } -func (*TxList) ProtoMessage() {} -func (*TxList) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{3} -} -func (m *TxList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TxList.Unmarshal(m, b) + Txs []*Tx `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` } -func (m *TxList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TxList.Marshal(b, m, deterministic) -} -func (dst *TxList) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxList.Merge(dst, src) + +func (x *TxList) Reset() { + *x = TxList{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TxList) XXX_Size() int { - return xxx_messageInfo_TxList.Size(m) + +func (x *TxList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TxList) XXX_DiscardUnknown() { - xxx_messageInfo_TxList.DiscardUnknown(m) + +func (*TxList) ProtoMessage() {} + +func (x *TxList) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_TxList proto.InternalMessageInfo +// Deprecated: Use TxList.ProtoReflect.Descriptor instead. +func (*TxList) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{3} +} -func (m *TxList) GetTxs() []*Tx { - if m != nil { - return m.Txs +func (x *TxList) GetTxs() []*Tx { + if x != nil { + return x.Txs } return nil } type Tx struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Body *TxBody `protobuf:"bytes,2,opt,name=body" json:"body,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Tx) Reset() { *m = Tx{} } -func (m *Tx) String() string { return proto.CompactTextString(m) } -func (*Tx) ProtoMessage() {} -func (*Tx) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{4} + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Body *TxBody `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` } -func (m *Tx) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Tx.Unmarshal(m, b) -} -func (m *Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Tx.Marshal(b, m, deterministic) -} -func (dst *Tx) XXX_Merge(src proto.Message) { - xxx_messageInfo_Tx.Merge(dst, src) + +func (x *Tx) Reset() { + *x = Tx{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Tx) XXX_Size() int { - return xxx_messageInfo_Tx.Size(m) + +func (x *Tx) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Tx) XXX_DiscardUnknown() { - xxx_messageInfo_Tx.DiscardUnknown(m) + +func (*Tx) ProtoMessage() {} + +func (x *Tx) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Tx proto.InternalMessageInfo +// Deprecated: Use Tx.ProtoReflect.Descriptor instead. +func (*Tx) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{4} +} -func (m *Tx) GetHash() []byte { - if m != nil { - return m.Hash +func (x *Tx) GetHash() []byte { + if x != nil { + return x.Hash } return nil } -func (m *Tx) GetBody() *TxBody { - if m != nil { - return m.Body +func (x *Tx) GetBody() *TxBody { + if x != nil { + return x.Body } return nil } type TxBody struct { - Nonce uint64 `protobuf:"varint,1,opt,name=nonce" json:"nonce,omitempty"` - Account []byte `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` - Recipient []byte `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` - Amount []byte `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` - Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` - GasLimit uint64 `protobuf:"varint,6,opt,name=gasLimit" json:"gasLimit,omitempty"` - GasPrice []byte `protobuf:"bytes,7,opt,name=gasPrice,proto3" json:"gasPrice,omitempty"` - Type TxType `protobuf:"varint,8,opt,name=type,enum=types.TxType" json:"type,omitempty"` - ChainIdHash []byte `protobuf:"bytes,9,opt,name=chainIdHash,proto3" json:"chainIdHash,omitempty"` - Sign []byte `protobuf:"bytes,10,opt,name=sign,proto3" json:"sign,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TxBody) Reset() { *m = TxBody{} } -func (m *TxBody) String() string { return proto.CompactTextString(m) } -func (*TxBody) ProtoMessage() {} -func (*TxBody) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{5} -} -func (m *TxBody) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TxBody.Unmarshal(m, b) -} -func (m *TxBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TxBody.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` // increasing number used only once per sender account + Account []byte `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` // decoded account address + Recipient []byte `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` // decoded account address + Amount []byte `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` // variable-length big integer + Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` + GasLimit uint64 `protobuf:"varint,6,opt,name=gasLimit,proto3" json:"gasLimit,omitempty"` // maximum gas used for this transaction. 0 = no limit + GasPrice []byte `protobuf:"bytes,7,opt,name=gasPrice,proto3" json:"gasPrice,omitempty"` // variable-length big integer. currently not used + Type TxType `protobuf:"varint,8,opt,name=type,proto3,enum=types.TxType" json:"type,omitempty"` + ChainIdHash []byte `protobuf:"bytes,9,opt,name=chainIdHash,proto3" json:"chainIdHash,omitempty"` // hash value of chain identifier in the block + Sign []byte `protobuf:"bytes,10,opt,name=sign,proto3" json:"sign,omitempty"` // sender's signature for this TxBody } -func (dst *TxBody) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxBody.Merge(dst, src) + +func (x *TxBody) Reset() { + *x = TxBody{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TxBody) XXX_Size() int { - return xxx_messageInfo_TxBody.Size(m) + +func (x *TxBody) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TxBody) XXX_DiscardUnknown() { - xxx_messageInfo_TxBody.DiscardUnknown(m) + +func (*TxBody) ProtoMessage() {} + +func (x *TxBody) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_TxBody proto.InternalMessageInfo +// Deprecated: Use TxBody.ProtoReflect.Descriptor instead. +func (*TxBody) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{5} +} -func (m *TxBody) GetNonce() uint64 { - if m != nil { - return m.Nonce +func (x *TxBody) GetNonce() uint64 { + if x != nil { + return x.Nonce } return 0 } -func (m *TxBody) GetAccount() []byte { - if m != nil { - return m.Account +func (x *TxBody) GetAccount() []byte { + if x != nil { + return x.Account } return nil } -func (m *TxBody) GetRecipient() []byte { - if m != nil { - return m.Recipient +func (x *TxBody) GetRecipient() []byte { + if x != nil { + return x.Recipient } return nil } -func (m *TxBody) GetAmount() []byte { - if m != nil { - return m.Amount +func (x *TxBody) GetAmount() []byte { + if x != nil { + return x.Amount } return nil } -func (m *TxBody) GetPayload() []byte { - if m != nil { - return m.Payload +func (x *TxBody) GetPayload() []byte { + if x != nil { + return x.Payload } return nil } -func (m *TxBody) GetGasLimit() uint64 { - if m != nil { - return m.GasLimit +func (x *TxBody) GetGasLimit() uint64 { + if x != nil { + return x.GasLimit } return 0 } -func (m *TxBody) GetGasPrice() []byte { - if m != nil { - return m.GasPrice +func (x *TxBody) GetGasPrice() []byte { + if x != nil { + return x.GasPrice } return nil } -func (m *TxBody) GetType() TxType { - if m != nil { - return m.Type +func (x *TxBody) GetType() TxType { + if x != nil { + return x.Type } return TxType_NORMAL } -func (m *TxBody) GetChainIdHash() []byte { - if m != nil { - return m.ChainIdHash +func (x *TxBody) GetChainIdHash() []byte { + if x != nil { + return x.ChainIdHash } return nil } -func (m *TxBody) GetSign() []byte { - if m != nil { - return m.Sign +func (x *TxBody) GetSign() []byte { + if x != nil { + return x.Sign } return nil } // TxIdx specifies a transaction's block hash and index within the block body type TxIdx struct { - BlockHash []byte `protobuf:"bytes,1,opt,name=blockHash,proto3" json:"blockHash,omitempty"` - Idx int32 `protobuf:"varint,2,opt,name=idx" json:"idx,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *TxIdx) Reset() { *m = TxIdx{} } -func (m *TxIdx) String() string { return proto.CompactTextString(m) } -func (*TxIdx) ProtoMessage() {} -func (*TxIdx) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{6} -} -func (m *TxIdx) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TxIdx.Unmarshal(m, b) -} -func (m *TxIdx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TxIdx.Marshal(b, m, deterministic) + BlockHash []byte `protobuf:"bytes,1,opt,name=blockHash,proto3" json:"blockHash,omitempty"` + Idx int32 `protobuf:"varint,2,opt,name=idx,proto3" json:"idx,omitempty"` } -func (dst *TxIdx) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxIdx.Merge(dst, src) + +func (x *TxIdx) Reset() { + *x = TxIdx{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TxIdx) XXX_Size() int { - return xxx_messageInfo_TxIdx.Size(m) + +func (x *TxIdx) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TxIdx) XXX_DiscardUnknown() { - xxx_messageInfo_TxIdx.DiscardUnknown(m) + +func (*TxIdx) ProtoMessage() {} + +func (x *TxIdx) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_TxIdx proto.InternalMessageInfo +// Deprecated: Use TxIdx.ProtoReflect.Descriptor instead. +func (*TxIdx) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{6} +} -func (m *TxIdx) GetBlockHash() []byte { - if m != nil { - return m.BlockHash +func (x *TxIdx) GetBlockHash() []byte { + if x != nil { + return x.BlockHash } return nil } -func (m *TxIdx) GetIdx() int32 { - if m != nil { - return m.Idx +func (x *TxIdx) GetIdx() int32 { + if x != nil { + return x.Idx } return 0 } type TxInBlock struct { - TxIdx *TxIdx `protobuf:"bytes,1,opt,name=txIdx" json:"txIdx,omitempty"` - Tx *Tx `protobuf:"bytes,2,opt,name=tx" json:"tx,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *TxInBlock) Reset() { *m = TxInBlock{} } -func (m *TxInBlock) String() string { return proto.CompactTextString(m) } -func (*TxInBlock) ProtoMessage() {} -func (*TxInBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{7} -} -func (m *TxInBlock) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TxInBlock.Unmarshal(m, b) + TxIdx *TxIdx `protobuf:"bytes,1,opt,name=txIdx,proto3" json:"txIdx,omitempty"` + Tx *Tx `protobuf:"bytes,2,opt,name=tx,proto3" json:"tx,omitempty"` } -func (m *TxInBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TxInBlock.Marshal(b, m, deterministic) -} -func (dst *TxInBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxInBlock.Merge(dst, src) + +func (x *TxInBlock) Reset() { + *x = TxInBlock{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TxInBlock) XXX_Size() int { - return xxx_messageInfo_TxInBlock.Size(m) + +func (x *TxInBlock) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TxInBlock) XXX_DiscardUnknown() { - xxx_messageInfo_TxInBlock.DiscardUnknown(m) + +func (*TxInBlock) ProtoMessage() {} + +func (x *TxInBlock) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_TxInBlock proto.InternalMessageInfo +// Deprecated: Use TxInBlock.ProtoReflect.Descriptor instead. +func (*TxInBlock) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{7} +} -func (m *TxInBlock) GetTxIdx() *TxIdx { - if m != nil { - return m.TxIdx +func (x *TxInBlock) GetTxIdx() *TxIdx { + if x != nil { + return x.TxIdx } return nil } -func (m *TxInBlock) GetTx() *Tx { - if m != nil { - return m.Tx +func (x *TxInBlock) GetTx() *Tx { + if x != nil { + return x.Tx } return nil } type State struct { - Nonce uint64 `protobuf:"varint,1,opt,name=nonce" json:"nonce,omitempty"` - Balance []byte `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance,omitempty"` - CodeHash []byte `protobuf:"bytes,3,opt,name=codeHash,proto3" json:"codeHash,omitempty"` - StorageRoot []byte `protobuf:"bytes,4,opt,name=storageRoot,proto3" json:"storageRoot,omitempty"` - SqlRecoveryPoint uint64 `protobuf:"varint,5,opt,name=sqlRecoveryPoint" json:"sqlRecoveryPoint,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *State) Reset() { *m = State{} } -func (m *State) String() string { return proto.CompactTextString(m) } -func (*State) ProtoMessage() {} -func (*State) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{8} -} -func (m *State) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_State.Unmarshal(m, b) -} -func (m *State) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_State.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` + Balance []byte `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance,omitempty"` + CodeHash []byte `protobuf:"bytes,3,opt,name=codeHash,proto3" json:"codeHash,omitempty"` + StorageRoot []byte `protobuf:"bytes,4,opt,name=storageRoot,proto3" json:"storageRoot,omitempty"` + SqlRecoveryPoint uint64 `protobuf:"varint,5,opt,name=sqlRecoveryPoint,proto3" json:"sqlRecoveryPoint,omitempty"` } -func (dst *State) XXX_Merge(src proto.Message) { - xxx_messageInfo_State.Merge(dst, src) + +func (x *State) Reset() { + *x = State{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *State) XXX_Size() int { - return xxx_messageInfo_State.Size(m) + +func (x *State) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *State) XXX_DiscardUnknown() { - xxx_messageInfo_State.DiscardUnknown(m) + +func (*State) ProtoMessage() {} + +func (x *State) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_State proto.InternalMessageInfo +// Deprecated: Use State.ProtoReflect.Descriptor instead. +func (*State) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{8} +} -func (m *State) GetNonce() uint64 { - if m != nil { - return m.Nonce +func (x *State) GetNonce() uint64 { + if x != nil { + return x.Nonce } return 0 } -func (m *State) GetBalance() []byte { - if m != nil { - return m.Balance +func (x *State) GetBalance() []byte { + if x != nil { + return x.Balance } return nil } -func (m *State) GetCodeHash() []byte { - if m != nil { - return m.CodeHash +func (x *State) GetCodeHash() []byte { + if x != nil { + return x.CodeHash } return nil } -func (m *State) GetStorageRoot() []byte { - if m != nil { - return m.StorageRoot +func (x *State) GetStorageRoot() []byte { + if x != nil { + return x.StorageRoot } return nil } -func (m *State) GetSqlRecoveryPoint() uint64 { - if m != nil { - return m.SqlRecoveryPoint +func (x *State) GetSqlRecoveryPoint() uint64 { + if x != nil { + return x.SqlRecoveryPoint } return 0 } type AccountProof struct { - State *State `protobuf:"bytes,1,opt,name=state" json:"state,omitempty"` - Inclusion bool `protobuf:"varint,2,opt,name=inclusion" json:"inclusion,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - ProofKey []byte `protobuf:"bytes,4,opt,name=proofKey,proto3" json:"proofKey,omitempty"` - ProofVal []byte `protobuf:"bytes,5,opt,name=proofVal,proto3" json:"proofVal,omitempty"` - Bitmap []byte `protobuf:"bytes,6,opt,name=bitmap,proto3" json:"bitmap,omitempty"` - Height uint32 `protobuf:"varint,7,opt,name=height" json:"height,omitempty"` - AuditPath [][]byte `protobuf:"bytes,8,rep,name=auditPath,proto3" json:"auditPath,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AccountProof) Reset() { *m = AccountProof{} } -func (m *AccountProof) String() string { return proto.CompactTextString(m) } -func (*AccountProof) ProtoMessage() {} -func (*AccountProof) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{9} -} -func (m *AccountProof) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AccountProof.Unmarshal(m, b) -} -func (m *AccountProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AccountProof.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State *State `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` + Inclusion bool `protobuf:"varint,2,opt,name=inclusion,proto3" json:"inclusion,omitempty"` + Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + ProofKey []byte `protobuf:"bytes,4,opt,name=proofKey,proto3" json:"proofKey,omitempty"` + ProofVal []byte `protobuf:"bytes,5,opt,name=proofVal,proto3" json:"proofVal,omitempty"` + Bitmap []byte `protobuf:"bytes,6,opt,name=bitmap,proto3" json:"bitmap,omitempty"` + Height uint32 `protobuf:"varint,7,opt,name=height,proto3" json:"height,omitempty"` + AuditPath [][]byte `protobuf:"bytes,8,rep,name=auditPath,proto3" json:"auditPath,omitempty"` } -func (dst *AccountProof) XXX_Merge(src proto.Message) { - xxx_messageInfo_AccountProof.Merge(dst, src) + +func (x *AccountProof) Reset() { + *x = AccountProof{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AccountProof) XXX_Size() int { - return xxx_messageInfo_AccountProof.Size(m) + +func (x *AccountProof) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AccountProof) XXX_DiscardUnknown() { - xxx_messageInfo_AccountProof.DiscardUnknown(m) + +func (*AccountProof) ProtoMessage() {} + +func (x *AccountProof) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AccountProof proto.InternalMessageInfo +// Deprecated: Use AccountProof.ProtoReflect.Descriptor instead. +func (*AccountProof) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{9} +} -func (m *AccountProof) GetState() *State { - if m != nil { - return m.State +func (x *AccountProof) GetState() *State { + if x != nil { + return x.State } return nil } -func (m *AccountProof) GetInclusion() bool { - if m != nil { - return m.Inclusion +func (x *AccountProof) GetInclusion() bool { + if x != nil { + return x.Inclusion } return false } -func (m *AccountProof) GetKey() []byte { - if m != nil { - return m.Key +func (x *AccountProof) GetKey() []byte { + if x != nil { + return x.Key } return nil } -func (m *AccountProof) GetProofKey() []byte { - if m != nil { - return m.ProofKey +func (x *AccountProof) GetProofKey() []byte { + if x != nil { + return x.ProofKey } return nil } -func (m *AccountProof) GetProofVal() []byte { - if m != nil { - return m.ProofVal +func (x *AccountProof) GetProofVal() []byte { + if x != nil { + return x.ProofVal } return nil } -func (m *AccountProof) GetBitmap() []byte { - if m != nil { - return m.Bitmap +func (x *AccountProof) GetBitmap() []byte { + if x != nil { + return x.Bitmap } return nil } -func (m *AccountProof) GetHeight() uint32 { - if m != nil { - return m.Height +func (x *AccountProof) GetHeight() uint32 { + if x != nil { + return x.Height } return 0 } -func (m *AccountProof) GetAuditPath() [][]byte { - if m != nil { - return m.AuditPath +func (x *AccountProof) GetAuditPath() [][]byte { + if x != nil { + return x.AuditPath } return nil } type ContractVarProof struct { - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Inclusion bool `protobuf:"varint,2,opt,name=inclusion" json:"inclusion,omitempty"` - ProofKey []byte `protobuf:"bytes,4,opt,name=proofKey,proto3" json:"proofKey,omitempty"` - ProofVal []byte `protobuf:"bytes,5,opt,name=proofVal,proto3" json:"proofVal,omitempty"` - Bitmap []byte `protobuf:"bytes,6,opt,name=bitmap,proto3" json:"bitmap,omitempty"` - Height uint32 `protobuf:"varint,7,opt,name=height" json:"height,omitempty"` - AuditPath [][]byte `protobuf:"bytes,8,rep,name=auditPath,proto3" json:"auditPath,omitempty"` - Key []byte `protobuf:"bytes,9,opt,name=key,proto3" json:"key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ContractVarProof) Reset() { *m = ContractVarProof{} } -func (m *ContractVarProof) String() string { return proto.CompactTextString(m) } -func (*ContractVarProof) ProtoMessage() {} -func (*ContractVarProof) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{10} -} -func (m *ContractVarProof) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ContractVarProof.Unmarshal(m, b) -} -func (m *ContractVarProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ContractVarProof.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Inclusion bool `protobuf:"varint,2,opt,name=inclusion,proto3" json:"inclusion,omitempty"` + ProofKey []byte `protobuf:"bytes,4,opt,name=proofKey,proto3" json:"proofKey,omitempty"` + ProofVal []byte `protobuf:"bytes,5,opt,name=proofVal,proto3" json:"proofVal,omitempty"` + Bitmap []byte `protobuf:"bytes,6,opt,name=bitmap,proto3" json:"bitmap,omitempty"` + Height uint32 `protobuf:"varint,7,opt,name=height,proto3" json:"height,omitempty"` + AuditPath [][]byte `protobuf:"bytes,8,rep,name=auditPath,proto3" json:"auditPath,omitempty"` + Key []byte `protobuf:"bytes,9,opt,name=key,proto3" json:"key,omitempty"` } -func (dst *ContractVarProof) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContractVarProof.Merge(dst, src) + +func (x *ContractVarProof) Reset() { + *x = ContractVarProof{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ContractVarProof) XXX_Size() int { - return xxx_messageInfo_ContractVarProof.Size(m) + +func (x *ContractVarProof) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ContractVarProof) XXX_DiscardUnknown() { - xxx_messageInfo_ContractVarProof.DiscardUnknown(m) + +func (*ContractVarProof) ProtoMessage() {} + +func (x *ContractVarProof) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ContractVarProof proto.InternalMessageInfo +// Deprecated: Use ContractVarProof.ProtoReflect.Descriptor instead. +func (*ContractVarProof) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{10} +} -func (m *ContractVarProof) GetValue() []byte { - if m != nil { - return m.Value +func (x *ContractVarProof) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *ContractVarProof) GetInclusion() bool { - if m != nil { - return m.Inclusion +func (x *ContractVarProof) GetInclusion() bool { + if x != nil { + return x.Inclusion } return false } -func (m *ContractVarProof) GetProofKey() []byte { - if m != nil { - return m.ProofKey +func (x *ContractVarProof) GetProofKey() []byte { + if x != nil { + return x.ProofKey } return nil } -func (m *ContractVarProof) GetProofVal() []byte { - if m != nil { - return m.ProofVal +func (x *ContractVarProof) GetProofVal() []byte { + if x != nil { + return x.ProofVal } return nil } -func (m *ContractVarProof) GetBitmap() []byte { - if m != nil { - return m.Bitmap +func (x *ContractVarProof) GetBitmap() []byte { + if x != nil { + return x.Bitmap } return nil } -func (m *ContractVarProof) GetHeight() uint32 { - if m != nil { - return m.Height +func (x *ContractVarProof) GetHeight() uint32 { + if x != nil { + return x.Height } return 0 } -func (m *ContractVarProof) GetAuditPath() [][]byte { - if m != nil { - return m.AuditPath +func (x *ContractVarProof) GetAuditPath() [][]byte { + if x != nil { + return x.AuditPath } return nil } -func (m *ContractVarProof) GetKey() []byte { - if m != nil { - return m.Key +func (x *ContractVarProof) GetKey() []byte { + if x != nil { + return x.Key } return nil } type StateQueryProof struct { - ContractProof *AccountProof `protobuf:"bytes,1,opt,name=contractProof" json:"contractProof,omitempty"` - VarProofs []*ContractVarProof `protobuf:"bytes,2,rep,name=varProofs" json:"varProofs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *StateQueryProof) Reset() { *m = StateQueryProof{} } -func (m *StateQueryProof) String() string { return proto.CompactTextString(m) } -func (*StateQueryProof) ProtoMessage() {} -func (*StateQueryProof) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{11} -} -func (m *StateQueryProof) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StateQueryProof.Unmarshal(m, b) -} -func (m *StateQueryProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StateQueryProof.Marshal(b, m, deterministic) + ContractProof *AccountProof `protobuf:"bytes,1,opt,name=contractProof,proto3" json:"contractProof,omitempty"` + VarProofs []*ContractVarProof `protobuf:"bytes,2,rep,name=varProofs,proto3" json:"varProofs,omitempty"` } -func (dst *StateQueryProof) XXX_Merge(src proto.Message) { - xxx_messageInfo_StateQueryProof.Merge(dst, src) + +func (x *StateQueryProof) Reset() { + *x = StateQueryProof{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *StateQueryProof) XXX_Size() int { - return xxx_messageInfo_StateQueryProof.Size(m) + +func (x *StateQueryProof) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *StateQueryProof) XXX_DiscardUnknown() { - xxx_messageInfo_StateQueryProof.DiscardUnknown(m) + +func (*StateQueryProof) ProtoMessage() {} + +func (x *StateQueryProof) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_StateQueryProof proto.InternalMessageInfo +// Deprecated: Use StateQueryProof.ProtoReflect.Descriptor instead. +func (*StateQueryProof) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{11} +} -func (m *StateQueryProof) GetContractProof() *AccountProof { - if m != nil { - return m.ContractProof +func (x *StateQueryProof) GetContractProof() *AccountProof { + if x != nil { + return x.ContractProof } return nil } -func (m *StateQueryProof) GetVarProofs() []*ContractVarProof { - if m != nil { - return m.VarProofs +func (x *StateQueryProof) GetVarProofs() []*ContractVarProof { + if x != nil { + return x.VarProofs } return nil } type Receipt struct { - ContractAddress []byte `protobuf:"bytes,1,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"` - Status string `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` - Ret string `protobuf:"bytes,3,opt,name=ret" json:"ret,omitempty"` - TxHash []byte `protobuf:"bytes,4,opt,name=txHash,proto3" json:"txHash,omitempty"` - FeeUsed []byte `protobuf:"bytes,5,opt,name=feeUsed,proto3" json:"feeUsed,omitempty"` - CumulativeFeeUsed []byte `protobuf:"bytes,6,opt,name=cumulativeFeeUsed,proto3" json:"cumulativeFeeUsed,omitempty"` - Bloom []byte `protobuf:"bytes,7,opt,name=bloom,proto3" json:"bloom,omitempty"` - Events []*Event `protobuf:"bytes,8,rep,name=events" json:"events,omitempty"` - BlockNo uint64 `protobuf:"varint,9,opt,name=blockNo" json:"blockNo,omitempty"` - BlockHash []byte `protobuf:"bytes,10,opt,name=blockHash,proto3" json:"blockHash,omitempty"` - TxIndex int32 `protobuf:"varint,11,opt,name=txIndex" json:"txIndex,omitempty"` - From []byte `protobuf:"bytes,12,opt,name=from,proto3" json:"from,omitempty"` - To []byte `protobuf:"bytes,13,opt,name=to,proto3" json:"to,omitempty"` - FeeDelegation bool `protobuf:"varint,14,opt,name=feeDelegation" json:"feeDelegation,omitempty"` - GasUsed uint64 `protobuf:"varint,15,opt,name=gasUsed" json:"gasUsed,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Receipt) Reset() { *m = Receipt{} } -func (m *Receipt) String() string { return proto.CompactTextString(m) } -func (*Receipt) ProtoMessage() {} -func (*Receipt) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{12} -} -func (m *Receipt) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Receipt.Unmarshal(m, b) -} -func (m *Receipt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Receipt.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContractAddress []byte `protobuf:"bytes,1,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + Ret string `protobuf:"bytes,3,opt,name=ret,proto3" json:"ret,omitempty"` + TxHash []byte `protobuf:"bytes,4,opt,name=txHash,proto3" json:"txHash,omitempty"` + FeeUsed []byte `protobuf:"bytes,5,opt,name=feeUsed,proto3" json:"feeUsed,omitempty"` + CumulativeFeeUsed []byte `protobuf:"bytes,6,opt,name=cumulativeFeeUsed,proto3" json:"cumulativeFeeUsed,omitempty"` + Bloom []byte `protobuf:"bytes,7,opt,name=bloom,proto3" json:"bloom,omitempty"` + Events []*Event `protobuf:"bytes,8,rep,name=events,proto3" json:"events,omitempty"` + BlockNo uint64 `protobuf:"varint,9,opt,name=blockNo,proto3" json:"blockNo,omitempty"` + BlockHash []byte `protobuf:"bytes,10,opt,name=blockHash,proto3" json:"blockHash,omitempty"` + TxIndex int32 `protobuf:"varint,11,opt,name=txIndex,proto3" json:"txIndex,omitempty"` + From []byte `protobuf:"bytes,12,opt,name=from,proto3" json:"from,omitempty"` + To []byte `protobuf:"bytes,13,opt,name=to,proto3" json:"to,omitempty"` + FeeDelegation bool `protobuf:"varint,14,opt,name=feeDelegation,proto3" json:"feeDelegation,omitempty"` + GasUsed uint64 `protobuf:"varint,15,opt,name=gasUsed,proto3" json:"gasUsed,omitempty"` } -func (dst *Receipt) XXX_Merge(src proto.Message) { - xxx_messageInfo_Receipt.Merge(dst, src) + +func (x *Receipt) Reset() { + *x = Receipt{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Receipt) XXX_Size() int { - return xxx_messageInfo_Receipt.Size(m) + +func (x *Receipt) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Receipt) XXX_DiscardUnknown() { - xxx_messageInfo_Receipt.DiscardUnknown(m) + +func (*Receipt) ProtoMessage() {} + +func (x *Receipt) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Receipt proto.InternalMessageInfo +// Deprecated: Use Receipt.ProtoReflect.Descriptor instead. +func (*Receipt) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{12} +} -func (m *Receipt) GetContractAddress() []byte { - if m != nil { - return m.ContractAddress +func (x *Receipt) GetContractAddress() []byte { + if x != nil { + return x.ContractAddress } return nil } -func (m *Receipt) GetStatus() string { - if m != nil { - return m.Status +func (x *Receipt) GetStatus() string { + if x != nil { + return x.Status } return "" } -func (m *Receipt) GetRet() string { - if m != nil { - return m.Ret +func (x *Receipt) GetRet() string { + if x != nil { + return x.Ret } return "" } -func (m *Receipt) GetTxHash() []byte { - if m != nil { - return m.TxHash +func (x *Receipt) GetTxHash() []byte { + if x != nil { + return x.TxHash } return nil } -func (m *Receipt) GetFeeUsed() []byte { - if m != nil { - return m.FeeUsed +func (x *Receipt) GetFeeUsed() []byte { + if x != nil { + return x.FeeUsed } return nil } -func (m *Receipt) GetCumulativeFeeUsed() []byte { - if m != nil { - return m.CumulativeFeeUsed +func (x *Receipt) GetCumulativeFeeUsed() []byte { + if x != nil { + return x.CumulativeFeeUsed } return nil } -func (m *Receipt) GetBloom() []byte { - if m != nil { - return m.Bloom +func (x *Receipt) GetBloom() []byte { + if x != nil { + return x.Bloom } return nil } -func (m *Receipt) GetEvents() []*Event { - if m != nil { - return m.Events +func (x *Receipt) GetEvents() []*Event { + if x != nil { + return x.Events } return nil } -func (m *Receipt) GetBlockNo() uint64 { - if m != nil { - return m.BlockNo +func (x *Receipt) GetBlockNo() uint64 { + if x != nil { + return x.BlockNo } return 0 } -func (m *Receipt) GetBlockHash() []byte { - if m != nil { - return m.BlockHash +func (x *Receipt) GetBlockHash() []byte { + if x != nil { + return x.BlockHash } return nil } -func (m *Receipt) GetTxIndex() int32 { - if m != nil { - return m.TxIndex +func (x *Receipt) GetTxIndex() int32 { + if x != nil { + return x.TxIndex } return 0 } -func (m *Receipt) GetFrom() []byte { - if m != nil { - return m.From +func (x *Receipt) GetFrom() []byte { + if x != nil { + return x.From } return nil } -func (m *Receipt) GetTo() []byte { - if m != nil { - return m.To +func (x *Receipt) GetTo() []byte { + if x != nil { + return x.To } return nil } -func (m *Receipt) GetFeeDelegation() bool { - if m != nil { - return m.FeeDelegation +func (x *Receipt) GetFeeDelegation() bool { + if x != nil { + return x.FeeDelegation } return false } -func (m *Receipt) GetGasUsed() uint64 { - if m != nil { - return m.GasUsed +func (x *Receipt) GetGasUsed() uint64 { + if x != nil { + return x.GasUsed } return 0 } type Event struct { - ContractAddress []byte `protobuf:"bytes,1,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"` - EventName string `protobuf:"bytes,2,opt,name=eventName" json:"eventName,omitempty"` - JsonArgs string `protobuf:"bytes,3,opt,name=jsonArgs" json:"jsonArgs,omitempty"` - EventIdx int32 `protobuf:"varint,4,opt,name=eventIdx" json:"eventIdx,omitempty"` - TxHash []byte `protobuf:"bytes,5,opt,name=txHash,proto3" json:"txHash,omitempty"` - BlockHash []byte `protobuf:"bytes,6,opt,name=blockHash,proto3" json:"blockHash,omitempty"` - BlockNo uint64 `protobuf:"varint,7,opt,name=blockNo" json:"blockNo,omitempty"` - TxIndex int32 `protobuf:"varint,8,opt,name=txIndex" json:"txIndex,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Event) Reset() { *m = Event{} } -func (m *Event) String() string { return proto.CompactTextString(m) } -func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{13} -} -func (m *Event) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Event.Unmarshal(m, b) -} -func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Event.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContractAddress []byte `protobuf:"bytes,1,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"` + EventName string `protobuf:"bytes,2,opt,name=eventName,proto3" json:"eventName,omitempty"` + JsonArgs string `protobuf:"bytes,3,opt,name=jsonArgs,proto3" json:"jsonArgs,omitempty"` + EventIdx int32 `protobuf:"varint,4,opt,name=eventIdx,proto3" json:"eventIdx,omitempty"` + TxHash []byte `protobuf:"bytes,5,opt,name=txHash,proto3" json:"txHash,omitempty"` + BlockHash []byte `protobuf:"bytes,6,opt,name=blockHash,proto3" json:"blockHash,omitempty"` + BlockNo uint64 `protobuf:"varint,7,opt,name=blockNo,proto3" json:"blockNo,omitempty"` + TxIndex int32 `protobuf:"varint,8,opt,name=txIndex,proto3" json:"txIndex,omitempty"` } -func (dst *Event) XXX_Merge(src proto.Message) { - xxx_messageInfo_Event.Merge(dst, src) + +func (x *Event) Reset() { + *x = Event{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Event) XXX_Size() int { - return xxx_messageInfo_Event.Size(m) + +func (x *Event) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Event) XXX_DiscardUnknown() { - xxx_messageInfo_Event.DiscardUnknown(m) + +func (*Event) ProtoMessage() {} + +func (x *Event) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Event proto.InternalMessageInfo +// Deprecated: Use Event.ProtoReflect.Descriptor instead. +func (*Event) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{13} +} -func (m *Event) GetContractAddress() []byte { - if m != nil { - return m.ContractAddress +func (x *Event) GetContractAddress() []byte { + if x != nil { + return x.ContractAddress } return nil } -func (m *Event) GetEventName() string { - if m != nil { - return m.EventName +func (x *Event) GetEventName() string { + if x != nil { + return x.EventName } return "" } -func (m *Event) GetJsonArgs() string { - if m != nil { - return m.JsonArgs +func (x *Event) GetJsonArgs() string { + if x != nil { + return x.JsonArgs } return "" } -func (m *Event) GetEventIdx() int32 { - if m != nil { - return m.EventIdx +func (x *Event) GetEventIdx() int32 { + if x != nil { + return x.EventIdx } return 0 } -func (m *Event) GetTxHash() []byte { - if m != nil { - return m.TxHash +func (x *Event) GetTxHash() []byte { + if x != nil { + return x.TxHash } return nil } -func (m *Event) GetBlockHash() []byte { - if m != nil { - return m.BlockHash +func (x *Event) GetBlockHash() []byte { + if x != nil { + return x.BlockHash } return nil } -func (m *Event) GetBlockNo() uint64 { - if m != nil { - return m.BlockNo +func (x *Event) GetBlockNo() uint64 { + if x != nil { + return x.BlockNo } return 0 } -func (m *Event) GetTxIndex() int32 { - if m != nil { - return m.TxIndex +func (x *Event) GetTxIndex() int32 { + if x != nil { + return x.TxIndex } return 0 } type FnArgument struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *FnArgument) Reset() { *m = FnArgument{} } -func (m *FnArgument) String() string { return proto.CompactTextString(m) } -func (*FnArgument) ProtoMessage() {} -func (*FnArgument) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{14} -} -func (m *FnArgument) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FnArgument.Unmarshal(m, b) + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } -func (m *FnArgument) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FnArgument.Marshal(b, m, deterministic) -} -func (dst *FnArgument) XXX_Merge(src proto.Message) { - xxx_messageInfo_FnArgument.Merge(dst, src) + +func (x *FnArgument) Reset() { + *x = FnArgument{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *FnArgument) XXX_Size() int { - return xxx_messageInfo_FnArgument.Size(m) + +func (x *FnArgument) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *FnArgument) XXX_DiscardUnknown() { - xxx_messageInfo_FnArgument.DiscardUnknown(m) + +func (*FnArgument) ProtoMessage() {} + +func (x *FnArgument) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_FnArgument proto.InternalMessageInfo +// Deprecated: Use FnArgument.ProtoReflect.Descriptor instead. +func (*FnArgument) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{14} +} -func (m *FnArgument) GetName() string { - if m != nil { - return m.Name +func (x *FnArgument) GetName() string { + if x != nil { + return x.Name } return "" } type Function struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Arguments []*FnArgument `protobuf:"bytes,2,rep,name=arguments" json:"arguments,omitempty"` - Payable bool `protobuf:"varint,3,opt,name=payable" json:"payable,omitempty"` - View bool `protobuf:"varint,4,opt,name=view" json:"view,omitempty"` - FeeDelegation bool `protobuf:"varint,5,opt,name=fee_delegation,json=feeDelegation" json:"fee_delegation,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Function) Reset() { *m = Function{} } -func (m *Function) String() string { return proto.CompactTextString(m) } -func (*Function) ProtoMessage() {} -func (*Function) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{15} -} -func (m *Function) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Function.Unmarshal(m, b) -} -func (m *Function) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Function.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Arguments []*FnArgument `protobuf:"bytes,2,rep,name=arguments,proto3" json:"arguments,omitempty"` + Payable bool `protobuf:"varint,3,opt,name=payable,proto3" json:"payable,omitempty"` + View bool `protobuf:"varint,4,opt,name=view,proto3" json:"view,omitempty"` + FeeDelegation bool `protobuf:"varint,5,opt,name=fee_delegation,json=feeDelegation,proto3" json:"fee_delegation,omitempty"` } -func (dst *Function) XXX_Merge(src proto.Message) { - xxx_messageInfo_Function.Merge(dst, src) + +func (x *Function) Reset() { + *x = Function{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Function) XXX_Size() int { - return xxx_messageInfo_Function.Size(m) + +func (x *Function) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Function) XXX_DiscardUnknown() { - xxx_messageInfo_Function.DiscardUnknown(m) + +func (*Function) ProtoMessage() {} + +func (x *Function) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Function proto.InternalMessageInfo +// Deprecated: Use Function.ProtoReflect.Descriptor instead. +func (*Function) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{15} +} -func (m *Function) GetName() string { - if m != nil { - return m.Name +func (x *Function) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *Function) GetArguments() []*FnArgument { - if m != nil { - return m.Arguments +func (x *Function) GetArguments() []*FnArgument { + if x != nil { + return x.Arguments } return nil } -func (m *Function) GetPayable() bool { - if m != nil { - return m.Payable +func (x *Function) GetPayable() bool { + if x != nil { + return x.Payable } return false } -func (m *Function) GetView() bool { - if m != nil { - return m.View +func (x *Function) GetView() bool { + if x != nil { + return x.View } return false } -func (m *Function) GetFeeDelegation() bool { - if m != nil { - return m.FeeDelegation +func (x *Function) GetFeeDelegation() bool { + if x != nil { + return x.FeeDelegation } return false } type StateVar struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"` - Len int32 `protobuf:"varint,3,opt,name=len" json:"len,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *StateVar) Reset() { *m = StateVar{} } -func (m *StateVar) String() string { return proto.CompactTextString(m) } -func (*StateVar) ProtoMessage() {} -func (*StateVar) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{16} -} -func (m *StateVar) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StateVar.Unmarshal(m, b) + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Len int32 `protobuf:"varint,3,opt,name=len,proto3" json:"len,omitempty"` } -func (m *StateVar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StateVar.Marshal(b, m, deterministic) -} -func (dst *StateVar) XXX_Merge(src proto.Message) { - xxx_messageInfo_StateVar.Merge(dst, src) + +func (x *StateVar) Reset() { + *x = StateVar{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *StateVar) XXX_Size() int { - return xxx_messageInfo_StateVar.Size(m) + +func (x *StateVar) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *StateVar) XXX_DiscardUnknown() { - xxx_messageInfo_StateVar.DiscardUnknown(m) + +func (*StateVar) ProtoMessage() {} + +func (x *StateVar) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_StateVar proto.InternalMessageInfo +// Deprecated: Use StateVar.ProtoReflect.Descriptor instead. +func (*StateVar) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{16} +} -func (m *StateVar) GetName() string { - if m != nil { - return m.Name +func (x *StateVar) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *StateVar) GetType() string { - if m != nil { - return m.Type +func (x *StateVar) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *StateVar) GetLen() int32 { - if m != nil { - return m.Len +func (x *StateVar) GetLen() int32 { + if x != nil { + return x.Len } return 0 } type ABI struct { - Version string `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` - Language string `protobuf:"bytes,2,opt,name=language" json:"language,omitempty"` - Functions []*Function `protobuf:"bytes,3,rep,name=functions" json:"functions,omitempty"` - StateVariables []*StateVar `protobuf:"bytes,4,rep,name=state_variables,json=stateVariables" json:"state_variables,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ABI) Reset() { *m = ABI{} } -func (m *ABI) String() string { return proto.CompactTextString(m) } -func (*ABI) ProtoMessage() {} -func (*ABI) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{17} -} -func (m *ABI) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ABI.Unmarshal(m, b) -} -func (m *ABI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ABI.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Language string `protobuf:"bytes,2,opt,name=language,proto3" json:"language,omitempty"` + Functions []*Function `protobuf:"bytes,3,rep,name=functions,proto3" json:"functions,omitempty"` + StateVariables []*StateVar `protobuf:"bytes,4,rep,name=state_variables,json=stateVariables,proto3" json:"state_variables,omitempty"` } -func (dst *ABI) XXX_Merge(src proto.Message) { - xxx_messageInfo_ABI.Merge(dst, src) + +func (x *ABI) Reset() { + *x = ABI{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ABI) XXX_Size() int { - return xxx_messageInfo_ABI.Size(m) + +func (x *ABI) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ABI) XXX_DiscardUnknown() { - xxx_messageInfo_ABI.DiscardUnknown(m) + +func (*ABI) ProtoMessage() {} + +func (x *ABI) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ABI proto.InternalMessageInfo +// Deprecated: Use ABI.ProtoReflect.Descriptor instead. +func (*ABI) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{17} +} -func (m *ABI) GetVersion() string { - if m != nil { - return m.Version +func (x *ABI) GetVersion() string { + if x != nil { + return x.Version } return "" } -func (m *ABI) GetLanguage() string { - if m != nil { - return m.Language +func (x *ABI) GetLanguage() string { + if x != nil { + return x.Language } return "" } -func (m *ABI) GetFunctions() []*Function { - if m != nil { - return m.Functions +func (x *ABI) GetFunctions() []*Function { + if x != nil { + return x.Functions } return nil } -func (m *ABI) GetStateVariables() []*StateVar { - if m != nil { - return m.StateVariables +func (x *ABI) GetStateVariables() []*StateVar { + if x != nil { + return x.StateVariables } return nil } type Query struct { - ContractAddress []byte `protobuf:"bytes,1,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"` - Queryinfo []byte `protobuf:"bytes,2,opt,name=queryinfo,proto3" json:"queryinfo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Query) Reset() { *m = Query{} } -func (m *Query) String() string { return proto.CompactTextString(m) } -func (*Query) ProtoMessage() {} -func (*Query) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{18} -} -func (m *Query) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Query.Unmarshal(m, b) -} -func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Query.Marshal(b, m, deterministic) + ContractAddress []byte `protobuf:"bytes,1,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"` + Queryinfo []byte `protobuf:"bytes,2,opt,name=queryinfo,proto3" json:"queryinfo,omitempty"` } -func (dst *Query) XXX_Merge(src proto.Message) { - xxx_messageInfo_Query.Merge(dst, src) + +func (x *Query) Reset() { + *x = Query{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Query) XXX_Size() int { - return xxx_messageInfo_Query.Size(m) + +func (x *Query) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Query) XXX_DiscardUnknown() { - xxx_messageInfo_Query.DiscardUnknown(m) + +func (*Query) ProtoMessage() {} + +func (x *Query) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Query proto.InternalMessageInfo +// Deprecated: Use Query.ProtoReflect.Descriptor instead. +func (*Query) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{18} +} -func (m *Query) GetContractAddress() []byte { - if m != nil { - return m.ContractAddress +func (x *Query) GetContractAddress() []byte { + if x != nil { + return x.ContractAddress } return nil } -func (m *Query) GetQueryinfo() []byte { - if m != nil { - return m.Queryinfo +func (x *Query) GetQueryinfo() []byte { + if x != nil { + return x.Queryinfo } return nil } type StateQuery struct { - ContractAddress []byte `protobuf:"bytes,1,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"` - Root []byte `protobuf:"bytes,3,opt,name=root,proto3" json:"root,omitempty"` - Compressed bool `protobuf:"varint,4,opt,name=compressed" json:"compressed,omitempty"` - StorageKeys [][]byte `protobuf:"bytes,5,rep,name=storageKeys,proto3" json:"storageKeys,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StateQuery) Reset() { *m = StateQuery{} } -func (m *StateQuery) String() string { return proto.CompactTextString(m) } -func (*StateQuery) ProtoMessage() {} -func (*StateQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{19} -} -func (m *StateQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StateQuery.Unmarshal(m, b) -} -func (m *StateQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StateQuery.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContractAddress []byte `protobuf:"bytes,1,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"` + Root []byte `protobuf:"bytes,3,opt,name=root,proto3" json:"root,omitempty"` + Compressed bool `protobuf:"varint,4,opt,name=compressed,proto3" json:"compressed,omitempty"` + StorageKeys [][]byte `protobuf:"bytes,5,rep,name=storageKeys,proto3" json:"storageKeys,omitempty"` } -func (dst *StateQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_StateQuery.Merge(dst, src) + +func (x *StateQuery) Reset() { + *x = StateQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *StateQuery) XXX_Size() int { - return xxx_messageInfo_StateQuery.Size(m) + +func (x *StateQuery) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *StateQuery) XXX_DiscardUnknown() { - xxx_messageInfo_StateQuery.DiscardUnknown(m) + +func (*StateQuery) ProtoMessage() {} + +func (x *StateQuery) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_StateQuery proto.InternalMessageInfo +// Deprecated: Use StateQuery.ProtoReflect.Descriptor instead. +func (*StateQuery) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{19} +} -func (m *StateQuery) GetContractAddress() []byte { - if m != nil { - return m.ContractAddress +func (x *StateQuery) GetContractAddress() []byte { + if x != nil { + return x.ContractAddress } return nil } -func (m *StateQuery) GetRoot() []byte { - if m != nil { - return m.Root +func (x *StateQuery) GetRoot() []byte { + if x != nil { + return x.Root } return nil } -func (m *StateQuery) GetCompressed() bool { - if m != nil { - return m.Compressed +func (x *StateQuery) GetCompressed() bool { + if x != nil { + return x.Compressed } return false } -func (m *StateQuery) GetStorageKeys() [][]byte { - if m != nil { - return m.StorageKeys +func (x *StateQuery) GetStorageKeys() [][]byte { + if x != nil { + return x.StorageKeys } return nil } type FilterInfo struct { - ContractAddress []byte `protobuf:"bytes,1,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"` - EventName string `protobuf:"bytes,2,opt,name=eventName" json:"eventName,omitempty"` - Blockfrom uint64 `protobuf:"varint,3,opt,name=blockfrom" json:"blockfrom,omitempty"` - Blockto uint64 `protobuf:"varint,4,opt,name=blockto" json:"blockto,omitempty"` - Desc bool `protobuf:"varint,5,opt,name=desc" json:"desc,omitempty"` - ArgFilter []byte `protobuf:"bytes,6,opt,name=argFilter,proto3" json:"argFilter,omitempty"` - RecentBlockCnt int32 `protobuf:"varint,7,opt,name=recentBlockCnt" json:"recentBlockCnt,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FilterInfo) Reset() { *m = FilterInfo{} } -func (m *FilterInfo) String() string { return proto.CompactTextString(m) } -func (*FilterInfo) ProtoMessage() {} -func (*FilterInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{20} -} -func (m *FilterInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FilterInfo.Unmarshal(m, b) -} -func (m *FilterInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FilterInfo.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContractAddress []byte `protobuf:"bytes,1,opt,name=contractAddress,proto3" json:"contractAddress,omitempty"` + EventName string `protobuf:"bytes,2,opt,name=eventName,proto3" json:"eventName,omitempty"` + Blockfrom uint64 `protobuf:"varint,3,opt,name=blockfrom,proto3" json:"blockfrom,omitempty"` + Blockto uint64 `protobuf:"varint,4,opt,name=blockto,proto3" json:"blockto,omitempty"` + Desc bool `protobuf:"varint,5,opt,name=desc,proto3" json:"desc,omitempty"` + ArgFilter []byte `protobuf:"bytes,6,opt,name=argFilter,proto3" json:"argFilter,omitempty"` + RecentBlockCnt int32 `protobuf:"varint,7,opt,name=recentBlockCnt,proto3" json:"recentBlockCnt,omitempty"` } -func (dst *FilterInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_FilterInfo.Merge(dst, src) + +func (x *FilterInfo) Reset() { + *x = FilterInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *FilterInfo) XXX_Size() int { - return xxx_messageInfo_FilterInfo.Size(m) + +func (x *FilterInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *FilterInfo) XXX_DiscardUnknown() { - xxx_messageInfo_FilterInfo.DiscardUnknown(m) + +func (*FilterInfo) ProtoMessage() {} + +func (x *FilterInfo) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_FilterInfo proto.InternalMessageInfo +// Deprecated: Use FilterInfo.ProtoReflect.Descriptor instead. +func (*FilterInfo) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{20} +} -func (m *FilterInfo) GetContractAddress() []byte { - if m != nil { - return m.ContractAddress +func (x *FilterInfo) GetContractAddress() []byte { + if x != nil { + return x.ContractAddress } return nil } -func (m *FilterInfo) GetEventName() string { - if m != nil { - return m.EventName +func (x *FilterInfo) GetEventName() string { + if x != nil { + return x.EventName } return "" } -func (m *FilterInfo) GetBlockfrom() uint64 { - if m != nil { - return m.Blockfrom +func (x *FilterInfo) GetBlockfrom() uint64 { + if x != nil { + return x.Blockfrom } return 0 } -func (m *FilterInfo) GetBlockto() uint64 { - if m != nil { - return m.Blockto +func (x *FilterInfo) GetBlockto() uint64 { + if x != nil { + return x.Blockto } return 0 } -func (m *FilterInfo) GetDesc() bool { - if m != nil { - return m.Desc +func (x *FilterInfo) GetDesc() bool { + if x != nil { + return x.Desc } return false } -func (m *FilterInfo) GetArgFilter() []byte { - if m != nil { - return m.ArgFilter +func (x *FilterInfo) GetArgFilter() []byte { + if x != nil { + return x.ArgFilter } return nil } -func (m *FilterInfo) GetRecentBlockCnt() int32 { - if m != nil { - return m.RecentBlockCnt +func (x *FilterInfo) GetRecentBlockCnt() int32 { + if x != nil { + return x.RecentBlockCnt } return 0 } type Proposal struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` - MultipleChoice uint32 `protobuf:"varint,6,opt,name=multipleChoice" json:"multipleChoice,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Proposal) Reset() { *m = Proposal{} } -func (m *Proposal) String() string { return proto.CompactTextString(m) } -func (*Proposal) ProtoMessage() {} -func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_blockchain_bcfdea0869ea68f3, []int{21} + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + MultipleChoice uint32 `protobuf:"varint,6,opt,name=multipleChoice,proto3" json:"multipleChoice,omitempty"` } -func (m *Proposal) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Proposal.Unmarshal(m, b) -} -func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Proposal.Marshal(b, m, deterministic) -} -func (dst *Proposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proposal.Merge(dst, src) + +func (x *Proposal) Reset() { + *x = Proposal{} + if protoimpl.UnsafeEnabled { + mi := &file_blockchain_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Proposal) XXX_Size() int { - return xxx_messageInfo_Proposal.Size(m) + +func (x *Proposal) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Proposal) XXX_DiscardUnknown() { - xxx_messageInfo_Proposal.DiscardUnknown(m) + +func (*Proposal) ProtoMessage() {} + +func (x *Proposal) ProtoReflect() protoreflect.Message { + mi := &file_blockchain_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Proposal proto.InternalMessageInfo +// Deprecated: Use Proposal.ProtoReflect.Descriptor instead. +func (*Proposal) Descriptor() ([]byte, []int) { + return file_blockchain_proto_rawDescGZIP(), []int{21} +} -func (m *Proposal) GetId() string { - if m != nil { - return m.Id +func (x *Proposal) GetId() string { + if x != nil { + return x.Id } return "" } -func (m *Proposal) GetDescription() string { - if m != nil { - return m.Description +func (x *Proposal) GetDescription() string { + if x != nil { + return x.Description } return "" } -func (m *Proposal) GetMultipleChoice() uint32 { - if m != nil { - return m.MultipleChoice +func (x *Proposal) GetMultipleChoice() uint32 { + if x != nil { + return x.MultipleChoice } return 0 } -func init() { - proto.RegisterType((*Block)(nil), "types.Block") - proto.RegisterType((*BlockHeader)(nil), "types.BlockHeader") - proto.RegisterType((*BlockBody)(nil), "types.BlockBody") - proto.RegisterType((*TxList)(nil), "types.TxList") - proto.RegisterType((*Tx)(nil), "types.Tx") - proto.RegisterType((*TxBody)(nil), "types.TxBody") - proto.RegisterType((*TxIdx)(nil), "types.TxIdx") - proto.RegisterType((*TxInBlock)(nil), "types.TxInBlock") - proto.RegisterType((*State)(nil), "types.State") - proto.RegisterType((*AccountProof)(nil), "types.AccountProof") - proto.RegisterType((*ContractVarProof)(nil), "types.ContractVarProof") - proto.RegisterType((*StateQueryProof)(nil), "types.StateQueryProof") - proto.RegisterType((*Receipt)(nil), "types.Receipt") - proto.RegisterType((*Event)(nil), "types.Event") - proto.RegisterType((*FnArgument)(nil), "types.FnArgument") - proto.RegisterType((*Function)(nil), "types.Function") - proto.RegisterType((*StateVar)(nil), "types.StateVar") - proto.RegisterType((*ABI)(nil), "types.ABI") - proto.RegisterType((*Query)(nil), "types.Query") - proto.RegisterType((*StateQuery)(nil), "types.StateQuery") - proto.RegisterType((*FilterInfo)(nil), "types.FilterInfo") - proto.RegisterType((*Proposal)(nil), "types.Proposal") - proto.RegisterEnum("types.TxType", TxType_name, TxType_value) -} - -func init() { proto.RegisterFile("blockchain.proto", fileDescriptor_blockchain_bcfdea0869ea68f3) } - -var fileDescriptor_blockchain_bcfdea0869ea68f3 = []byte{ - // 1483 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4b, 0x8f, 0x1b, 0xc7, - 0x11, 0x0e, 0xc9, 0x19, 0x2e, 0x59, 0xfb, 0xa2, 0x3a, 0x42, 0x32, 0x49, 0x84, 0x60, 0x33, 0x90, - 0x82, 0x85, 0x90, 0x28, 0x80, 0x82, 0x20, 0x09, 0x72, 0xa2, 0x76, 0xb9, 0x0a, 0xa5, 0xcd, 0xee, - 0xa6, 0xc5, 0x2c, 0x90, 0x93, 0xd0, 0x9c, 0x69, 0x92, 0x13, 0x0d, 0xa7, 0xa9, 0xe9, 0x26, 0x43, - 0x9e, 0x7d, 0xf4, 0xcd, 0x37, 0x1f, 0x0d, 0xf8, 0xee, 0x3f, 0x65, 0x18, 0xbe, 0xfa, 0x1f, 0x18, - 0x55, 0xdd, 0xf3, 0x20, 0x77, 0x6d, 0x43, 0x80, 0x0f, 0xbe, 0x75, 0x7d, 0x5d, 0xdd, 0x53, 0x55, - 0x5f, 0x3d, 0x7a, 0xa0, 0x37, 0x4e, 0x55, 0xf4, 0x2e, 0x9a, 0x89, 0x24, 0x7b, 0xb6, 0xc8, 0x95, - 0x51, 0xcc, 0x37, 0x9b, 0x85, 0xd4, 0xe1, 0x1c, 0xfc, 0x17, 0xb8, 0xc5, 0x18, 0x78, 0x33, 0xa1, - 0x67, 0x41, 0xe3, 0xa4, 0x71, 0x7a, 0xc0, 0x69, 0xcd, 0x9e, 0x42, 0x7b, 0x26, 0x45, 0x2c, 0xf3, - 0xa0, 0x79, 0xd2, 0x38, 0xdd, 0x7f, 0xce, 0x9e, 0xd1, 0xa1, 0x67, 0x74, 0xe2, 0x9f, 0xb4, 0xc3, - 0x9d, 0x06, 0x7b, 0x0c, 0xde, 0x58, 0xc5, 0x9b, 0xa0, 0x45, 0x9a, 0xbd, 0xba, 0xe6, 0x0b, 0x15, - 0x6f, 0x38, 0xed, 0x86, 0x1f, 0xb7, 0x60, 0xbf, 0x76, 0x9a, 0x05, 0xb0, 0x47, 0x46, 0x0d, 0xcf, - 0xdd, 0x87, 0x0b, 0x91, 0x3d, 0x86, 0xc3, 0x45, 0x2e, 0x57, 0x56, 0x19, 0x0d, 0x6b, 0xd2, 0xfe, - 0x36, 0x88, 0xe7, 0xc9, 0xb3, 0x2b, 0x45, 0x1f, 0xf6, 0x78, 0x21, 0xb2, 0x47, 0xd0, 0x35, 0xc9, - 0x5c, 0x6a, 0x23, 0xe6, 0x8b, 0xc0, 0x3b, 0x69, 0x9c, 0xb6, 0x78, 0x05, 0xb0, 0xdf, 0xc3, 0x11, - 0x29, 0x6a, 0xae, 0x94, 0xa1, 0xeb, 0x7d, 0xba, 0x7e, 0x07, 0x65, 0x27, 0xb0, 0x6f, 0xd6, 0x95, - 0x52, 0x9b, 0x94, 0xea, 0x10, 0x7b, 0x0a, 0xbd, 0x5c, 0x46, 0x32, 0x59, 0x98, 0x4a, 0x6d, 0x8f, - 0xd4, 0xee, 0xe0, 0xec, 0xd7, 0xd0, 0x89, 0x54, 0x36, 0x49, 0xf2, 0xb9, 0x0e, 0x3a, 0x64, 0x6e, - 0x29, 0xb3, 0x5f, 0x40, 0x7b, 0xb1, 0x1c, 0xbf, 0x96, 0x9b, 0xa0, 0x4b, 0xa7, 0x9d, 0xc4, 0x4e, - 0xe1, 0x38, 0x52, 0x49, 0x36, 0x16, 0x5a, 0xf6, 0xa3, 0x48, 0x2d, 0x33, 0x13, 0x00, 0x29, 0xec, - 0xc2, 0xc8, 0xa0, 0x4e, 0xa6, 0x59, 0xb0, 0x6f, 0x19, 0xc4, 0x35, 0x46, 0x21, 0x52, 0x99, 0x96, - 0x99, 0x5e, 0xea, 0xe0, 0x80, 0x36, 0x2a, 0x20, 0x3c, 0x85, 0x6e, 0x49, 0x10, 0xfb, 0x0d, 0xb4, - 0xcc, 0x5a, 0x07, 0x8d, 0x93, 0xd6, 0xe9, 0xfe, 0xf3, 0xae, 0xe3, 0x6f, 0xb4, 0xe6, 0x88, 0x86, - 0x4f, 0xa0, 0x3d, 0x5a, 0x5f, 0x26, 0xda, 0x7c, 0xbf, 0xda, 0x3f, 0xa0, 0x39, 0x5a, 0xdf, 0x9b, - 0x4a, 0xbf, 0x73, 0xe9, 0x61, 0x13, 0xe9, 0xb0, 0x3c, 0x57, 0xcb, 0x8d, 0x4f, 0x9b, 0xf8, 0x11, - 0xb2, 0xe5, 0x21, 0xf8, 0x99, 0xca, 0x22, 0x49, 0x57, 0x78, 0xdc, 0x0a, 0x48, 0xb6, 0x70, 0x21, - 0xb0, 0xc9, 0x50, 0x88, 0xe8, 0x66, 0x2e, 0xa3, 0x64, 0x91, 0xc8, 0xcc, 0x50, 0x22, 0x1c, 0xf0, - 0x0a, 0xc0, 0xd0, 0x8a, 0x39, 0x1d, 0xf3, 0x6c, 0x68, 0xad, 0x84, 0xf7, 0x2d, 0xc4, 0x26, 0x55, - 0x22, 0x76, 0xec, 0x17, 0x22, 0x12, 0x35, 0x15, 0xfa, 0x32, 0x99, 0x27, 0x86, 0x38, 0xf7, 0x78, - 0x29, 0xbb, 0xbd, 0x9b, 0x3c, 0x89, 0xa4, 0x23, 0xba, 0x94, 0xd1, 0x4b, 0x74, 0x8c, 0xc8, 0x3d, - 0xaa, 0x79, 0x39, 0xda, 0x2c, 0x24, 0xa7, 0x2d, 0xcc, 0x28, 0x9b, 0xe2, 0x31, 0xa5, 0x8a, 0x25, - 0xbb, 0x0e, 0x95, 0x3c, 0x42, 0xc5, 0x63, 0xf8, 0x57, 0xf0, 0x47, 0xeb, 0x61, 0xbc, 0x46, 0x4f, - 0xc7, 0x65, 0x49, 0xd8, 0x00, 0x57, 0x00, 0xeb, 0x41, 0x2b, 0x89, 0xd7, 0x14, 0x1d, 0x9f, 0xe3, - 0x32, 0x7c, 0x05, 0xdd, 0xd1, 0x7a, 0x98, 0xd9, 0x1a, 0x0f, 0xc1, 0x37, 0x78, 0x0b, 0x1d, 0xdc, - 0x7f, 0x7e, 0x50, 0xda, 0x37, 0x8c, 0xd7, 0xdc, 0x6e, 0xb1, 0x5f, 0x41, 0xd3, 0xac, 0x1d, 0x4d, - 0x35, 0x7a, 0x9b, 0x66, 0x1d, 0x7e, 0xd6, 0x00, 0xff, 0x8d, 0x11, 0x46, 0x7e, 0x37, 0x3f, 0x63, - 0x91, 0x0a, 0xc4, 0x1d, 0x3f, 0x4e, 0xb4, 0x89, 0x1f, 0x4b, 0x32, 0xda, 0xd2, 0x53, 0xca, 0x18, - 0x10, 0x6d, 0x54, 0x2e, 0xa6, 0x12, 0xeb, 0xc4, 0x51, 0x54, 0x87, 0xb0, 0xc4, 0xf4, 0xfb, 0x94, - 0xcb, 0x48, 0xad, 0x64, 0xbe, 0xb9, 0x51, 0x49, 0x66, 0x88, 0x30, 0x8f, 0xdf, 0xc1, 0xc3, 0xaf, - 0x1b, 0x70, 0xe0, 0x0a, 0xe2, 0x26, 0x57, 0x6a, 0x82, 0x3e, 0x6b, 0xb4, 0x79, 0xc7, 0x67, 0xf2, - 0x83, 0xdb, 0x2d, 0x0c, 0x6a, 0x92, 0x45, 0xe9, 0x52, 0x27, 0x2a, 0x23, 0xd3, 0x3b, 0xbc, 0x02, - 0x30, 0xa8, 0xef, 0xe4, 0xc6, 0xd9, 0x8d, 0x4b, 0x74, 0x67, 0x81, 0x97, 0x63, 0xb5, 0x5a, 0x7b, - 0x4b, 0xb9, 0xdc, 0xbb, 0x15, 0xa9, 0xcb, 0xaa, 0x52, 0xc6, 0x44, 0x1c, 0x27, 0x66, 0x2e, 0x16, - 0xae, 0x91, 0x38, 0x09, 0xf1, 0x99, 0x4c, 0xa6, 0x33, 0x43, 0x09, 0x75, 0xc8, 0x9d, 0x84, 0x76, - 0x89, 0x65, 0x9c, 0x98, 0x1b, 0x61, 0x66, 0x41, 0xe7, 0xa4, 0x85, 0x64, 0x97, 0x40, 0xf8, 0x65, - 0x03, 0x7a, 0x67, 0x2a, 0x33, 0xb9, 0x88, 0xcc, 0xad, 0xc8, 0xad, 0xbb, 0x0f, 0xc1, 0x5f, 0x89, - 0x74, 0x29, 0x5d, 0x6e, 0x58, 0xe1, 0x07, 0x1c, 0xfc, 0x49, 0xb8, 0x53, 0x84, 0xb9, 0x5b, 0x86, - 0xf9, 0x95, 0xd7, 0x69, 0xf5, 0xbc, 0xf0, 0xa3, 0x06, 0x1c, 0x13, 0x5b, 0xff, 0x5e, 0x22, 0xcb, - 0xe4, 0xe5, 0xdf, 0xe1, 0x30, 0x72, 0x9e, 0x13, 0xe0, 0xc8, 0xfd, 0xb9, 0x23, 0xb7, 0x9e, 0x00, - 0x7c, 0x5b, 0x93, 0xfd, 0x05, 0xba, 0x2b, 0x17, 0x2c, 0x1d, 0x34, 0xa9, 0x8b, 0xfd, 0xd2, 0x1d, - 0xdb, 0x0d, 0x26, 0xaf, 0x34, 0xc3, 0x2f, 0x5a, 0xb0, 0xc7, 0x6d, 0x3f, 0xb7, 0x2d, 0xd9, 0xaa, - 0xf6, 0xe3, 0x38, 0x97, 0x5a, 0xbb, 0x68, 0xef, 0xc2, 0x18, 0x09, 0xcc, 0xb0, 0xa5, 0xa6, 0xa0, - 0x77, 0xb9, 0x93, 0xd0, 0xd7, 0x5c, 0xda, 0x4e, 0xd5, 0xe5, 0xb8, 0x44, 0x4d, 0xb3, 0xa6, 0xfa, - 0x70, 0x3d, 0xca, 0x4a, 0x58, 0x53, 0x13, 0x29, 0xff, 0xa3, 0x65, 0xd9, 0xa3, 0x9c, 0xc8, 0xfe, - 0x00, 0x0f, 0xa2, 0xe5, 0x7c, 0x99, 0x0a, 0x93, 0xac, 0xe4, 0x85, 0xd3, 0xb1, 0x44, 0xdc, 0xdd, - 0xc0, 0xbc, 0x18, 0xa7, 0x4a, 0xcd, 0x5d, 0xcb, 0xb2, 0x02, 0x7b, 0x0c, 0x6d, 0xb9, 0x92, 0x99, - 0xd1, 0x44, 0x47, 0x55, 0x1d, 0x03, 0x04, 0xb9, 0xdb, 0xab, 0x0f, 0xd9, 0xee, 0x9d, 0x21, 0x5b, - 0x75, 0x23, 0xd8, 0xed, 0x46, 0x01, 0xec, 0x99, 0xf5, 0x30, 0x8b, 0xe5, 0x9a, 0x66, 0x92, 0xcf, - 0x0b, 0x11, 0x5b, 0xdc, 0x24, 0x57, 0x73, 0x37, 0x91, 0x68, 0xcd, 0x8e, 0xa0, 0x69, 0x54, 0x70, - 0x48, 0x48, 0xd3, 0x28, 0x7c, 0x00, 0x4c, 0xa4, 0x3c, 0x97, 0xa9, 0x9c, 0x0a, 0x83, 0x79, 0x7b, - 0x44, 0x79, 0xbb, 0x0d, 0xe2, 0x37, 0xa6, 0x42, 0x93, 0xef, 0xc7, 0xd6, 0x36, 0x27, 0x86, 0xdf, - 0x34, 0xc0, 0x27, 0x3f, 0x3e, 0x80, 0xaf, 0x47, 0xd0, 0x25, 0x9f, 0xaf, 0xc4, 0x5c, 0x3a, 0xca, - 0x2a, 0x00, 0x6b, 0xe1, 0x7f, 0x5a, 0x65, 0xfd, 0x7c, 0xaa, 0x1d, 0x75, 0xa5, 0x8c, 0x7b, 0xa4, - 0x88, 0xdd, 0xd5, 0x23, 0x67, 0x4b, 0xb9, 0xc6, 0xad, 0xbf, 0xc5, 0xed, 0x56, 0xf4, 0xda, 0xf7, - 0x44, 0xaf, 0x88, 0xfa, 0xde, 0x76, 0xd4, 0x6b, 0x71, 0xed, 0x6c, 0xc5, 0x35, 0x3c, 0x01, 0xb8, - 0x40, 0x7b, 0x96, 0x73, 0x69, 0x1f, 0x04, 0x19, 0x3a, 0xd2, 0x20, 0x5b, 0x69, 0x1d, 0x7e, 0xde, - 0x80, 0xce, 0xc5, 0x32, 0x8b, 0x28, 0x78, 0xf7, 0x28, 0xb0, 0x3f, 0x41, 0x57, 0xb8, 0x0b, 0x8a, - 0xfa, 0x78, 0xe0, 0xb2, 0xa2, 0xba, 0x9a, 0x57, 0x3a, 0x6e, 0x8a, 0x8a, 0x71, 0x2a, 0x29, 0x28, - 0x1d, 0x5e, 0x88, 0x78, 0xfd, 0x2a, 0x91, 0xff, 0xa7, 0x78, 0x74, 0x38, 0xad, 0xd9, 0x13, 0x38, - 0x9a, 0x48, 0xf9, 0x36, 0xae, 0x68, 0xf5, 0xef, 0xa1, 0x35, 0x3c, 0x87, 0x0e, 0xd5, 0xfc, 0xad, - 0xc8, 0xef, 0xb5, 0x92, 0xb9, 0x41, 0x6b, 0x39, 0xb2, 0x93, 0xb5, 0x07, 0xad, 0x54, 0x66, 0x64, - 0x84, 0xcf, 0x71, 0x89, 0xce, 0xb6, 0xfa, 0x2f, 0x86, 0x68, 0xe2, 0x4a, 0xe6, 0xd4, 0xfc, 0xec, - 0x25, 0x85, 0x88, 0xb4, 0xa5, 0x22, 0x9b, 0x2e, 0xc5, 0xb4, 0xb8, 0xab, 0x94, 0xd9, 0x1f, 0xa1, - 0x3b, 0x71, 0x91, 0x42, 0xbe, 0x31, 0x12, 0xc7, 0x45, 0x24, 0x1c, 0xce, 0x2b, 0x0d, 0xf6, 0x37, - 0x38, 0xa6, 0x69, 0xf2, 0x76, 0x25, 0xf2, 0x04, 0xfd, 0xd7, 0x81, 0xb7, 0x75, 0xa8, 0x70, 0x88, - 0x1f, 0x69, 0xb7, 0xb2, 0x6a, 0xe1, 0x35, 0xf8, 0xd4, 0xdb, 0x3e, 0x2c, 0x51, 0xdf, 0xe3, 0x91, - 0x24, 0x9b, 0x28, 0x37, 0x6c, 0x2b, 0x20, 0xfc, 0xa4, 0x01, 0x50, 0xb5, 0xcc, 0x0f, 0xb8, 0x96, - 0x81, 0x97, 0xe3, 0x10, 0xb6, 0xb3, 0x8e, 0xd6, 0xec, 0xb7, 0x00, 0x91, 0x9a, 0x2f, 0x70, 0x5f, - 0xc6, 0x8e, 0xcb, 0x1a, 0x52, 0x9b, 0xdf, 0xaf, 0xe5, 0x46, 0x07, 0x3e, 0xf5, 0xf5, 0x3a, 0xf4, - 0xca, 0xeb, 0x34, 0x7b, 0xad, 0xf0, 0xab, 0x06, 0xc0, 0x45, 0x92, 0x1a, 0x99, 0x0f, 0xb3, 0x89, - 0xfa, 0xd1, 0x8a, 0xb2, 0x28, 0x22, 0xea, 0x27, 0xf6, 0x1f, 0xa0, 0x02, 0xca, 0x22, 0x32, 0x8a, - 0x2c, 0x2f, 0x8a, 0xc8, 0x28, 0x74, 0x35, 0x96, 0x3a, 0x72, 0xe9, 0x47, 0x6b, 0x1a, 0x50, 0xf9, - 0xd4, 0x1a, 0x59, 0x14, 0x64, 0x09, 0xe0, 0x3f, 0x03, 0xbe, 0xe8, 0x33, 0x43, 0x8f, 0xa9, 0xb3, - 0xcc, 0x8e, 0x37, 0x9f, 0xef, 0xa0, 0x61, 0x0c, 0x9d, 0x9b, 0x5c, 0x2d, 0x94, 0x16, 0x29, 0x36, - 0xb5, 0x24, 0x76, 0x49, 0xd7, 0x4c, 0x28, 0x58, 0xf8, 0xa5, 0x3c, 0x59, 0x50, 0xee, 0xdb, 0x2e, - 0x52, 0x87, 0xf0, 0x2b, 0xf3, 0x65, 0x6a, 0x92, 0x45, 0x2a, 0xcf, 0x66, 0x0a, 0x1f, 0x99, 0x6d, - 0x1a, 0xa2, 0x3b, 0xe8, 0xd3, 0x04, 0x1f, 0xcb, 0xf8, 0xae, 0x64, 0x00, 0xed, 0xab, 0x6b, 0xfe, - 0xaf, 0xfe, 0x65, 0xef, 0x67, 0xec, 0x08, 0xe0, 0xe5, 0xf5, 0xed, 0x80, 0x5f, 0xf5, 0xaf, 0xce, - 0x06, 0xbd, 0x06, 0x3b, 0x80, 0x0e, 0x1f, 0x9c, 0x0f, 0x6e, 0x2e, 0xaf, 0xff, 0xdb, 0x6b, 0xb2, - 0x07, 0x70, 0x78, 0x31, 0x18, 0x9c, 0x0f, 0x2e, 0x07, 0x2f, 0xfb, 0xa3, 0xe1, 0xf5, 0x55, 0xaf, - 0x85, 0x0a, 0x23, 0xde, 0xbf, 0x7a, 0x73, 0x31, 0xe0, 0x3d, 0x8f, 0x75, 0xc0, 0x3b, 0xeb, 0x5f, - 0x5e, 0xf6, 0x7c, 0xbc, 0xd4, 0x1d, 0x6b, 0x8f, 0xdb, 0xf4, 0xc7, 0xf8, 0xe7, 0x6f, 0x03, 0x00, - 0x00, 0xff, 0xff, 0x25, 0xc1, 0x82, 0x2d, 0x45, 0x0e, 0x00, 0x00, +var File_blockchain_proto protoreflect.FileDescriptor + +var file_blockchain_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x6d, 0x0a, 0x05, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x2a, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x24, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, + 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x8b, 0x03, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x49, 0x44, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x72, 0x65, 0x76, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x76, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x4e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x4e, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x26, 0x0a, 0x0e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x48, 0x61, + 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, + 0x52, 0x6f, 0x6f, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x74, 0x78, 0x73, 0x52, + 0x6f, 0x6f, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, + 0x78, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2a, 0x0a, 0x10, 0x72, 0x65, + 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, + 0x6f, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, + 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, + 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6f, + 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x22, 0x28, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, + 0x6f, 0x64, 0x79, 0x12, 0x1b, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x09, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, 0x78, 0x52, 0x03, 0x74, 0x78, 0x73, + 0x22, 0x25, 0x0a, 0x06, 0x54, 0x78, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x03, 0x74, 0x78, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x54, 0x78, 0x52, 0x03, 0x74, 0x78, 0x73, 0x22, 0x3b, 0x0a, 0x02, 0x54, 0x78, 0x12, 0x12, 0x0a, + 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, + 0x68, 0x12, 0x21, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, 0x78, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x22, 0x99, 0x02, 0x0a, 0x06, 0x54, 0x78, 0x42, 0x6f, 0x64, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, + 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, + 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x67, + 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x67, + 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, 0x78, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x49, 0x64, 0x48, 0x61, 0x73, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, + 0x73, 0x69, 0x67, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, + 0x22, 0x37, 0x0a, 0x05, 0x54, 0x78, 0x49, 0x64, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x64, 0x78, 0x22, 0x4a, 0x0a, 0x09, 0x54, 0x78, 0x49, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x22, 0x0a, 0x05, 0x74, 0x78, 0x49, 0x64, 0x78, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, 0x78, + 0x49, 0x64, 0x78, 0x52, 0x05, 0x74, 0x78, 0x49, 0x64, 0x78, 0x12, 0x19, 0x0a, 0x02, 0x74, 0x78, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, + 0x78, 0x52, 0x02, 0x74, 0x78, 0x22, 0xa1, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, + 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2a, 0x0a, + 0x10, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x73, 0x71, 0x6c, 0x52, 0x65, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0xe8, 0x01, 0x0a, 0x0c, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x22, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x56, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x56, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x16, + 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x64, 0x69, 0x74, 0x50, + 0x61, 0x74, 0x68, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x75, 0x64, 0x69, 0x74, + 0x50, 0x61, 0x74, 0x68, 0x22, 0xe4, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x56, 0x61, 0x72, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0x56, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0x56, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x70, 0x12, 0x16, 0x0a, + 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x64, 0x69, 0x74, 0x50, 0x61, + 0x74, 0x68, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x75, 0x64, 0x69, 0x74, 0x50, + 0x61, 0x74, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0x83, 0x01, 0x0a, 0x0f, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, + 0x39, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x0d, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x35, 0x0a, 0x09, 0x76, 0x61, + 0x72, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x56, 0x61, + 0x72, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x09, 0x76, 0x61, 0x72, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x73, 0x22, 0xaf, 0x03, 0x0a, 0x07, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x28, 0x0a, + 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x10, 0x0a, 0x03, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x65, 0x65, + 0x55, 0x73, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x66, 0x65, 0x65, 0x55, + 0x73, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, + 0x65, 0x46, 0x65, 0x65, 0x55, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, + 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x46, 0x65, 0x65, 0x55, 0x73, 0x65, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x24, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x0a, + 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x61, 0x73, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, + 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x02, 0x74, 0x6f, 0x12, 0x24, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x66, 0x65, 0x65, 0x44, + 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x61, 0x73, + 0x55, 0x73, 0x65, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, + 0x73, 0x65, 0x64, 0x22, 0xf1, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, + 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x41, 0x72, 0x67, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x41, 0x72, 0x67, + 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x78, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x78, 0x12, 0x16, 0x0a, + 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, + 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x12, 0x18, 0x0a, + 0x07, 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x20, 0x0a, 0x0a, 0x46, 0x6e, 0x41, 0x72, 0x67, + 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xa4, 0x01, 0x0a, 0x08, 0x46, 0x75, + 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x61, 0x72, + 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x46, 0x6e, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, + 0x61, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, 0x61, + 0x79, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x65, 0x65, + 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0d, 0x66, 0x65, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x44, 0x0a, 0x08, 0x53, 0x74, 0x61, 0x74, 0x65, 0x56, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6c, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x03, 0x6c, 0x65, 0x6e, 0x22, 0xa4, 0x01, 0x0a, 0x03, 0x41, 0x42, 0x49, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x6e, 0x67, + 0x75, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x6e, 0x67, + 0x75, 0x61, 0x67, 0x65, 0x12, 0x2d, 0x0a, 0x09, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x38, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x72, + 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x56, 0x61, 0x72, 0x52, 0x0e, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x22, 0x4f, 0x0a, + 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x1c, 0x0a, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x71, 0x75, 0x65, 0x72, 0x79, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x92, + 0x01, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x28, 0x0a, + 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x4a, 0x04, 0x08, + 0x02, 0x10, 0x03, 0x22, 0xe6, 0x01, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x46, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x72, 0x67, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x43, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x72, 0x65, + 0x63, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6e, 0x74, 0x22, 0x64, 0x0a, 0x08, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0e, 0x6d, 0x75, + 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x43, 0x68, 0x6f, 0x69, + 0x63, 0x65, 0x2a, 0x69, 0x0a, 0x06, 0x54, 0x78, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, + 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x47, 0x4f, 0x56, 0x45, + 0x52, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x44, 0x45, + 0x50, 0x4c, 0x4f, 0x59, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x45, 0x45, 0x44, 0x45, 0x4c, + 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x54, 0x52, 0x41, + 0x4e, 0x53, 0x46, 0x45, 0x52, 0x10, 0x04, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x41, 0x4c, 0x4c, 0x10, + 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x10, 0x06, 0x42, 0x08, 0x5a, + 0x06, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_blockchain_proto_rawDescOnce sync.Once + file_blockchain_proto_rawDescData = file_blockchain_proto_rawDesc +) + +func file_blockchain_proto_rawDescGZIP() []byte { + file_blockchain_proto_rawDescOnce.Do(func() { + file_blockchain_proto_rawDescData = protoimpl.X.CompressGZIP(file_blockchain_proto_rawDescData) + }) + return file_blockchain_proto_rawDescData +} + +var file_blockchain_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_blockchain_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_blockchain_proto_goTypes = []interface{}{ + (TxType)(0), // 0: types.TxType + (*Block)(nil), // 1: types.Block + (*BlockHeader)(nil), // 2: types.BlockHeader + (*BlockBody)(nil), // 3: types.BlockBody + (*TxList)(nil), // 4: types.TxList + (*Tx)(nil), // 5: types.Tx + (*TxBody)(nil), // 6: types.TxBody + (*TxIdx)(nil), // 7: types.TxIdx + (*TxInBlock)(nil), // 8: types.TxInBlock + (*State)(nil), // 9: types.State + (*AccountProof)(nil), // 10: types.AccountProof + (*ContractVarProof)(nil), // 11: types.ContractVarProof + (*StateQueryProof)(nil), // 12: types.StateQueryProof + (*Receipt)(nil), // 13: types.Receipt + (*Event)(nil), // 14: types.Event + (*FnArgument)(nil), // 15: types.FnArgument + (*Function)(nil), // 16: types.Function + (*StateVar)(nil), // 17: types.StateVar + (*ABI)(nil), // 18: types.ABI + (*Query)(nil), // 19: types.Query + (*StateQuery)(nil), // 20: types.StateQuery + (*FilterInfo)(nil), // 21: types.FilterInfo + (*Proposal)(nil), // 22: types.Proposal +} +var file_blockchain_proto_depIdxs = []int32{ + 2, // 0: types.Block.header:type_name -> types.BlockHeader + 3, // 1: types.Block.body:type_name -> types.BlockBody + 5, // 2: types.BlockBody.txs:type_name -> types.Tx + 5, // 3: types.TxList.txs:type_name -> types.Tx + 6, // 4: types.Tx.body:type_name -> types.TxBody + 0, // 5: types.TxBody.type:type_name -> types.TxType + 7, // 6: types.TxInBlock.txIdx:type_name -> types.TxIdx + 5, // 7: types.TxInBlock.tx:type_name -> types.Tx + 9, // 8: types.AccountProof.state:type_name -> types.State + 10, // 9: types.StateQueryProof.contractProof:type_name -> types.AccountProof + 11, // 10: types.StateQueryProof.varProofs:type_name -> types.ContractVarProof + 14, // 11: types.Receipt.events:type_name -> types.Event + 15, // 12: types.Function.arguments:type_name -> types.FnArgument + 16, // 13: types.ABI.functions:type_name -> types.Function + 17, // 14: types.ABI.state_variables:type_name -> types.StateVar + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name +} + +func init() { file_blockchain_proto_init() } +func file_blockchain_proto_init() { + if File_blockchain_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_blockchain_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Block); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Tx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxIdx); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxInBlock); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*State); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContractVarProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateQueryProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Receipt); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Event); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FnArgument); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Function); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateVar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ABI); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Query); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FilterInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_blockchain_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Proposal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_blockchain_proto_rawDesc, + NumEnums: 1, + NumMessages: 22, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_blockchain_proto_goTypes, + DependencyIndexes: file_blockchain_proto_depIdxs, + EnumInfos: file_blockchain_proto_enumTypes, + MessageInfos: file_blockchain_proto_msgTypes, + }.Build() + File_blockchain_proto = out.File + file_blockchain_proto_rawDesc = nil + file_blockchain_proto_goTypes = nil + file_blockchain_proto_depIdxs = nil } diff --git a/types/blockchain_test.go b/types/blockchain_test.go index 3b4f6a0f5..88db63786 100644 --- a/types/blockchain_test.go +++ b/types/blockchain_test.go @@ -26,7 +26,7 @@ func TestBlockHash(t *testing.T) { blockHash := func(block *Block) []byte { header := block.Header digest := sha256.New() - writeBlockHeaderOld(digest, header) + writeBlockHeader(digest, header) return digest.Sum(nil) } diff --git a/types/metric.pb.go b/types/metric.pb.go index 01b7c18c4..6d8ea03f8 100644 --- a/types/metric.pb.go +++ b/types/metric.pb.go @@ -1,22 +1,24 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.15.8 // source: metric.proto package types -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type MetricType int32 @@ -27,192 +29,334 @@ const ( MetricType_P2P_NETWORK MetricType = 1 ) -var MetricType_name = map[int32]string{ - 0: "NOTHING", - 1: "P2P_NETWORK", -} -var MetricType_value = map[string]int32{ - "NOTHING": 0, - "P2P_NETWORK": 1, +// Enum value maps for MetricType. +var ( + MetricType_name = map[int32]string{ + 0: "NOTHING", + 1: "P2P_NETWORK", + } + MetricType_value = map[string]int32{ + "NOTHING": 0, + "P2P_NETWORK": 1, + } +) + +func (x MetricType) Enum() *MetricType { + p := new(MetricType) + *p = x + return p } func (x MetricType) String() string { - return proto.EnumName(MetricType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (MetricType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_metric_7ac9b92acc82ce30, []int{0} + +func (MetricType) Descriptor() protoreflect.EnumDescriptor { + return file_metric_proto_enumTypes[0].Descriptor() } -type MetricsRequest struct { - Types []MetricType `protobuf:"varint,1,rep,packed,name=types,enum=types.MetricType" json:"types,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (MetricType) Type() protoreflect.EnumType { + return &file_metric_proto_enumTypes[0] } -func (m *MetricsRequest) Reset() { *m = MetricsRequest{} } -func (m *MetricsRequest) String() string { return proto.CompactTextString(m) } -func (*MetricsRequest) ProtoMessage() {} -func (*MetricsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_metric_7ac9b92acc82ce30, []int{0} +func (x MetricType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *MetricsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MetricsRequest.Unmarshal(m, b) + +// Deprecated: Use MetricType.Descriptor instead. +func (MetricType) EnumDescriptor() ([]byte, []int) { + return file_metric_proto_rawDescGZIP(), []int{0} } -func (m *MetricsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MetricsRequest.Marshal(b, m, deterministic) + +type MetricsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Types []MetricType `protobuf:"varint,1,rep,packed,name=types,proto3,enum=types.MetricType" json:"types,omitempty"` } -func (dst *MetricsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricsRequest.Merge(dst, src) + +func (x *MetricsRequest) Reset() { + *x = MetricsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_metric_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MetricsRequest) XXX_Size() int { - return xxx_messageInfo_MetricsRequest.Size(m) + +func (x *MetricsRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MetricsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MetricsRequest.DiscardUnknown(m) + +func (*MetricsRequest) ProtoMessage() {} + +func (x *MetricsRequest) ProtoReflect() protoreflect.Message { + mi := &file_metric_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_MetricsRequest proto.InternalMessageInfo +// Deprecated: Use MetricsRequest.ProtoReflect.Descriptor instead. +func (*MetricsRequest) Descriptor() ([]byte, []int) { + return file_metric_proto_rawDescGZIP(), []int{0} +} -func (m *MetricsRequest) GetTypes() []MetricType { - if m != nil { - return m.Types +func (x *MetricsRequest) GetTypes() []MetricType { + if x != nil { + return x.Types } return nil } type Metrics struct { - Peers []*PeerMetric `protobuf:"bytes,1,rep,name=peers" json:"peers,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Metrics) Reset() { *m = Metrics{} } -func (m *Metrics) String() string { return proto.CompactTextString(m) } -func (*Metrics) ProtoMessage() {} -func (*Metrics) Descriptor() ([]byte, []int) { - return fileDescriptor_metric_7ac9b92acc82ce30, []int{1} + Peers []*PeerMetric `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` } -func (m *Metrics) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Metrics.Unmarshal(m, b) -} -func (m *Metrics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Metrics.Marshal(b, m, deterministic) -} -func (dst *Metrics) XXX_Merge(src proto.Message) { - xxx_messageInfo_Metrics.Merge(dst, src) + +func (x *Metrics) Reset() { + *x = Metrics{} + if protoimpl.UnsafeEnabled { + mi := &file_metric_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Metrics) XXX_Size() int { - return xxx_messageInfo_Metrics.Size(m) + +func (x *Metrics) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Metrics) XXX_DiscardUnknown() { - xxx_messageInfo_Metrics.DiscardUnknown(m) + +func (*Metrics) ProtoMessage() {} + +func (x *Metrics) ProtoReflect() protoreflect.Message { + mi := &file_metric_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Metrics proto.InternalMessageInfo +// Deprecated: Use Metrics.ProtoReflect.Descriptor instead. +func (*Metrics) Descriptor() ([]byte, []int) { + return file_metric_proto_rawDescGZIP(), []int{1} +} -func (m *Metrics) GetPeers() []*PeerMetric { - if m != nil { - return m.Peers +func (x *Metrics) GetPeers() []*PeerMetric { + if x != nil { + return x.Peers } return nil } type PeerMetric struct { - PeerID []byte `protobuf:"bytes,1,opt,name=peerID,proto3" json:"peerID,omitempty"` - SumIn int64 `protobuf:"varint,2,opt,name=sumIn" json:"sumIn,omitempty"` - AvrIn int64 `protobuf:"varint,3,opt,name=avrIn" json:"avrIn,omitempty"` - SumOut int64 `protobuf:"varint,4,opt,name=sumOut" json:"sumOut,omitempty"` - AvrOut int64 `protobuf:"varint,5,opt,name=avrOut" json:"avrOut,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PeerMetric) Reset() { *m = PeerMetric{} } -func (m *PeerMetric) String() string { return proto.CompactTextString(m) } -func (*PeerMetric) ProtoMessage() {} -func (*PeerMetric) Descriptor() ([]byte, []int) { - return fileDescriptor_metric_7ac9b92acc82ce30, []int{2} -} -func (m *PeerMetric) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PeerMetric.Unmarshal(m, b) -} -func (m *PeerMetric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PeerMetric.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeerID []byte `protobuf:"bytes,1,opt,name=peerID,proto3" json:"peerID,omitempty"` + SumIn int64 `protobuf:"varint,2,opt,name=sumIn,proto3" json:"sumIn,omitempty"` + AvrIn int64 `protobuf:"varint,3,opt,name=avrIn,proto3" json:"avrIn,omitempty"` + SumOut int64 `protobuf:"varint,4,opt,name=sumOut,proto3" json:"sumOut,omitempty"` + AvrOut int64 `protobuf:"varint,5,opt,name=avrOut,proto3" json:"avrOut,omitempty"` } -func (dst *PeerMetric) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeerMetric.Merge(dst, src) + +func (x *PeerMetric) Reset() { + *x = PeerMetric{} + if protoimpl.UnsafeEnabled { + mi := &file_metric_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PeerMetric) XXX_Size() int { - return xxx_messageInfo_PeerMetric.Size(m) + +func (x *PeerMetric) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PeerMetric) XXX_DiscardUnknown() { - xxx_messageInfo_PeerMetric.DiscardUnknown(m) + +func (*PeerMetric) ProtoMessage() {} + +func (x *PeerMetric) ProtoReflect() protoreflect.Message { + mi := &file_metric_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PeerMetric proto.InternalMessageInfo +// Deprecated: Use PeerMetric.ProtoReflect.Descriptor instead. +func (*PeerMetric) Descriptor() ([]byte, []int) { + return file_metric_proto_rawDescGZIP(), []int{2} +} -func (m *PeerMetric) GetPeerID() []byte { - if m != nil { - return m.PeerID +func (x *PeerMetric) GetPeerID() []byte { + if x != nil { + return x.PeerID } return nil } -func (m *PeerMetric) GetSumIn() int64 { - if m != nil { - return m.SumIn +func (x *PeerMetric) GetSumIn() int64 { + if x != nil { + return x.SumIn } return 0 } -func (m *PeerMetric) GetAvrIn() int64 { - if m != nil { - return m.AvrIn +func (x *PeerMetric) GetAvrIn() int64 { + if x != nil { + return x.AvrIn } return 0 } -func (m *PeerMetric) GetSumOut() int64 { - if m != nil { - return m.SumOut +func (x *PeerMetric) GetSumOut() int64 { + if x != nil { + return x.SumOut } return 0 } -func (m *PeerMetric) GetAvrOut() int64 { - if m != nil { - return m.AvrOut +func (x *PeerMetric) GetAvrOut() int64 { + if x != nil { + return x.AvrOut } return 0 } -func init() { - proto.RegisterType((*MetricsRequest)(nil), "types.MetricsRequest") - proto.RegisterType((*Metrics)(nil), "types.Metrics") - proto.RegisterType((*PeerMetric)(nil), "types.PeerMetric") - proto.RegisterEnum("types.MetricType", MetricType_name, MetricType_value) -} - -func init() { proto.RegisterFile("metric.proto", fileDescriptor_metric_7ac9b92acc82ce30) } - -var fileDescriptor_metric_7ac9b92acc82ce30 = []byte{ - // 226 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0xcf, 0x4b, 0xc3, 0x30, - 0x14, 0x80, 0x8d, 0xb5, 0x1b, 0xbc, 0x8e, 0x39, 0x83, 0x48, 0x8e, 0x65, 0x17, 0xcb, 0x0e, 0x3d, - 0xd4, 0x93, 0x77, 0x45, 0x83, 0xd8, 0x96, 0x50, 0xf0, 0x28, 0x53, 0xde, 0xc1, 0x43, 0xb7, 0x98, - 0x1f, 0x83, 0xde, 0xfc, 0xd3, 0x25, 0x79, 0x61, 0x3d, 0x7e, 0xdf, 0x7b, 0x5f, 0x20, 0x0f, 0x56, - 0x23, 0x3a, 0xf3, 0xf3, 0x5d, 0x6b, 0x73, 0x74, 0x47, 0x9e, 0xbb, 0x49, 0xa3, 0xdd, 0x3e, 0xc2, - 0xfa, 0x3d, 0x6a, 0xab, 0xf0, 0xd7, 0xa3, 0x75, 0xfc, 0x1e, 0x68, 0x24, 0x58, 0x99, 0x55, 0xeb, - 0xe6, 0xa6, 0x8e, 0x54, 0xd3, 0xd6, 0x30, 0x69, 0x54, 0x29, 0x6d, 0x60, 0x99, 0xd2, 0xd0, 0x68, - 0x44, 0x43, 0x4d, 0x71, 0x6e, 0x7a, 0x44, 0x43, 0x2b, 0x8a, 0xe6, 0xdb, 0x3f, 0x06, 0x30, 0x5b, - 0x7e, 0x07, 0x8b, 0xe0, 0xe5, 0x93, 0x60, 0x25, 0xab, 0x56, 0x2a, 0x11, 0xbf, 0x85, 0xdc, 0xfa, - 0x51, 0x1e, 0xc4, 0x65, 0xc9, 0xaa, 0x4c, 0x11, 0x04, 0xbb, 0x3f, 0x19, 0x79, 0x10, 0x19, 0xd9, - 0x08, 0xe1, 0x0d, 0xeb, 0xc7, 0xce, 0x3b, 0x71, 0x15, 0x75, 0xa2, 0xe0, 0xf7, 0x27, 0x13, 0x7c, - 0x4e, 0x9e, 0x68, 0xb7, 0x03, 0x98, 0xff, 0xc2, 0x0b, 0x58, 0xb6, 0xdd, 0xf0, 0x2a, 0xdb, 0x97, - 0xcd, 0x05, 0xbf, 0x86, 0xa2, 0x6f, 0xfa, 0xcf, 0xf6, 0x79, 0xf8, 0xe8, 0xd4, 0xdb, 0x86, 0x7d, - 0x2d, 0xe2, 0xad, 0x1e, 0xfe, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x5e, 0x48, 0xee, 0x3b, 0x01, - 0x00, 0x00, +var File_metric_proto protoreflect.FileDescriptor + +var file_metric_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x39, 0x0a, 0x0e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x22, 0x32, 0x0a, 0x07, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x27, 0x0a, 0x05, 0x70, + 0x65, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x05, 0x70, + 0x65, 0x65, 0x72, 0x73, 0x22, 0x80, 0x01, 0x0a, 0x0a, 0x50, 0x65, 0x65, 0x72, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x75, 0x6d, 0x49, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x75, 0x6d, 0x49, + 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x76, 0x72, 0x49, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x05, 0x61, 0x76, 0x72, 0x49, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x6d, 0x4f, 0x75, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x75, 0x6d, 0x4f, 0x75, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x61, 0x76, 0x72, 0x4f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x61, 0x76, 0x72, 0x4f, 0x75, 0x74, 0x2a, 0x2a, 0x0a, 0x0a, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x4f, 0x54, 0x48, 0x49, 0x4e, 0x47, + 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x32, 0x50, 0x5f, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, + 0x4b, 0x10, 0x01, 0x42, 0x08, 0x5a, 0x06, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_metric_proto_rawDescOnce sync.Once + file_metric_proto_rawDescData = file_metric_proto_rawDesc +) + +func file_metric_proto_rawDescGZIP() []byte { + file_metric_proto_rawDescOnce.Do(func() { + file_metric_proto_rawDescData = protoimpl.X.CompressGZIP(file_metric_proto_rawDescData) + }) + return file_metric_proto_rawDescData +} + +var file_metric_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_metric_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_metric_proto_goTypes = []interface{}{ + (MetricType)(0), // 0: types.MetricType + (*MetricsRequest)(nil), // 1: types.MetricsRequest + (*Metrics)(nil), // 2: types.Metrics + (*PeerMetric)(nil), // 3: types.PeerMetric +} +var file_metric_proto_depIdxs = []int32{ + 0, // 0: types.MetricsRequest.types:type_name -> types.MetricType + 3, // 1: types.Metrics.peers:type_name -> types.PeerMetric + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_metric_proto_init() } +func file_metric_proto_init() { + if File_metric_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_metric_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetricsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metric_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metrics); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_metric_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerMetric); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_metric_proto_rawDesc, + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_metric_proto_goTypes, + DependencyIndexes: file_metric_proto_depIdxs, + EnumInfos: file_metric_proto_enumTypes, + MessageInfos: file_metric_proto_msgTypes, + }.Build() + File_metric_proto = out.File + file_metric_proto_rawDesc = nil + file_metric_proto_goTypes = nil + file_metric_proto_depIdxs = nil } diff --git a/types/node.pb.go b/types/node.pb.go index eeaf21a20..b7516ae53 100644 --- a/types/node.pb.go +++ b/types/node.pb.go @@ -1,22 +1,24 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.15.8 // source: node.proto package types -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type PeerRole int32 @@ -27,243 +29,371 @@ const ( PeerRole_Agent PeerRole = 3 ) -var PeerRole_name = map[int32]string{ - 0: "LegacyVersion", - 1: "Producer", - 2: "Watcher", - 3: "Agent", -} -var PeerRole_value = map[string]int32{ - "LegacyVersion": 0, - "Producer": 1, - "Watcher": 2, - "Agent": 3, +// Enum value maps for PeerRole. +var ( + PeerRole_name = map[int32]string{ + 0: "LegacyVersion", + 1: "Producer", + 2: "Watcher", + 3: "Agent", + } + PeerRole_value = map[string]int32{ + "LegacyVersion": 0, + "Producer": 1, + "Watcher": 2, + "Agent": 3, + } +) + +func (x PeerRole) Enum() *PeerRole { + p := new(PeerRole) + *p = x + return p } func (x PeerRole) String() string { - return proto.EnumName(PeerRole_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PeerRole) Descriptor() protoreflect.EnumDescriptor { + return file_node_proto_enumTypes[0].Descriptor() } + +func (PeerRole) Type() protoreflect.EnumType { + return &file_node_proto_enumTypes[0] +} + +func (x PeerRole) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PeerRole.Descriptor instead. func (PeerRole) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_node_2c4eb40676311241, []int{0} + return file_node_proto_rawDescGZIP(), []int{0} } // PeerAddress contains static information of peer and addresses to connect peer type PeerAddress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // @Deprecated advertised address and port will be in addresses field in aergo v2. // address is string representation of ip address or domain name. - Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // @Deprecated - Port uint32 `protobuf:"varint,2,opt,name=port" json:"port,omitempty"` - PeerID []byte `protobuf:"bytes,3,opt,name=peerID,proto3" json:"peerID,omitempty"` - Role PeerRole `protobuf:"varint,4,opt,name=role,enum=types.PeerRole" json:"role,omitempty"` - Version string `protobuf:"bytes,5,opt,name=version" json:"version,omitempty"` - Addresses []string `protobuf:"bytes,6,rep,name=addresses" json:"addresses,omitempty"` - ProducerIDs [][]byte `protobuf:"bytes,7,rep,name=producerIDs,proto3" json:"producerIDs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PeerAddress) Reset() { *m = PeerAddress{} } -func (m *PeerAddress) String() string { return proto.CompactTextString(m) } -func (*PeerAddress) ProtoMessage() {} -func (*PeerAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_node_2c4eb40676311241, []int{0} -} -func (m *PeerAddress) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PeerAddress.Unmarshal(m, b) -} -func (m *PeerAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PeerAddress.Marshal(b, m, deterministic) -} -func (dst *PeerAddress) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeerAddress.Merge(dst, src) + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + PeerID []byte `protobuf:"bytes,3,opt,name=peerID,proto3" json:"peerID,omitempty"` + Role PeerRole `protobuf:"varint,4,opt,name=role,proto3,enum=types.PeerRole" json:"role,omitempty"` + Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` + Addresses []string `protobuf:"bytes,6,rep,name=addresses,proto3" json:"addresses,omitempty"` + ProducerIDs [][]byte `protobuf:"bytes,7,rep,name=producerIDs,proto3" json:"producerIDs,omitempty"` +} + +func (x *PeerAddress) Reset() { + *x = PeerAddress{} + if protoimpl.UnsafeEnabled { + mi := &file_node_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PeerAddress) XXX_Size() int { - return xxx_messageInfo_PeerAddress.Size(m) + +func (x *PeerAddress) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PeerAddress) XXX_DiscardUnknown() { - xxx_messageInfo_PeerAddress.DiscardUnknown(m) + +func (*PeerAddress) ProtoMessage() {} + +func (x *PeerAddress) ProtoReflect() protoreflect.Message { + mi := &file_node_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PeerAddress proto.InternalMessageInfo +// Deprecated: Use PeerAddress.ProtoReflect.Descriptor instead. +func (*PeerAddress) Descriptor() ([]byte, []int) { + return file_node_proto_rawDescGZIP(), []int{0} +} -func (m *PeerAddress) GetAddress() string { - if m != nil { - return m.Address +func (x *PeerAddress) GetAddress() string { + if x != nil { + return x.Address } return "" } -func (m *PeerAddress) GetPort() uint32 { - if m != nil { - return m.Port +func (x *PeerAddress) GetPort() uint32 { + if x != nil { + return x.Port } return 0 } -func (m *PeerAddress) GetPeerID() []byte { - if m != nil { - return m.PeerID +func (x *PeerAddress) GetPeerID() []byte { + if x != nil { + return x.PeerID } return nil } -func (m *PeerAddress) GetRole() PeerRole { - if m != nil { - return m.Role +func (x *PeerAddress) GetRole() PeerRole { + if x != nil { + return x.Role } return PeerRole_LegacyVersion } -func (m *PeerAddress) GetVersion() string { - if m != nil { - return m.Version +func (x *PeerAddress) GetVersion() string { + if x != nil { + return x.Version } return "" } -func (m *PeerAddress) GetAddresses() []string { - if m != nil { - return m.Addresses +func (x *PeerAddress) GetAddresses() []string { + if x != nil { + return x.Addresses } return nil } -func (m *PeerAddress) GetProducerIDs() [][]byte { - if m != nil { - return m.ProducerIDs +func (x *PeerAddress) GetProducerIDs() [][]byte { + if x != nil { + return x.ProducerIDs } return nil } type AgentCertificate struct { - CertVersion uint32 `protobuf:"varint,1,opt,name=certVersion" json:"certVersion,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CertVersion uint32 `protobuf:"varint,1,opt,name=certVersion,proto3" json:"certVersion,omitempty"` BPID []byte `protobuf:"bytes,2,opt,name=BPID,proto3" json:"BPID,omitempty"` BPPubKey []byte `protobuf:"bytes,3,opt,name=BPPubKey,proto3" json:"BPPubKey,omitempty"` // CreateTime is the number of nanoseconds elapsed since January 1, 1970 UTC - CreateTime int64 `protobuf:"varint,4,opt,name=createTime" json:"createTime,omitempty"` + CreateTime int64 `protobuf:"varint,4,opt,name=createTime,proto3" json:"createTime,omitempty"` // CreateTime is the number of nanoseconds elapsed since January 1, 1970 UTC - ExpireTime int64 `protobuf:"varint,5,opt,name=expireTime" json:"expireTime,omitempty"` - AgentID []byte `protobuf:"bytes,6,opt,name=agentID,proto3" json:"agentID,omitempty"` - AgentAddress [][]byte `protobuf:"bytes,7,rep,name=AgentAddress,proto3" json:"AgentAddress,omitempty"` - Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AgentCertificate) Reset() { *m = AgentCertificate{} } -func (m *AgentCertificate) String() string { return proto.CompactTextString(m) } -func (*AgentCertificate) ProtoMessage() {} -func (*AgentCertificate) Descriptor() ([]byte, []int) { - return fileDescriptor_node_2c4eb40676311241, []int{1} -} -func (m *AgentCertificate) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AgentCertificate.Unmarshal(m, b) -} -func (m *AgentCertificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AgentCertificate.Marshal(b, m, deterministic) -} -func (dst *AgentCertificate) XXX_Merge(src proto.Message) { - xxx_messageInfo_AgentCertificate.Merge(dst, src) + ExpireTime int64 `protobuf:"varint,5,opt,name=expireTime,proto3" json:"expireTime,omitempty"` + AgentID []byte `protobuf:"bytes,6,opt,name=agentID,proto3" json:"agentID,omitempty"` + AgentAddress [][]byte `protobuf:"bytes,7,rep,name=AgentAddress,proto3" json:"AgentAddress,omitempty"` + Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *AgentCertificate) Reset() { + *x = AgentCertificate{} + if protoimpl.UnsafeEnabled { + mi := &file_node_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AgentCertificate) XXX_Size() int { - return xxx_messageInfo_AgentCertificate.Size(m) + +func (x *AgentCertificate) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AgentCertificate) XXX_DiscardUnknown() { - xxx_messageInfo_AgentCertificate.DiscardUnknown(m) + +func (*AgentCertificate) ProtoMessage() {} + +func (x *AgentCertificate) ProtoReflect() protoreflect.Message { + mi := &file_node_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AgentCertificate proto.InternalMessageInfo +// Deprecated: Use AgentCertificate.ProtoReflect.Descriptor instead. +func (*AgentCertificate) Descriptor() ([]byte, []int) { + return file_node_proto_rawDescGZIP(), []int{1} +} -func (m *AgentCertificate) GetCertVersion() uint32 { - if m != nil { - return m.CertVersion +func (x *AgentCertificate) GetCertVersion() uint32 { + if x != nil { + return x.CertVersion } return 0 } -func (m *AgentCertificate) GetBPID() []byte { - if m != nil { - return m.BPID +func (x *AgentCertificate) GetBPID() []byte { + if x != nil { + return x.BPID } return nil } -func (m *AgentCertificate) GetBPPubKey() []byte { - if m != nil { - return m.BPPubKey +func (x *AgentCertificate) GetBPPubKey() []byte { + if x != nil { + return x.BPPubKey } return nil } -func (m *AgentCertificate) GetCreateTime() int64 { - if m != nil { - return m.CreateTime +func (x *AgentCertificate) GetCreateTime() int64 { + if x != nil { + return x.CreateTime } return 0 } -func (m *AgentCertificate) GetExpireTime() int64 { - if m != nil { - return m.ExpireTime +func (x *AgentCertificate) GetExpireTime() int64 { + if x != nil { + return x.ExpireTime } return 0 } -func (m *AgentCertificate) GetAgentID() []byte { - if m != nil { - return m.AgentID +func (x *AgentCertificate) GetAgentID() []byte { + if x != nil { + return x.AgentID } return nil } -func (m *AgentCertificate) GetAgentAddress() [][]byte { - if m != nil { - return m.AgentAddress +func (x *AgentCertificate) GetAgentAddress() [][]byte { + if x != nil { + return x.AgentAddress } return nil } -func (m *AgentCertificate) GetSignature() []byte { - if m != nil { - return m.Signature +func (x *AgentCertificate) GetSignature() []byte { + if x != nil { + return x.Signature } return nil } -func init() { - proto.RegisterType((*PeerAddress)(nil), "types.PeerAddress") - proto.RegisterType((*AgentCertificate)(nil), "types.AgentCertificate") - proto.RegisterEnum("types.PeerRole", PeerRole_name, PeerRole_value) -} - -func init() { proto.RegisterFile("node.proto", fileDescriptor_node_2c4eb40676311241) } - -var fileDescriptor_node_2c4eb40676311241 = []byte{ - // 356 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0x4f, 0x4f, 0xe3, 0x30, - 0x10, 0xc5, 0xd7, 0x4d, 0x93, 0x26, 0xd3, 0x74, 0x37, 0x3b, 0x87, 0x95, 0xb5, 0x42, 0x28, 0x2a, - 0x97, 0x88, 0x43, 0x0f, 0xf0, 0x09, 0xfa, 0xe7, 0x52, 0xc1, 0x21, 0xb2, 0x10, 0x9c, 0xd3, 0x64, - 0x28, 0x91, 0x4a, 0x1c, 0x39, 0x2e, 0xa2, 0x37, 0x3e, 0x23, 0x9f, 0x08, 0xd9, 0x71, 0x69, 0xb9, - 0xcd, 0x7b, 0x23, 0xe7, 0xe7, 0xf7, 0x62, 0x80, 0x46, 0x56, 0x34, 0x6b, 0x95, 0xd4, 0x12, 0x7d, - 0x7d, 0x68, 0xa9, 0x9b, 0x7e, 0x32, 0x18, 0xe7, 0x44, 0x6a, 0x5e, 0x55, 0x8a, 0xba, 0x0e, 0x39, - 0x8c, 0x8a, 0x7e, 0xe4, 0x2c, 0x65, 0x59, 0x24, 0x8e, 0x12, 0x11, 0x86, 0xad, 0x54, 0x9a, 0x0f, - 0x52, 0x96, 0x4d, 0x84, 0x9d, 0xf1, 0x1f, 0x04, 0x2d, 0x91, 0x5a, 0xaf, 0xb8, 0x97, 0xb2, 0x2c, - 0x16, 0x4e, 0xe1, 0x15, 0x0c, 0x95, 0xdc, 0x11, 0x1f, 0xa6, 0x2c, 0xfb, 0x7d, 0xf3, 0x67, 0x66, - 0x59, 0x33, 0xc3, 0x11, 0x72, 0x47, 0xc2, 0x2e, 0x0d, 0xea, 0x8d, 0x54, 0x57, 0xcb, 0x86, 0xfb, - 0x3d, 0xca, 0x49, 0xbc, 0x80, 0xc8, 0x51, 0xa9, 0xe3, 0x41, 0xea, 0x65, 0x91, 0x38, 0x19, 0x98, - 0xc2, 0xb8, 0x55, 0xb2, 0xda, 0x97, 0x06, 0xd5, 0xf1, 0x51, 0xea, 0x65, 0xb1, 0x38, 0xb7, 0xa6, - 0x1f, 0x03, 0x48, 0xe6, 0x5b, 0x6a, 0xf4, 0x92, 0x94, 0xae, 0x9f, 0xeb, 0xb2, 0xd0, 0x64, 0x8e, - 0x95, 0xa4, 0xf4, 0xa3, 0x43, 0x32, 0x1b, 0xe3, 0xdc, 0x32, 0x09, 0x17, 0xf9, 0x7a, 0x65, 0x13, - 0xc6, 0xc2, 0xce, 0xf8, 0x1f, 0xc2, 0x45, 0x9e, 0xef, 0x37, 0x77, 0x74, 0x70, 0x19, 0xbf, 0x35, - 0x5e, 0x02, 0x94, 0x8a, 0x0a, 0x4d, 0x0f, 0xf5, 0x6b, 0x9f, 0xd5, 0x13, 0x67, 0x8e, 0xd9, 0xd3, - 0x7b, 0x5b, 0xab, 0x7e, 0xef, 0xf7, 0xfb, 0x93, 0x63, 0xbb, 0x36, 0xb7, 0x5c, 0xaf, 0x78, 0x60, - 0x3f, 0x7d, 0x94, 0x38, 0x85, 0xd8, 0xde, 0xdf, 0xfd, 0x15, 0x97, 0xf1, 0x87, 0x67, 0x4a, 0xea, - 0xea, 0x6d, 0x53, 0xe8, 0xbd, 0x22, 0x1e, 0xda, 0xf3, 0x27, 0xe3, 0x7a, 0x09, 0xe1, 0xb1, 0x6e, - 0xfc, 0x0b, 0x93, 0x7b, 0xda, 0x16, 0xe5, 0xc1, 0x05, 0x4d, 0x7e, 0x61, 0x0c, 0x61, 0xee, 0x0a, - 0x4b, 0x18, 0x8e, 0x61, 0xf4, 0x54, 0xe8, 0xf2, 0x85, 0x54, 0x32, 0xc0, 0x08, 0x7c, 0xcb, 0x49, - 0xbc, 0x4d, 0x60, 0x9f, 0xca, 0xed, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe2, 0xb6, 0x20, 0x9b, - 0x38, 0x02, 0x00, 0x00, +var File_node_proto protoreflect.FileDescriptor + +var file_node_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x22, 0xd2, 0x01, 0x0a, 0x0b, 0x50, 0x65, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x44, 0x12, 0x23, 0x0a, 0x04, 0x72, 0x6f, 0x6c, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x50, 0x65, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, + 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0b, 0x70, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x80, 0x02, 0x0a, 0x10, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x63, 0x65, 0x72, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x12, 0x0a, 0x04, 0x42, 0x50, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x42, + 0x50, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x42, 0x50, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x42, 0x50, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, + 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x1e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x0c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2a, 0x43, 0x0a, 0x08, 0x50, + 0x65, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x65, 0x67, 0x61, 0x63, + 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x61, 0x74, 0x63, + 0x68, 0x65, 0x72, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x10, 0x03, + 0x42, 0x08, 0x5a, 0x06, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_node_proto_rawDescOnce sync.Once + file_node_proto_rawDescData = file_node_proto_rawDesc +) + +func file_node_proto_rawDescGZIP() []byte { + file_node_proto_rawDescOnce.Do(func() { + file_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_node_proto_rawDescData) + }) + return file_node_proto_rawDescData +} + +var file_node_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_node_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_node_proto_goTypes = []interface{}{ + (PeerRole)(0), // 0: types.PeerRole + (*PeerAddress)(nil), // 1: types.PeerAddress + (*AgentCertificate)(nil), // 2: types.AgentCertificate +} +var file_node_proto_depIdxs = []int32{ + 0, // 0: types.PeerAddress.role:type_name -> types.PeerRole + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_node_proto_init() } +func file_node_proto_init() { + if File_node_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerAddress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_node_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AgentCertificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_node_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_node_proto_goTypes, + DependencyIndexes: file_node_proto_depIdxs, + EnumInfos: file_node_proto_enumTypes, + MessageInfos: file_node_proto_msgTypes, + }.Build() + File_node_proto = out.File + file_node_proto_rawDesc = nil + file_node_proto_goTypes = nil + file_node_proto_depIdxs = nil } diff --git a/types/p2p.pb.go b/types/p2p.pb.go index ba38ff4aa..5992f6f62 100644 --- a/types/p2p.pb.go +++ b/types/p2p.pb.go @@ -1,22 +1,24 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.15.8 // source: p2p.proto package types -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // Not all response contains ResultStatus value. // names from gRPC status @@ -39,13 +41,10 @@ const ( ResultStatus_ALREADY_EXISTS ResultStatus = 6 // PERMISSION_DENIED ResultStatus_PERMISSION_DENIED ResultStatus = 7 - // ResultStatus_RESOURCE_EXHAUSTED ResultStatus = 8 - // ResultStatus_FAILED_PRECONDITION ResultStatus = 9 // ABORTED ResultStatus_ABORTED ResultStatus = 10 - // ResultStatus_OUT_OF_RANGE ResultStatus = 11 // UNIMPLEMENTED indicates operation is not implemented or not // supported/enabled in this service. @@ -67,63 +66,90 @@ const ( ResultStatus_UNAUTHENTICATED ResultStatus = 16 ) -var ResultStatus_name = map[int32]string{ - 0: "OK", - 1: "CANCELED", - 2: "UNKNOWN", - 3: "INVALID_ARGUMENT", - 4: "DEADLINE_EXCEEDED", - 5: "NOT_FOUND", - 6: "ALREADY_EXISTS", - 7: "PERMISSION_DENIED", - 8: "RESOURCE_EXHAUSTED", - 9: "FAILED_PRECONDITION", - 10: "ABORTED", - 11: "OUT_OF_RANGE", - 12: "UNIMPLEMENTED", - 13: "INTERNAL", - 14: "UNAVAILABLE", - 15: "DATA_LOSS", - 16: "UNAUTHENTICATED", -} -var ResultStatus_value = map[string]int32{ - "OK": 0, - "CANCELED": 1, - "UNKNOWN": 2, - "INVALID_ARGUMENT": 3, - "DEADLINE_EXCEEDED": 4, - "NOT_FOUND": 5, - "ALREADY_EXISTS": 6, - "PERMISSION_DENIED": 7, - "RESOURCE_EXHAUSTED": 8, - "FAILED_PRECONDITION": 9, - "ABORTED": 10, - "OUT_OF_RANGE": 11, - "UNIMPLEMENTED": 12, - "INTERNAL": 13, - "UNAVAILABLE": 14, - "DATA_LOSS": 15, - "UNAUTHENTICATED": 16, +// Enum value maps for ResultStatus. +var ( + ResultStatus_name = map[int32]string{ + 0: "OK", + 1: "CANCELED", + 2: "UNKNOWN", + 3: "INVALID_ARGUMENT", + 4: "DEADLINE_EXCEEDED", + 5: "NOT_FOUND", + 6: "ALREADY_EXISTS", + 7: "PERMISSION_DENIED", + 8: "RESOURCE_EXHAUSTED", + 9: "FAILED_PRECONDITION", + 10: "ABORTED", + 11: "OUT_OF_RANGE", + 12: "UNIMPLEMENTED", + 13: "INTERNAL", + 14: "UNAVAILABLE", + 15: "DATA_LOSS", + 16: "UNAUTHENTICATED", + } + ResultStatus_value = map[string]int32{ + "OK": 0, + "CANCELED": 1, + "UNKNOWN": 2, + "INVALID_ARGUMENT": 3, + "DEADLINE_EXCEEDED": 4, + "NOT_FOUND": 5, + "ALREADY_EXISTS": 6, + "PERMISSION_DENIED": 7, + "RESOURCE_EXHAUSTED": 8, + "FAILED_PRECONDITION": 9, + "ABORTED": 10, + "OUT_OF_RANGE": 11, + "UNIMPLEMENTED": 12, + "INTERNAL": 13, + "UNAVAILABLE": 14, + "DATA_LOSS": 15, + "UNAUTHENTICATED": 16, + } +) + +func (x ResultStatus) Enum() *ResultStatus { + p := new(ResultStatus) + *p = x + return p } func (x ResultStatus) String() string { - return proto.EnumName(ResultStatus_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ResultStatus) Descriptor() protoreflect.EnumDescriptor { + return file_p2p_proto_enumTypes[0].Descriptor() +} + +func (ResultStatus) Type() protoreflect.EnumType { + return &file_p2p_proto_enumTypes[0] } + +func (x ResultStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ResultStatus.Descriptor instead. func (ResultStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{0} + return file_p2p_proto_rawDescGZIP(), []int{0} } // MsgHeader contains common properties of all p2p messages type MsgHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Deprecated client version. - ClientVersion string `protobuf:"bytes,1,opt,name=clientVersion" json:"clientVersion,omitempty"` + ClientVersion string `protobuf:"bytes,1,opt,name=clientVersion,proto3" json:"clientVersion,omitempty"` // unix time - Timestamp int64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` + Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // allows requesters to use request data when processing a response - Id string `protobuf:"bytes,3,opt,name=id" json:"id,omitempty"` + Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` // Gossip is flag to have receiver peer gossip the message to neighbors // Deprecated whether to gossip other peers is determined by subprotocol since version 0.3.0 . - Gossip bool `protobuf:"varint,4,opt,name=gossip" json:"gossip,omitempty"` + Gossip bool `protobuf:"varint,4,opt,name=gossip,proto3" json:"gossip,omitempty"` // PeerID is id of node that created the message (not the peer that may have sent it). =base58(mh(sha256(nodePubKey))) PeerID []byte `protobuf:"bytes,5,opt,name=peerID,proto3" json:"peerID,omitempty"` // nodePubKey Authoring node Secp256k1 public key (32bytes) - protobufs serielized @@ -131,477 +157,545 @@ type MsgHeader struct { // signature of message data + method specific data by message authoring node. format: string([]bytes) Sign []byte `protobuf:"bytes,7,opt,name=sign,proto3" json:"sign,omitempty"` // sub category of message. the receiving peer determines how to deserialize payload data and whether to spread messages to other peers - Subprotocol uint32 `protobuf:"varint,8,opt,name=subprotocol" json:"subprotocol,omitempty"` + Subprotocol uint32 `protobuf:"varint,8,opt,name=subprotocol,proto3" json:"subprotocol,omitempty"` // size of bytes of the payload - Length uint32 `protobuf:"varint,9,opt,name=length" json:"length,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Length uint32 `protobuf:"varint,9,opt,name=length,proto3" json:"length,omitempty"` } -func (m *MsgHeader) Reset() { *m = MsgHeader{} } -func (m *MsgHeader) String() string { return proto.CompactTextString(m) } -func (*MsgHeader) ProtoMessage() {} -func (*MsgHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{0} -} -func (m *MsgHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MsgHeader.Unmarshal(m, b) -} -func (m *MsgHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MsgHeader.Marshal(b, m, deterministic) -} -func (dst *MsgHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgHeader.Merge(dst, src) +func (x *MsgHeader) Reset() { + *x = MsgHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MsgHeader) XXX_Size() int { - return xxx_messageInfo_MsgHeader.Size(m) + +func (x *MsgHeader) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MsgHeader) XXX_DiscardUnknown() { - xxx_messageInfo_MsgHeader.DiscardUnknown(m) + +func (*MsgHeader) ProtoMessage() {} + +func (x *MsgHeader) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_MsgHeader proto.InternalMessageInfo +// Deprecated: Use MsgHeader.ProtoReflect.Descriptor instead. +func (*MsgHeader) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{0} +} -func (m *MsgHeader) GetClientVersion() string { - if m != nil { - return m.ClientVersion +func (x *MsgHeader) GetClientVersion() string { + if x != nil { + return x.ClientVersion } return "" } -func (m *MsgHeader) GetTimestamp() int64 { - if m != nil { - return m.Timestamp +func (x *MsgHeader) GetTimestamp() int64 { + if x != nil { + return x.Timestamp } return 0 } -func (m *MsgHeader) GetId() string { - if m != nil { - return m.Id +func (x *MsgHeader) GetId() string { + if x != nil { + return x.Id } return "" } -func (m *MsgHeader) GetGossip() bool { - if m != nil { - return m.Gossip +func (x *MsgHeader) GetGossip() bool { + if x != nil { + return x.Gossip } return false } -func (m *MsgHeader) GetPeerID() []byte { - if m != nil { - return m.PeerID +func (x *MsgHeader) GetPeerID() []byte { + if x != nil { + return x.PeerID } return nil } -func (m *MsgHeader) GetNodePubKey() []byte { - if m != nil { - return m.NodePubKey +func (x *MsgHeader) GetNodePubKey() []byte { + if x != nil { + return x.NodePubKey } return nil } -func (m *MsgHeader) GetSign() []byte { - if m != nil { - return m.Sign +func (x *MsgHeader) GetSign() []byte { + if x != nil { + return x.Sign } return nil } -func (m *MsgHeader) GetSubprotocol() uint32 { - if m != nil { - return m.Subprotocol +func (x *MsgHeader) GetSubprotocol() uint32 { + if x != nil { + return x.Subprotocol } return 0 } -func (m *MsgHeader) GetLength() uint32 { - if m != nil { - return m.Length +func (x *MsgHeader) GetLength() uint32 { + if x != nil { + return x.Length } return 0 } // Deprecated P2PMessage is data structure for aergo v0.2 or earlier. This structure is not used anymore since v0.3.0. type P2PMessage struct { - Header *MsgHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *P2PMessage) Reset() { *m = P2PMessage{} } -func (m *P2PMessage) String() string { return proto.CompactTextString(m) } -func (*P2PMessage) ProtoMessage() {} -func (*P2PMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{1} -} -func (m *P2PMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_P2PMessage.Unmarshal(m, b) -} -func (m *P2PMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_P2PMessage.Marshal(b, m, deterministic) + Header *MsgHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` } -func (dst *P2PMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_P2PMessage.Merge(dst, src) + +func (x *P2PMessage) Reset() { + *x = P2PMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *P2PMessage) XXX_Size() int { - return xxx_messageInfo_P2PMessage.Size(m) + +func (x *P2PMessage) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *P2PMessage) XXX_DiscardUnknown() { - xxx_messageInfo_P2PMessage.DiscardUnknown(m) + +func (*P2PMessage) ProtoMessage() {} + +func (x *P2PMessage) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_P2PMessage proto.InternalMessageInfo +// Deprecated: Use P2PMessage.ProtoReflect.Descriptor instead. +func (*P2PMessage) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{1} +} -func (m *P2PMessage) GetHeader() *MsgHeader { - if m != nil { - return m.Header +func (x *P2PMessage) GetHeader() *MsgHeader { + if x != nil { + return x.Header } return nil } -func (m *P2PMessage) GetData() []byte { - if m != nil { - return m.Data +func (x *P2PMessage) GetData() []byte { + if x != nil { + return x.Data } return nil } // Ping request message type Ping struct { - BestBlockHash []byte `protobuf:"bytes,1,opt,name=best_block_hash,json=bestBlockHash,proto3" json:"best_block_hash,omitempty"` - BestHeight uint64 `protobuf:"varint,2,opt,name=best_height,json=bestHeight" json:"best_height,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Ping) Reset() { *m = Ping{} } -func (m *Ping) String() string { return proto.CompactTextString(m) } -func (*Ping) ProtoMessage() {} -func (*Ping) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{2} -} -func (m *Ping) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Ping.Unmarshal(m, b) + BestBlockHash []byte `protobuf:"bytes,1,opt,name=best_block_hash,json=bestBlockHash,proto3" json:"best_block_hash,omitempty"` + BestHeight uint64 `protobuf:"varint,2,opt,name=best_height,json=bestHeight,proto3" json:"best_height,omitempty"` } -func (m *Ping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Ping.Marshal(b, m, deterministic) -} -func (dst *Ping) XXX_Merge(src proto.Message) { - xxx_messageInfo_Ping.Merge(dst, src) + +func (x *Ping) Reset() { + *x = Ping{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Ping) XXX_Size() int { - return xxx_messageInfo_Ping.Size(m) + +func (x *Ping) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Ping) XXX_DiscardUnknown() { - xxx_messageInfo_Ping.DiscardUnknown(m) + +func (*Ping) ProtoMessage() {} + +func (x *Ping) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Ping proto.InternalMessageInfo +// Deprecated: Use Ping.ProtoReflect.Descriptor instead. +func (*Ping) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{2} +} -func (m *Ping) GetBestBlockHash() []byte { - if m != nil { - return m.BestBlockHash +func (x *Ping) GetBestBlockHash() []byte { + if x != nil { + return x.BestBlockHash } return nil } -func (m *Ping) GetBestHeight() uint64 { - if m != nil { - return m.BestHeight +func (x *Ping) GetBestHeight() uint64 { + if x != nil { + return x.BestHeight } return 0 } // Ping response message type Pong struct { - BestBlockHash []byte `protobuf:"bytes,1,opt,name=bestBlockHash,proto3" json:"bestBlockHash,omitempty"` - BestHeight uint64 `protobuf:"varint,2,opt,name=bestHeight" json:"bestHeight,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Pong) Reset() { *m = Pong{} } -func (m *Pong) String() string { return proto.CompactTextString(m) } -func (*Pong) ProtoMessage() {} -func (*Pong) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{3} + BestBlockHash []byte `protobuf:"bytes,1,opt,name=bestBlockHash,proto3" json:"bestBlockHash,omitempty"` + BestHeight uint64 `protobuf:"varint,2,opt,name=bestHeight,proto3" json:"bestHeight,omitempty"` } -func (m *Pong) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Pong.Unmarshal(m, b) -} -func (m *Pong) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Pong.Marshal(b, m, deterministic) -} -func (dst *Pong) XXX_Merge(src proto.Message) { - xxx_messageInfo_Pong.Merge(dst, src) + +func (x *Pong) Reset() { + *x = Pong{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Pong) XXX_Size() int { - return xxx_messageInfo_Pong.Size(m) + +func (x *Pong) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Pong) XXX_DiscardUnknown() { - xxx_messageInfo_Pong.DiscardUnknown(m) + +func (*Pong) ProtoMessage() {} + +func (x *Pong) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Pong proto.InternalMessageInfo +// Deprecated: Use Pong.ProtoReflect.Descriptor instead. +func (*Pong) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{3} +} -func (m *Pong) GetBestBlockHash() []byte { - if m != nil { - return m.BestBlockHash +func (x *Pong) GetBestBlockHash() []byte { + if x != nil { + return x.BestBlockHash } return nil } -func (m *Pong) GetBestHeight() uint64 { - if m != nil { - return m.BestHeight +func (x *Pong) GetBestHeight() uint64 { + if x != nil { + return x.BestHeight } return 0 } // Status is peer status exchanged during handshake. type Status struct { - Sender *PeerAddress `protobuf:"bytes,1,opt,name=sender" json:"sender,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sender *PeerAddress `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` BestBlockHash []byte `protobuf:"bytes,2,opt,name=bestBlockHash,proto3" json:"bestBlockHash,omitempty"` - BestHeight uint64 `protobuf:"varint,3,opt,name=bestHeight" json:"bestHeight,omitempty"` + BestHeight uint64 `protobuf:"varint,3,opt,name=bestHeight,proto3" json:"bestHeight,omitempty"` ChainID []byte `protobuf:"bytes,4,opt,name=chainID,proto3" json:"chainID,omitempty"` // noExpose means that peer doesn't want to be known to other peers. - NoExpose bool `protobuf:"varint,5,opt,name=noExpose" json:"noExpose,omitempty"` + NoExpose bool `protobuf:"varint,5,opt,name=noExpose,proto3" json:"noExpose,omitempty"` // @Deprecated version is used in PeerAddress since aergo v2. // version of server binary. - Version string `protobuf:"bytes,6,opt,name=version" json:"version,omitempty"` + Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"` // hash of genesis block Genesis []byte `protobuf:"bytes,7,opt,name=genesis,proto3" json:"genesis,omitempty"` - Certificates []*AgentCertificate `protobuf:"bytes,8,rep,name=certificates" json:"certificates,omitempty"` + Certificates []*AgentCertificate `protobuf:"bytes,8,rep,name=certificates,proto3" json:"certificates,omitempty"` // request to issue agent certificates - IssueCertificate bool `protobuf:"varint,9,opt,name=issueCertificate" json:"issueCertificate,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + IssueCertificate bool `protobuf:"varint,9,opt,name=issueCertificate,proto3" json:"issueCertificate,omitempty"` } -func (m *Status) Reset() { *m = Status{} } -func (m *Status) String() string { return proto.CompactTextString(m) } -func (*Status) ProtoMessage() {} -func (*Status) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{4} -} -func (m *Status) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Status.Unmarshal(m, b) -} -func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Status.Marshal(b, m, deterministic) -} -func (dst *Status) XXX_Merge(src proto.Message) { - xxx_messageInfo_Status.Merge(dst, src) +func (x *Status) Reset() { + *x = Status{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Status) XXX_Size() int { - return xxx_messageInfo_Status.Size(m) + +func (x *Status) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Status) XXX_DiscardUnknown() { - xxx_messageInfo_Status.DiscardUnknown(m) + +func (*Status) ProtoMessage() {} + +func (x *Status) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Status proto.InternalMessageInfo +// Deprecated: Use Status.ProtoReflect.Descriptor instead. +func (*Status) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{4} +} -func (m *Status) GetSender() *PeerAddress { - if m != nil { - return m.Sender +func (x *Status) GetSender() *PeerAddress { + if x != nil { + return x.Sender } return nil } -func (m *Status) GetBestBlockHash() []byte { - if m != nil { - return m.BestBlockHash +func (x *Status) GetBestBlockHash() []byte { + if x != nil { + return x.BestBlockHash } return nil } -func (m *Status) GetBestHeight() uint64 { - if m != nil { - return m.BestHeight +func (x *Status) GetBestHeight() uint64 { + if x != nil { + return x.BestHeight } return 0 } -func (m *Status) GetChainID() []byte { - if m != nil { - return m.ChainID +func (x *Status) GetChainID() []byte { + if x != nil { + return x.ChainID } return nil } -func (m *Status) GetNoExpose() bool { - if m != nil { - return m.NoExpose +func (x *Status) GetNoExpose() bool { + if x != nil { + return x.NoExpose } return false } -func (m *Status) GetVersion() string { - if m != nil { - return m.Version +func (x *Status) GetVersion() string { + if x != nil { + return x.Version } return "" } -func (m *Status) GetGenesis() []byte { - if m != nil { - return m.Genesis +func (x *Status) GetGenesis() []byte { + if x != nil { + return x.Genesis } return nil } -func (m *Status) GetCertificates() []*AgentCertificate { - if m != nil { - return m.Certificates +func (x *Status) GetCertificates() []*AgentCertificate { + if x != nil { + return x.Certificates } return nil } -func (m *Status) GetIssueCertificate() bool { - if m != nil { - return m.IssueCertificate +func (x *Status) GetIssueCertificate() bool { + if x != nil { + return x.IssueCertificate } return false } // GoAwayNotice is sent before host peer is closing connection to remote peer. it contains why the host closing connection. type GoAwayNotice struct { - Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *GoAwayNotice) Reset() { *m = GoAwayNotice{} } -func (m *GoAwayNotice) String() string { return proto.CompactTextString(m) } -func (*GoAwayNotice) ProtoMessage() {} -func (*GoAwayNotice) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{5} -} -func (m *GoAwayNotice) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GoAwayNotice.Unmarshal(m, b) + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` } -func (m *GoAwayNotice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GoAwayNotice.Marshal(b, m, deterministic) -} -func (dst *GoAwayNotice) XXX_Merge(src proto.Message) { - xxx_messageInfo_GoAwayNotice.Merge(dst, src) + +func (x *GoAwayNotice) Reset() { + *x = GoAwayNotice{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GoAwayNotice) XXX_Size() int { - return xxx_messageInfo_GoAwayNotice.Size(m) + +func (x *GoAwayNotice) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GoAwayNotice) XXX_DiscardUnknown() { - xxx_messageInfo_GoAwayNotice.DiscardUnknown(m) + +func (*GoAwayNotice) ProtoMessage() {} + +func (x *GoAwayNotice) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GoAwayNotice proto.InternalMessageInfo +// Deprecated: Use GoAwayNotice.ProtoReflect.Descriptor instead. +func (*GoAwayNotice) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{5} +} -func (m *GoAwayNotice) GetMessage() string { - if m != nil { - return m.Message +func (x *GoAwayNotice) GetMessage() string { + if x != nil { + return x.Message } return "" } type AddressesRequest struct { - Sender *PeerAddress `protobuf:"bytes,1,opt,name=sender" json:"sender,omitempty"` - MaxSize uint32 `protobuf:"varint,2,opt,name=maxSize" json:"maxSize,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AddressesRequest) Reset() { *m = AddressesRequest{} } -func (m *AddressesRequest) String() string { return proto.CompactTextString(m) } -func (*AddressesRequest) ProtoMessage() {} -func (*AddressesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{6} -} -func (m *AddressesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddressesRequest.Unmarshal(m, b) -} -func (m *AddressesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddressesRequest.Marshal(b, m, deterministic) + Sender *PeerAddress `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + MaxSize uint32 `protobuf:"varint,2,opt,name=maxSize,proto3" json:"maxSize,omitempty"` } -func (dst *AddressesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddressesRequest.Merge(dst, src) + +func (x *AddressesRequest) Reset() { + *x = AddressesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AddressesRequest) XXX_Size() int { - return xxx_messageInfo_AddressesRequest.Size(m) + +func (x *AddressesRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AddressesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddressesRequest.DiscardUnknown(m) + +func (*AddressesRequest) ProtoMessage() {} + +func (x *AddressesRequest) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AddressesRequest proto.InternalMessageInfo +// Deprecated: Use AddressesRequest.ProtoReflect.Descriptor instead. +func (*AddressesRequest) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{6} +} -func (m *AddressesRequest) GetSender() *PeerAddress { - if m != nil { - return m.Sender +func (x *AddressesRequest) GetSender() *PeerAddress { + if x != nil { + return x.Sender } return nil } -func (m *AddressesRequest) GetMaxSize() uint32 { - if m != nil { - return m.MaxSize +func (x *AddressesRequest) GetMaxSize() uint32 { + if x != nil { + return x.MaxSize } return 0 } type AddressesResponse struct { - Status ResultStatus `protobuf:"varint,1,opt,name=status,enum=types.ResultStatus" json:"status,omitempty"` - Peers []*PeerAddress `protobuf:"bytes,2,rep,name=peers" json:"peers,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AddressesResponse) Reset() { *m = AddressesResponse{} } -func (m *AddressesResponse) String() string { return proto.CompactTextString(m) } -func (*AddressesResponse) ProtoMessage() {} -func (*AddressesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{7} -} -func (m *AddressesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddressesResponse.Unmarshal(m, b) + Status ResultStatus `protobuf:"varint,1,opt,name=status,proto3,enum=types.ResultStatus" json:"status,omitempty"` + Peers []*PeerAddress `protobuf:"bytes,2,rep,name=peers,proto3" json:"peers,omitempty"` } -func (m *AddressesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddressesResponse.Marshal(b, m, deterministic) -} -func (dst *AddressesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddressesResponse.Merge(dst, src) + +func (x *AddressesResponse) Reset() { + *x = AddressesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AddressesResponse) XXX_Size() int { - return xxx_messageInfo_AddressesResponse.Size(m) + +func (x *AddressesResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AddressesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AddressesResponse.DiscardUnknown(m) + +func (*AddressesResponse) ProtoMessage() {} + +func (x *AddressesResponse) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AddressesResponse proto.InternalMessageInfo +// Deprecated: Use AddressesResponse.ProtoReflect.Descriptor instead. +func (*AddressesResponse) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{7} +} -func (m *AddressesResponse) GetStatus() ResultStatus { - if m != nil { - return m.Status +func (x *AddressesResponse) GetStatus() ResultStatus { + if x != nil { + return x.Status } return ResultStatus_OK } -func (m *AddressesResponse) GetPeers() []*PeerAddress { - if m != nil { - return m.Peers +func (x *AddressesResponse) GetPeers() []*PeerAddress { + if x != nil { + return x.Peers } return nil } @@ -610,47 +704,56 @@ func (m *AddressesResponse) GetPeers() []*PeerAddress { // that other bp node produced.) It contains just hash and blockNo. The host node will not send notice if target receiving peer // knows that block already at best effort. type NewBlockNotice struct { - BlockHash []byte `protobuf:"bytes,1,opt,name=blockHash,proto3" json:"blockHash,omitempty"` - BlockNo uint64 `protobuf:"varint,2,opt,name=blockNo" json:"blockNo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *NewBlockNotice) Reset() { *m = NewBlockNotice{} } -func (m *NewBlockNotice) String() string { return proto.CompactTextString(m) } -func (*NewBlockNotice) ProtoMessage() {} -func (*NewBlockNotice) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{8} + BlockHash []byte `protobuf:"bytes,1,opt,name=blockHash,proto3" json:"blockHash,omitempty"` + BlockNo uint64 `protobuf:"varint,2,opt,name=blockNo,proto3" json:"blockNo,omitempty"` } -func (m *NewBlockNotice) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NewBlockNotice.Unmarshal(m, b) -} -func (m *NewBlockNotice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NewBlockNotice.Marshal(b, m, deterministic) -} -func (dst *NewBlockNotice) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewBlockNotice.Merge(dst, src) + +func (x *NewBlockNotice) Reset() { + *x = NewBlockNotice{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NewBlockNotice) XXX_Size() int { - return xxx_messageInfo_NewBlockNotice.Size(m) + +func (x *NewBlockNotice) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NewBlockNotice) XXX_DiscardUnknown() { - xxx_messageInfo_NewBlockNotice.DiscardUnknown(m) + +func (*NewBlockNotice) ProtoMessage() {} + +func (x *NewBlockNotice) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_NewBlockNotice proto.InternalMessageInfo +// Deprecated: Use NewBlockNotice.ProtoReflect.Descriptor instead. +func (*NewBlockNotice) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{8} +} -func (m *NewBlockNotice) GetBlockHash() []byte { - if m != nil { - return m.BlockHash +func (x *NewBlockNotice) GetBlockHash() []byte { + if x != nil { + return x.BlockHash } return nil } -func (m *NewBlockNotice) GetBlockNo() uint64 { - if m != nil { - return m.BlockNo +func (x *NewBlockNotice) GetBlockNo() uint64 { + if x != nil { + return x.BlockNo } return 0 } @@ -658,997 +761,1678 @@ func (m *NewBlockNotice) GetBlockNo() uint64 { // BlockProducedNotice is sent when BP created blocks and host peer is BP (or surrogate of BP) and receiving peer is also trusted BP or surrogate of BP. // It contains whole block information type BlockProducedNotice struct { - ProducerID []byte `protobuf:"bytes,1,opt,name=producerID,proto3" json:"producerID,omitempty"` - BlockNo uint64 `protobuf:"varint,2,opt,name=blockNo" json:"blockNo,omitempty"` - Block *Block `protobuf:"bytes,3,opt,name=block" json:"block,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *BlockProducedNotice) Reset() { *m = BlockProducedNotice{} } -func (m *BlockProducedNotice) String() string { return proto.CompactTextString(m) } -func (*BlockProducedNotice) ProtoMessage() {} -func (*BlockProducedNotice) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{9} -} -func (m *BlockProducedNotice) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockProducedNotice.Unmarshal(m, b) + ProducerID []byte `protobuf:"bytes,1,opt,name=producerID,proto3" json:"producerID,omitempty"` + BlockNo uint64 `protobuf:"varint,2,opt,name=blockNo,proto3" json:"blockNo,omitempty"` + Block *Block `protobuf:"bytes,3,opt,name=block,proto3" json:"block,omitempty"` } -func (m *BlockProducedNotice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockProducedNotice.Marshal(b, m, deterministic) -} -func (dst *BlockProducedNotice) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockProducedNotice.Merge(dst, src) + +func (x *BlockProducedNotice) Reset() { + *x = BlockProducedNotice{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BlockProducedNotice) XXX_Size() int { - return xxx_messageInfo_BlockProducedNotice.Size(m) + +func (x *BlockProducedNotice) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BlockProducedNotice) XXX_DiscardUnknown() { - xxx_messageInfo_BlockProducedNotice.DiscardUnknown(m) + +func (*BlockProducedNotice) ProtoMessage() {} + +func (x *BlockProducedNotice) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BlockProducedNotice proto.InternalMessageInfo +// Deprecated: Use BlockProducedNotice.ProtoReflect.Descriptor instead. +func (*BlockProducedNotice) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{9} +} -func (m *BlockProducedNotice) GetProducerID() []byte { - if m != nil { - return m.ProducerID +func (x *BlockProducedNotice) GetProducerID() []byte { + if x != nil { + return x.ProducerID } return nil } -func (m *BlockProducedNotice) GetBlockNo() uint64 { - if m != nil { - return m.BlockNo +func (x *BlockProducedNotice) GetBlockNo() uint64 { + if x != nil { + return x.BlockNo } return 0 } -func (m *BlockProducedNotice) GetBlock() *Block { - if m != nil { - return m.Block +func (x *BlockProducedNotice) GetBlock() *Block { + if x != nil { + return x.Block } return nil } // GetBlockHeadersRequest type GetBlockHeadersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Hash indicated referenced block hash. server will return headers from this block. Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // Block height instead of hash will be used for the first returned block, if hash is nil or empty - Height uint64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` - Offset uint64 `protobuf:"varint,3,opt,name=offset" json:"offset,omitempty"` - Size uint32 `protobuf:"varint,4,opt,name=size" json:"size,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Offset uint64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` + Size uint32 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` // default is false. - Asc bool `protobuf:"varint,5,opt,name=asc" json:"asc,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Asc bool `protobuf:"varint,5,opt,name=asc,proto3" json:"asc,omitempty"` } -func (m *GetBlockHeadersRequest) Reset() { *m = GetBlockHeadersRequest{} } -func (m *GetBlockHeadersRequest) String() string { return proto.CompactTextString(m) } -func (*GetBlockHeadersRequest) ProtoMessage() {} -func (*GetBlockHeadersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{10} -} -func (m *GetBlockHeadersRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetBlockHeadersRequest.Unmarshal(m, b) -} -func (m *GetBlockHeadersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetBlockHeadersRequest.Marshal(b, m, deterministic) -} -func (dst *GetBlockHeadersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockHeadersRequest.Merge(dst, src) +func (x *GetBlockHeadersRequest) Reset() { + *x = GetBlockHeadersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetBlockHeadersRequest) XXX_Size() int { - return xxx_messageInfo_GetBlockHeadersRequest.Size(m) + +func (x *GetBlockHeadersRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetBlockHeadersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetBlockHeadersRequest.DiscardUnknown(m) + +func (*GetBlockHeadersRequest) ProtoMessage() {} + +func (x *GetBlockHeadersRequest) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetBlockHeadersRequest proto.InternalMessageInfo +// Deprecated: Use GetBlockHeadersRequest.ProtoReflect.Descriptor instead. +func (*GetBlockHeadersRequest) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{10} +} -func (m *GetBlockHeadersRequest) GetHash() []byte { - if m != nil { - return m.Hash +func (x *GetBlockHeadersRequest) GetHash() []byte { + if x != nil { + return x.Hash } return nil } -func (m *GetBlockHeadersRequest) GetHeight() uint64 { - if m != nil { - return m.Height +func (x *GetBlockHeadersRequest) GetHeight() uint64 { + if x != nil { + return x.Height } return 0 } -func (m *GetBlockHeadersRequest) GetOffset() uint64 { - if m != nil { - return m.Offset +func (x *GetBlockHeadersRequest) GetOffset() uint64 { + if x != nil { + return x.Offset } return 0 } -func (m *GetBlockHeadersRequest) GetSize() uint32 { - if m != nil { - return m.Size +func (x *GetBlockHeadersRequest) GetSize() uint32 { + if x != nil { + return x.Size } return 0 } -func (m *GetBlockHeadersRequest) GetAsc() bool { - if m != nil { - return m.Asc +func (x *GetBlockHeadersRequest) GetAsc() bool { + if x != nil { + return x.Asc } return false } // GetBlockResponse contains response of GetBlockRequest. type GetBlockHeadersResponse struct { - Status ResultStatus `protobuf:"varint,1,opt,name=status,enum=types.ResultStatus" json:"status,omitempty"` - Hashes [][]byte `protobuf:"bytes,2,rep,name=hashes,proto3" json:"hashes,omitempty"` - Headers []*BlockHeader `protobuf:"bytes,3,rep,name=headers" json:"headers,omitempty"` - HasNext bool `protobuf:"varint,4,opt,name=hasNext" json:"hasNext,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetBlockHeadersResponse) Reset() { *m = GetBlockHeadersResponse{} } -func (m *GetBlockHeadersResponse) String() string { return proto.CompactTextString(m) } -func (*GetBlockHeadersResponse) ProtoMessage() {} -func (*GetBlockHeadersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{11} -} -func (m *GetBlockHeadersResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetBlockHeadersResponse.Unmarshal(m, b) -} -func (m *GetBlockHeadersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetBlockHeadersResponse.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status ResultStatus `protobuf:"varint,1,opt,name=status,proto3,enum=types.ResultStatus" json:"status,omitempty"` + Hashes [][]byte `protobuf:"bytes,2,rep,name=hashes,proto3" json:"hashes,omitempty"` + Headers []*BlockHeader `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty"` + HasNext bool `protobuf:"varint,4,opt,name=hasNext,proto3" json:"hasNext,omitempty"` } -func (dst *GetBlockHeadersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockHeadersResponse.Merge(dst, src) + +func (x *GetBlockHeadersResponse) Reset() { + *x = GetBlockHeadersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetBlockHeadersResponse) XXX_Size() int { - return xxx_messageInfo_GetBlockHeadersResponse.Size(m) + +func (x *GetBlockHeadersResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetBlockHeadersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetBlockHeadersResponse.DiscardUnknown(m) + +func (*GetBlockHeadersResponse) ProtoMessage() {} + +func (x *GetBlockHeadersResponse) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetBlockHeadersResponse proto.InternalMessageInfo +// Deprecated: Use GetBlockHeadersResponse.ProtoReflect.Descriptor instead. +func (*GetBlockHeadersResponse) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{11} +} -func (m *GetBlockHeadersResponse) GetStatus() ResultStatus { - if m != nil { - return m.Status +func (x *GetBlockHeadersResponse) GetStatus() ResultStatus { + if x != nil { + return x.Status } return ResultStatus_OK } -func (m *GetBlockHeadersResponse) GetHashes() [][]byte { - if m != nil { - return m.Hashes +func (x *GetBlockHeadersResponse) GetHashes() [][]byte { + if x != nil { + return x.Hashes } return nil } -func (m *GetBlockHeadersResponse) GetHeaders() []*BlockHeader { - if m != nil { - return m.Headers +func (x *GetBlockHeadersResponse) GetHeaders() []*BlockHeader { + if x != nil { + return x.Headers } return nil } -func (m *GetBlockHeadersResponse) GetHasNext() bool { - if m != nil { - return m.HasNext +func (x *GetBlockHeadersResponse) GetHasNext() bool { + if x != nil { + return x.HasNext } return false } // GetBlockRequest request blocks informations, not just single block. type GetBlockRequest struct { - Hashes [][]byte `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *GetBlockRequest) Reset() { *m = GetBlockRequest{} } -func (m *GetBlockRequest) String() string { return proto.CompactTextString(m) } -func (*GetBlockRequest) ProtoMessage() {} -func (*GetBlockRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{12} -} -func (m *GetBlockRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetBlockRequest.Unmarshal(m, b) -} -func (m *GetBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetBlockRequest.Marshal(b, m, deterministic) + Hashes [][]byte `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` } -func (dst *GetBlockRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockRequest.Merge(dst, src) + +func (x *GetBlockRequest) Reset() { + *x = GetBlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetBlockRequest) XXX_Size() int { - return xxx_messageInfo_GetBlockRequest.Size(m) + +func (x *GetBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetBlockRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetBlockRequest.DiscardUnknown(m) + +func (*GetBlockRequest) ProtoMessage() {} + +func (x *GetBlockRequest) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetBlockRequest proto.InternalMessageInfo +// Deprecated: Use GetBlockRequest.ProtoReflect.Descriptor instead. +func (*GetBlockRequest) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{12} +} -func (m *GetBlockRequest) GetHashes() [][]byte { - if m != nil { - return m.Hashes +func (x *GetBlockRequest) GetHashes() [][]byte { + if x != nil { + return x.Hashes } return nil } // GetBlockResponse contains response of GetBlockRequest. type GetBlockResponse struct { - Status ResultStatus `protobuf:"varint,1,opt,name=status,enum=types.ResultStatus" json:"status,omitempty"` - Blocks []*Block `protobuf:"bytes,2,rep,name=blocks" json:"blocks,omitempty"` - HasNext bool `protobuf:"varint,3,opt,name=hasNext" json:"hasNext,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *GetBlockResponse) Reset() { *m = GetBlockResponse{} } -func (m *GetBlockResponse) String() string { return proto.CompactTextString(m) } -func (*GetBlockResponse) ProtoMessage() {} -func (*GetBlockResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{13} + Status ResultStatus `protobuf:"varint,1,opt,name=status,proto3,enum=types.ResultStatus" json:"status,omitempty"` + Blocks []*Block `protobuf:"bytes,2,rep,name=blocks,proto3" json:"blocks,omitempty"` + HasNext bool `protobuf:"varint,3,opt,name=hasNext,proto3" json:"hasNext,omitempty"` } -func (m *GetBlockResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetBlockResponse.Unmarshal(m, b) -} -func (m *GetBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetBlockResponse.Marshal(b, m, deterministic) -} -func (dst *GetBlockResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockResponse.Merge(dst, src) + +func (x *GetBlockResponse) Reset() { + *x = GetBlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetBlockResponse) XXX_Size() int { - return xxx_messageInfo_GetBlockResponse.Size(m) + +func (x *GetBlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetBlockResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetBlockResponse.DiscardUnknown(m) + +func (*GetBlockResponse) ProtoMessage() {} + +func (x *GetBlockResponse) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetBlockResponse proto.InternalMessageInfo +// Deprecated: Use GetBlockResponse.ProtoReflect.Descriptor instead. +func (*GetBlockResponse) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{13} +} -func (m *GetBlockResponse) GetStatus() ResultStatus { - if m != nil { - return m.Status +func (x *GetBlockResponse) GetStatus() ResultStatus { + if x != nil { + return x.Status } return ResultStatus_OK } -func (m *GetBlockResponse) GetBlocks() []*Block { - if m != nil { - return m.Blocks +func (x *GetBlockResponse) GetBlocks() []*Block { + if x != nil { + return x.Blocks } return nil } -func (m *GetBlockResponse) GetHasNext() bool { - if m != nil { - return m.HasNext +func (x *GetBlockResponse) GetHasNext() bool { + if x != nil { + return x.HasNext } return false } type NewTransactionsNotice struct { - TxHashes [][]byte `protobuf:"bytes,1,rep,name=txHashes,proto3" json:"txHashes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *NewTransactionsNotice) Reset() { *m = NewTransactionsNotice{} } -func (m *NewTransactionsNotice) String() string { return proto.CompactTextString(m) } -func (*NewTransactionsNotice) ProtoMessage() {} -func (*NewTransactionsNotice) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{14} -} -func (m *NewTransactionsNotice) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NewTransactionsNotice.Unmarshal(m, b) -} -func (m *NewTransactionsNotice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NewTransactionsNotice.Marshal(b, m, deterministic) + TxHashes [][]byte `protobuf:"bytes,1,rep,name=txHashes,proto3" json:"txHashes,omitempty"` } -func (dst *NewTransactionsNotice) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewTransactionsNotice.Merge(dst, src) + +func (x *NewTransactionsNotice) Reset() { + *x = NewTransactionsNotice{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NewTransactionsNotice) XXX_Size() int { - return xxx_messageInfo_NewTransactionsNotice.Size(m) + +func (x *NewTransactionsNotice) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NewTransactionsNotice) XXX_DiscardUnknown() { - xxx_messageInfo_NewTransactionsNotice.DiscardUnknown(m) + +func (*NewTransactionsNotice) ProtoMessage() {} + +func (x *NewTransactionsNotice) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_NewTransactionsNotice proto.InternalMessageInfo +// Deprecated: Use NewTransactionsNotice.ProtoReflect.Descriptor instead. +func (*NewTransactionsNotice) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{14} +} -func (m *NewTransactionsNotice) GetTxHashes() [][]byte { - if m != nil { - return m.TxHashes +func (x *NewTransactionsNotice) GetTxHashes() [][]byte { + if x != nil { + return x.TxHashes } return nil } type GetTransactionsRequest struct { - Hashes [][]byte `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *GetTransactionsRequest) Reset() { *m = GetTransactionsRequest{} } -func (m *GetTransactionsRequest) String() string { return proto.CompactTextString(m) } -func (*GetTransactionsRequest) ProtoMessage() {} -func (*GetTransactionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{15} -} -func (m *GetTransactionsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTransactionsRequest.Unmarshal(m, b) -} -func (m *GetTransactionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTransactionsRequest.Marshal(b, m, deterministic) + Hashes [][]byte `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` } -func (dst *GetTransactionsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTransactionsRequest.Merge(dst, src) + +func (x *GetTransactionsRequest) Reset() { + *x = GetTransactionsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetTransactionsRequest) XXX_Size() int { - return xxx_messageInfo_GetTransactionsRequest.Size(m) + +func (x *GetTransactionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetTransactionsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetTransactionsRequest.DiscardUnknown(m) + +func (*GetTransactionsRequest) ProtoMessage() {} + +func (x *GetTransactionsRequest) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetTransactionsRequest proto.InternalMessageInfo +// Deprecated: Use GetTransactionsRequest.ProtoReflect.Descriptor instead. +func (*GetTransactionsRequest) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{15} +} -func (m *GetTransactionsRequest) GetHashes() [][]byte { - if m != nil { - return m.Hashes +func (x *GetTransactionsRequest) GetHashes() [][]byte { + if x != nil { + return x.Hashes } return nil } type GetTransactionsResponse struct { - Status ResultStatus `protobuf:"varint,1,opt,name=status,enum=types.ResultStatus" json:"status,omitempty"` - Hashes [][]byte `protobuf:"bytes,2,rep,name=hashes,proto3" json:"hashes,omitempty"` - Txs []*Tx `protobuf:"bytes,3,rep,name=txs" json:"txs,omitempty"` - HasNext bool `protobuf:"varint,4,opt,name=hasNext" json:"hasNext,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetTransactionsResponse) Reset() { *m = GetTransactionsResponse{} } -func (m *GetTransactionsResponse) String() string { return proto.CompactTextString(m) } -func (*GetTransactionsResponse) ProtoMessage() {} -func (*GetTransactionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{16} -} -func (m *GetTransactionsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetTransactionsResponse.Unmarshal(m, b) -} -func (m *GetTransactionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetTransactionsResponse.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status ResultStatus `protobuf:"varint,1,opt,name=status,proto3,enum=types.ResultStatus" json:"status,omitempty"` + Hashes [][]byte `protobuf:"bytes,2,rep,name=hashes,proto3" json:"hashes,omitempty"` + Txs []*Tx `protobuf:"bytes,3,rep,name=txs,proto3" json:"txs,omitempty"` + HasNext bool `protobuf:"varint,4,opt,name=hasNext,proto3" json:"hasNext,omitempty"` } -func (dst *GetTransactionsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTransactionsResponse.Merge(dst, src) + +func (x *GetTransactionsResponse) Reset() { + *x = GetTransactionsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetTransactionsResponse) XXX_Size() int { - return xxx_messageInfo_GetTransactionsResponse.Size(m) + +func (x *GetTransactionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetTransactionsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetTransactionsResponse.DiscardUnknown(m) + +func (*GetTransactionsResponse) ProtoMessage() {} + +func (x *GetTransactionsResponse) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetTransactionsResponse proto.InternalMessageInfo +// Deprecated: Use GetTransactionsResponse.ProtoReflect.Descriptor instead. +func (*GetTransactionsResponse) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{16} +} -func (m *GetTransactionsResponse) GetStatus() ResultStatus { - if m != nil { - return m.Status +func (x *GetTransactionsResponse) GetStatus() ResultStatus { + if x != nil { + return x.Status } return ResultStatus_OK } -func (m *GetTransactionsResponse) GetHashes() [][]byte { - if m != nil { - return m.Hashes +func (x *GetTransactionsResponse) GetHashes() [][]byte { + if x != nil { + return x.Hashes } return nil } -func (m *GetTransactionsResponse) GetTxs() []*Tx { - if m != nil { - return m.Txs +func (x *GetTransactionsResponse) GetTxs() []*Tx { + if x != nil { + return x.Txs } return nil } -func (m *GetTransactionsResponse) GetHasNext() bool { - if m != nil { - return m.HasNext +func (x *GetTransactionsResponse) GetHasNext() bool { + if x != nil { + return x.HasNext } return false } // GetMissingRequest type GetMissingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Hash indicated referenced sparse block hash array of longest chain(caller). Hashes [][]byte `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` // stophash will be used the meaning of end point of missing part. - Stophash []byte `protobuf:"bytes,2,opt,name=stophash,proto3" json:"stophash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Stophash []byte `protobuf:"bytes,2,opt,name=stophash,proto3" json:"stophash,omitempty"` } -func (m *GetMissingRequest) Reset() { *m = GetMissingRequest{} } -func (m *GetMissingRequest) String() string { return proto.CompactTextString(m) } -func (*GetMissingRequest) ProtoMessage() {} -func (*GetMissingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{17} -} -func (m *GetMissingRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetMissingRequest.Unmarshal(m, b) -} -func (m *GetMissingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetMissingRequest.Marshal(b, m, deterministic) -} -func (dst *GetMissingRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetMissingRequest.Merge(dst, src) +func (x *GetMissingRequest) Reset() { + *x = GetMissingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetMissingRequest) XXX_Size() int { - return xxx_messageInfo_GetMissingRequest.Size(m) + +func (x *GetMissingRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetMissingRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetMissingRequest.DiscardUnknown(m) + +func (*GetMissingRequest) ProtoMessage() {} + +func (x *GetMissingRequest) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetMissingRequest proto.InternalMessageInfo +// Deprecated: Use GetMissingRequest.ProtoReflect.Descriptor instead. +func (*GetMissingRequest) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{17} +} -func (m *GetMissingRequest) GetHashes() [][]byte { - if m != nil { - return m.Hashes +func (x *GetMissingRequest) GetHashes() [][]byte { + if x != nil { + return x.Hashes } return nil } -func (m *GetMissingRequest) GetStophash() []byte { - if m != nil { - return m.Stophash +func (x *GetMissingRequest) GetStophash() []byte { + if x != nil { + return x.Stophash } return nil } type GetAncestorRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Hash indicated referenced sparse block hash array of longest chain(caller). - Hashes [][]byte `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Hashes [][]byte `protobuf:"bytes,1,rep,name=hashes,proto3" json:"hashes,omitempty"` } -func (m *GetAncestorRequest) Reset() { *m = GetAncestorRequest{} } -func (m *GetAncestorRequest) String() string { return proto.CompactTextString(m) } -func (*GetAncestorRequest) ProtoMessage() {} -func (*GetAncestorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{18} -} -func (m *GetAncestorRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAncestorRequest.Unmarshal(m, b) -} -func (m *GetAncestorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAncestorRequest.Marshal(b, m, deterministic) -} -func (dst *GetAncestorRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAncestorRequest.Merge(dst, src) +func (x *GetAncestorRequest) Reset() { + *x = GetAncestorRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetAncestorRequest) XXX_Size() int { - return xxx_messageInfo_GetAncestorRequest.Size(m) + +func (x *GetAncestorRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetAncestorRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetAncestorRequest.DiscardUnknown(m) + +func (*GetAncestorRequest) ProtoMessage() {} + +func (x *GetAncestorRequest) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetAncestorRequest proto.InternalMessageInfo +// Deprecated: Use GetAncestorRequest.ProtoReflect.Descriptor instead. +func (*GetAncestorRequest) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{18} +} -func (m *GetAncestorRequest) GetHashes() [][]byte { - if m != nil { - return m.Hashes +func (x *GetAncestorRequest) GetHashes() [][]byte { + if x != nil { + return x.Hashes } return nil } type GetAncestorResponse struct { - Status ResultStatus `protobuf:"varint,1,opt,name=status,enum=types.ResultStatus" json:"status,omitempty"` - AncestorHash []byte `protobuf:"bytes,2,opt,name=ancestorHash,proto3" json:"ancestorHash,omitempty"` - AncestorNo uint64 `protobuf:"varint,3,opt,name=ancestorNo" json:"ancestorNo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *GetAncestorResponse) Reset() { *m = GetAncestorResponse{} } -func (m *GetAncestorResponse) String() string { return proto.CompactTextString(m) } -func (*GetAncestorResponse) ProtoMessage() {} -func (*GetAncestorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{19} -} -func (m *GetAncestorResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetAncestorResponse.Unmarshal(m, b) -} -func (m *GetAncestorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetAncestorResponse.Marshal(b, m, deterministic) + Status ResultStatus `protobuf:"varint,1,opt,name=status,proto3,enum=types.ResultStatus" json:"status,omitempty"` + AncestorHash []byte `protobuf:"bytes,2,opt,name=ancestorHash,proto3" json:"ancestorHash,omitempty"` + AncestorNo uint64 `protobuf:"varint,3,opt,name=ancestorNo,proto3" json:"ancestorNo,omitempty"` } -func (dst *GetAncestorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAncestorResponse.Merge(dst, src) + +func (x *GetAncestorResponse) Reset() { + *x = GetAncestorResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetAncestorResponse) XXX_Size() int { - return xxx_messageInfo_GetAncestorResponse.Size(m) + +func (x *GetAncestorResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetAncestorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetAncestorResponse.DiscardUnknown(m) + +func (*GetAncestorResponse) ProtoMessage() {} + +func (x *GetAncestorResponse) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetAncestorResponse proto.InternalMessageInfo +// Deprecated: Use GetAncestorResponse.ProtoReflect.Descriptor instead. +func (*GetAncestorResponse) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{19} +} -func (m *GetAncestorResponse) GetStatus() ResultStatus { - if m != nil { - return m.Status +func (x *GetAncestorResponse) GetStatus() ResultStatus { + if x != nil { + return x.Status } return ResultStatus_OK } -func (m *GetAncestorResponse) GetAncestorHash() []byte { - if m != nil { - return m.AncestorHash +func (x *GetAncestorResponse) GetAncestorHash() []byte { + if x != nil { + return x.AncestorHash } return nil } -func (m *GetAncestorResponse) GetAncestorNo() uint64 { - if m != nil { - return m.AncestorNo +func (x *GetAncestorResponse) GetAncestorNo() uint64 { + if x != nil { + return x.AncestorNo } return 0 } type GetHashByNo struct { - BlockNo uint64 `protobuf:"varint,1,opt,name=blockNo" json:"blockNo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *GetHashByNo) Reset() { *m = GetHashByNo{} } -func (m *GetHashByNo) String() string { return proto.CompactTextString(m) } -func (*GetHashByNo) ProtoMessage() {} -func (*GetHashByNo) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{20} + BlockNo uint64 `protobuf:"varint,1,opt,name=blockNo,proto3" json:"blockNo,omitempty"` } -func (m *GetHashByNo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetHashByNo.Unmarshal(m, b) -} -func (m *GetHashByNo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetHashByNo.Marshal(b, m, deterministic) -} -func (dst *GetHashByNo) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHashByNo.Merge(dst, src) + +func (x *GetHashByNo) Reset() { + *x = GetHashByNo{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetHashByNo) XXX_Size() int { - return xxx_messageInfo_GetHashByNo.Size(m) + +func (x *GetHashByNo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetHashByNo) XXX_DiscardUnknown() { - xxx_messageInfo_GetHashByNo.DiscardUnknown(m) + +func (*GetHashByNo) ProtoMessage() {} + +func (x *GetHashByNo) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetHashByNo proto.InternalMessageInfo +// Deprecated: Use GetHashByNo.ProtoReflect.Descriptor instead. +func (*GetHashByNo) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{20} +} -func (m *GetHashByNo) GetBlockNo() uint64 { - if m != nil { - return m.BlockNo +func (x *GetHashByNo) GetBlockNo() uint64 { + if x != nil { + return x.BlockNo } return 0 } type GetHashByNoResponse struct { - Status ResultStatus `protobuf:"varint,1,opt,name=status,enum=types.ResultStatus" json:"status,omitempty"` - BlockHash []byte `protobuf:"bytes,2,opt,name=blockHash,proto3" json:"blockHash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *GetHashByNoResponse) Reset() { *m = GetHashByNoResponse{} } -func (m *GetHashByNoResponse) String() string { return proto.CompactTextString(m) } -func (*GetHashByNoResponse) ProtoMessage() {} -func (*GetHashByNoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{21} -} -func (m *GetHashByNoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetHashByNoResponse.Unmarshal(m, b) -} -func (m *GetHashByNoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetHashByNoResponse.Marshal(b, m, deterministic) + Status ResultStatus `protobuf:"varint,1,opt,name=status,proto3,enum=types.ResultStatus" json:"status,omitempty"` + BlockHash []byte `protobuf:"bytes,2,opt,name=blockHash,proto3" json:"blockHash,omitempty"` } -func (dst *GetHashByNoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHashByNoResponse.Merge(dst, src) + +func (x *GetHashByNoResponse) Reset() { + *x = GetHashByNoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetHashByNoResponse) XXX_Size() int { - return xxx_messageInfo_GetHashByNoResponse.Size(m) + +func (x *GetHashByNoResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetHashByNoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetHashByNoResponse.DiscardUnknown(m) + +func (*GetHashByNoResponse) ProtoMessage() {} + +func (x *GetHashByNoResponse) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetHashByNoResponse proto.InternalMessageInfo +// Deprecated: Use GetHashByNoResponse.ProtoReflect.Descriptor instead. +func (*GetHashByNoResponse) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{21} +} -func (m *GetHashByNoResponse) GetStatus() ResultStatus { - if m != nil { - return m.Status +func (x *GetHashByNoResponse) GetStatus() ResultStatus { + if x != nil { + return x.Status } return ResultStatus_OK } -func (m *GetHashByNoResponse) GetBlockHash() []byte { - if m != nil { - return m.BlockHash +func (x *GetHashByNoResponse) GetBlockHash() []byte { + if x != nil { + return x.BlockHash } return nil } // GetHashesRequest type GetHashesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // prevHash indicated referenced block hash. server will return hashes after this block. PrevHash []byte `protobuf:"bytes,1,opt,name=prevHash,proto3" json:"prevHash,omitempty"` // prevNumber indicated referenced block - PrevNumber uint64 `protobuf:"varint,2,opt,name=prevNumber" json:"prevNumber,omitempty"` + PrevNumber uint64 `protobuf:"varint,2,opt,name=prevNumber,proto3" json:"prevNumber,omitempty"` // maximum count of hashes that want to get - Size uint64 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` } -func (m *GetHashesRequest) Reset() { *m = GetHashesRequest{} } -func (m *GetHashesRequest) String() string { return proto.CompactTextString(m) } -func (*GetHashesRequest) ProtoMessage() {} -func (*GetHashesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{22} -} -func (m *GetHashesRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetHashesRequest.Unmarshal(m, b) -} -func (m *GetHashesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetHashesRequest.Marshal(b, m, deterministic) -} -func (dst *GetHashesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHashesRequest.Merge(dst, src) +func (x *GetHashesRequest) Reset() { + *x = GetHashesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetHashesRequest) XXX_Size() int { - return xxx_messageInfo_GetHashesRequest.Size(m) + +func (x *GetHashesRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetHashesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetHashesRequest.DiscardUnknown(m) + +func (*GetHashesRequest) ProtoMessage() {} + +func (x *GetHashesRequest) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetHashesRequest proto.InternalMessageInfo +// Deprecated: Use GetHashesRequest.ProtoReflect.Descriptor instead. +func (*GetHashesRequest) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{22} +} -func (m *GetHashesRequest) GetPrevHash() []byte { - if m != nil { - return m.PrevHash +func (x *GetHashesRequest) GetPrevHash() []byte { + if x != nil { + return x.PrevHash } return nil } -func (m *GetHashesRequest) GetPrevNumber() uint64 { - if m != nil { - return m.PrevNumber +func (x *GetHashesRequest) GetPrevNumber() uint64 { + if x != nil { + return x.PrevNumber } return 0 } -func (m *GetHashesRequest) GetSize() uint64 { - if m != nil { - return m.Size +func (x *GetHashesRequest) GetSize() uint64 { + if x != nil { + return x.Size } return 0 } // GetHashesResponse contains response of GetHashesRequest. type GetHashesResponse struct { - Status ResultStatus `protobuf:"varint,1,opt,name=status,enum=types.ResultStatus" json:"status,omitempty"` - Hashes [][]byte `protobuf:"bytes,2,rep,name=hashes,proto3" json:"hashes,omitempty"` - HasNext bool `protobuf:"varint,3,opt,name=hasNext" json:"hasNext,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *GetHashesResponse) Reset() { *m = GetHashesResponse{} } -func (m *GetHashesResponse) String() string { return proto.CompactTextString(m) } -func (*GetHashesResponse) ProtoMessage() {} -func (*GetHashesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{23} -} -func (m *GetHashesResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetHashesResponse.Unmarshal(m, b) -} -func (m *GetHashesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetHashesResponse.Marshal(b, m, deterministic) + Status ResultStatus `protobuf:"varint,1,opt,name=status,proto3,enum=types.ResultStatus" json:"status,omitempty"` + Hashes [][]byte `protobuf:"bytes,2,rep,name=hashes,proto3" json:"hashes,omitempty"` + HasNext bool `protobuf:"varint,3,opt,name=hasNext,proto3" json:"hasNext,omitempty"` } -func (dst *GetHashesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHashesResponse.Merge(dst, src) + +func (x *GetHashesResponse) Reset() { + *x = GetHashesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetHashesResponse) XXX_Size() int { - return xxx_messageInfo_GetHashesResponse.Size(m) + +func (x *GetHashesResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetHashesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetHashesResponse.DiscardUnknown(m) + +func (*GetHashesResponse) ProtoMessage() {} + +func (x *GetHashesResponse) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetHashesResponse proto.InternalMessageInfo +// Deprecated: Use GetHashesResponse.ProtoReflect.Descriptor instead. +func (*GetHashesResponse) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{23} +} -func (m *GetHashesResponse) GetStatus() ResultStatus { - if m != nil { - return m.Status +func (x *GetHashesResponse) GetStatus() ResultStatus { + if x != nil { + return x.Status } return ResultStatus_OK } -func (m *GetHashesResponse) GetHashes() [][]byte { - if m != nil { - return m.Hashes +func (x *GetHashesResponse) GetHashes() [][]byte { + if x != nil { + return x.Hashes } return nil } -func (m *GetHashesResponse) GetHasNext() bool { - if m != nil { - return m.HasNext +func (x *GetHashesResponse) GetHasNext() bool { + if x != nil { + return x.HasNext } return false } // IssueCertificateRequest is message to block producer from agent type IssueCertificateRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *IssueCertificateRequest) Reset() { *m = IssueCertificateRequest{} } -func (m *IssueCertificateRequest) String() string { return proto.CompactTextString(m) } -func (*IssueCertificateRequest) ProtoMessage() {} -func (*IssueCertificateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{24} -} -func (m *IssueCertificateRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IssueCertificateRequest.Unmarshal(m, b) -} -func (m *IssueCertificateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IssueCertificateRequest.Marshal(b, m, deterministic) -} -func (dst *IssueCertificateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_IssueCertificateRequest.Merge(dst, src) +func (x *IssueCertificateRequest) Reset() { + *x = IssueCertificateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *IssueCertificateRequest) XXX_Size() int { - return xxx_messageInfo_IssueCertificateRequest.Size(m) + +func (x *IssueCertificateRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *IssueCertificateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_IssueCertificateRequest.DiscardUnknown(m) + +func (*IssueCertificateRequest) ProtoMessage() {} + +func (x *IssueCertificateRequest) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_IssueCertificateRequest proto.InternalMessageInfo +// Deprecated: Use IssueCertificateRequest.ProtoReflect.Descriptor instead. +func (*IssueCertificateRequest) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{24} +} // IssueCertificateResp is common message during handshake type IssueCertificateResponse struct { - Status ResultStatus `protobuf:"varint,1,opt,name=status,enum=types.ResultStatus" json:"status,omitempty"` - Certificate *AgentCertificate `protobuf:"bytes,2,opt,name=certificate" json:"certificate,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *IssueCertificateResponse) Reset() { *m = IssueCertificateResponse{} } -func (m *IssueCertificateResponse) String() string { return proto.CompactTextString(m) } -func (*IssueCertificateResponse) ProtoMessage() {} -func (*IssueCertificateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{25} -} -func (m *IssueCertificateResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IssueCertificateResponse.Unmarshal(m, b) + Status ResultStatus `protobuf:"varint,1,opt,name=status,proto3,enum=types.ResultStatus" json:"status,omitempty"` + Certificate *AgentCertificate `protobuf:"bytes,2,opt,name=certificate,proto3" json:"certificate,omitempty"` } -func (m *IssueCertificateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IssueCertificateResponse.Marshal(b, m, deterministic) -} -func (dst *IssueCertificateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_IssueCertificateResponse.Merge(dst, src) + +func (x *IssueCertificateResponse) Reset() { + *x = IssueCertificateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *IssueCertificateResponse) XXX_Size() int { - return xxx_messageInfo_IssueCertificateResponse.Size(m) + +func (x *IssueCertificateResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *IssueCertificateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_IssueCertificateResponse.DiscardUnknown(m) + +func (*IssueCertificateResponse) ProtoMessage() {} + +func (x *IssueCertificateResponse) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_IssueCertificateResponse proto.InternalMessageInfo +// Deprecated: Use IssueCertificateResponse.ProtoReflect.Descriptor instead. +func (*IssueCertificateResponse) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{25} +} -func (m *IssueCertificateResponse) GetStatus() ResultStatus { - if m != nil { - return m.Status +func (x *IssueCertificateResponse) GetStatus() ResultStatus { + if x != nil { + return x.Status } return ResultStatus_OK } -func (m *IssueCertificateResponse) GetCertificate() *AgentCertificate { - if m != nil { - return m.Certificate +func (x *IssueCertificateResponse) GetCertificate() *AgentCertificate { + if x != nil { + return x.Certificate } return nil } // CertificateRenewedNotice is sent when agent update hi certificate type CertificateRenewedNotice struct { - Certificate *AgentCertificate `protobuf:"bytes,2,opt,name=certificate" json:"certificate,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *CertificateRenewedNotice) Reset() { *m = CertificateRenewedNotice{} } -func (m *CertificateRenewedNotice) String() string { return proto.CompactTextString(m) } -func (*CertificateRenewedNotice) ProtoMessage() {} -func (*CertificateRenewedNotice) Descriptor() ([]byte, []int) { - return fileDescriptor_p2p_6496de2d566cf566, []int{26} -} -func (m *CertificateRenewedNotice) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CertificateRenewedNotice.Unmarshal(m, b) -} -func (m *CertificateRenewedNotice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CertificateRenewedNotice.Marshal(b, m, deterministic) + Certificate *AgentCertificate `protobuf:"bytes,2,opt,name=certificate,proto3" json:"certificate,omitempty"` } -func (dst *CertificateRenewedNotice) XXX_Merge(src proto.Message) { - xxx_messageInfo_CertificateRenewedNotice.Merge(dst, src) + +func (x *CertificateRenewedNotice) Reset() { + *x = CertificateRenewedNotice{} + if protoimpl.UnsafeEnabled { + mi := &file_p2p_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CertificateRenewedNotice) XXX_Size() int { - return xxx_messageInfo_CertificateRenewedNotice.Size(m) + +func (x *CertificateRenewedNotice) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CertificateRenewedNotice) XXX_DiscardUnknown() { - xxx_messageInfo_CertificateRenewedNotice.DiscardUnknown(m) + +func (*CertificateRenewedNotice) ProtoMessage() {} + +func (x *CertificateRenewedNotice) ProtoReflect() protoreflect.Message { + mi := &file_p2p_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CertificateRenewedNotice proto.InternalMessageInfo +// Deprecated: Use CertificateRenewedNotice.ProtoReflect.Descriptor instead. +func (*CertificateRenewedNotice) Descriptor() ([]byte, []int) { + return file_p2p_proto_rawDescGZIP(), []int{26} +} -func (m *CertificateRenewedNotice) GetCertificate() *AgentCertificate { - if m != nil { - return m.Certificate +func (x *CertificateRenewedNotice) GetCertificate() *AgentCertificate { + if x != nil { + return x.Certificate } return nil } -func init() { - proto.RegisterType((*MsgHeader)(nil), "types.MsgHeader") - proto.RegisterType((*P2PMessage)(nil), "types.P2PMessage") - proto.RegisterType((*Ping)(nil), "types.Ping") - proto.RegisterType((*Pong)(nil), "types.Pong") - proto.RegisterType((*Status)(nil), "types.Status") - proto.RegisterType((*GoAwayNotice)(nil), "types.GoAwayNotice") - proto.RegisterType((*AddressesRequest)(nil), "types.AddressesRequest") - proto.RegisterType((*AddressesResponse)(nil), "types.AddressesResponse") - proto.RegisterType((*NewBlockNotice)(nil), "types.NewBlockNotice") - proto.RegisterType((*BlockProducedNotice)(nil), "types.BlockProducedNotice") - proto.RegisterType((*GetBlockHeadersRequest)(nil), "types.GetBlockHeadersRequest") - proto.RegisterType((*GetBlockHeadersResponse)(nil), "types.GetBlockHeadersResponse") - proto.RegisterType((*GetBlockRequest)(nil), "types.GetBlockRequest") - proto.RegisterType((*GetBlockResponse)(nil), "types.GetBlockResponse") - proto.RegisterType((*NewTransactionsNotice)(nil), "types.NewTransactionsNotice") - proto.RegisterType((*GetTransactionsRequest)(nil), "types.GetTransactionsRequest") - proto.RegisterType((*GetTransactionsResponse)(nil), "types.GetTransactionsResponse") - proto.RegisterType((*GetMissingRequest)(nil), "types.GetMissingRequest") - proto.RegisterType((*GetAncestorRequest)(nil), "types.GetAncestorRequest") - proto.RegisterType((*GetAncestorResponse)(nil), "types.GetAncestorResponse") - proto.RegisterType((*GetHashByNo)(nil), "types.GetHashByNo") - proto.RegisterType((*GetHashByNoResponse)(nil), "types.GetHashByNoResponse") - proto.RegisterType((*GetHashesRequest)(nil), "types.GetHashesRequest") - proto.RegisterType((*GetHashesResponse)(nil), "types.GetHashesResponse") - proto.RegisterType((*IssueCertificateRequest)(nil), "types.IssueCertificateRequest") - proto.RegisterType((*IssueCertificateResponse)(nil), "types.IssueCertificateResponse") - proto.RegisterType((*CertificateRenewedNotice)(nil), "types.CertificateRenewedNotice") - proto.RegisterEnum("types.ResultStatus", ResultStatus_name, ResultStatus_value) -} - -func init() { proto.RegisterFile("p2p.proto", fileDescriptor_p2p_6496de2d566cf566) } - -var fileDescriptor_p2p_6496de2d566cf566 = []byte{ - // 1279 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6e, 0xdb, 0x46, - 0x13, 0xff, 0x28, 0xd9, 0xb2, 0x34, 0xa2, 0x6c, 0x7a, 0xfd, 0x25, 0x66, 0xdd, 0x20, 0x15, 0x88, - 0xa0, 0x55, 0xd3, 0x20, 0x28, 0x9c, 0x53, 0xd1, 0x13, 0x2d, 0x32, 0x12, 0x1b, 0x79, 0x29, 0xac, - 0xa4, 0x34, 0x3d, 0xa9, 0x94, 0xb4, 0x91, 0xd8, 0xda, 0xa4, 0xca, 0x5d, 0xc5, 0x76, 0x2e, 0x05, - 0x7a, 0xe8, 0x1b, 0xf4, 0x15, 0xfa, 0x18, 0x7d, 0x83, 0x3e, 0x52, 0x81, 0x62, 0x97, 0x4b, 0x89, - 0xb4, 0x93, 0x18, 0x35, 0x72, 0xdb, 0xf9, 0xc3, 0x99, 0xdf, 0xcc, 0xfc, 0x76, 0x96, 0x50, 0x5b, - 0x1e, 0x2f, 0x9f, 0x2e, 0x93, 0x98, 0xc7, 0x68, 0x9b, 0x5f, 0x2d, 0x29, 0x3b, 0x32, 0x26, 0x67, - 0xf1, 0xf4, 0xe7, 0xe9, 0x22, 0x08, 0xa3, 0xd4, 0x70, 0x04, 0x51, 0x3c, 0xa3, 0xe9, 0xd9, 0xfa, - 0x47, 0x83, 0xda, 0x29, 0x9b, 0x77, 0x69, 0x30, 0xa3, 0x09, 0x7a, 0x04, 0x8d, 0xe9, 0x59, 0x48, - 0x23, 0xfe, 0x92, 0x26, 0x2c, 0x8c, 0x23, 0x53, 0x6b, 0x6a, 0xad, 0x1a, 0x29, 0x2a, 0xd1, 0x03, - 0xa8, 0xf1, 0xf0, 0x9c, 0x32, 0x1e, 0x9c, 0x2f, 0xcd, 0x52, 0x53, 0x6b, 0x95, 0xc9, 0x46, 0x81, - 0x76, 0xa1, 0x14, 0xce, 0xcc, 0xb2, 0xfc, 0xb0, 0x14, 0xce, 0xd0, 0x7d, 0xa8, 0xcc, 0x63, 0xc6, - 0xc2, 0xa5, 0xb9, 0xd5, 0xd4, 0x5a, 0x55, 0xa2, 0x24, 0xa1, 0x5f, 0x52, 0x9a, 0x78, 0x8e, 0xb9, - 0xdd, 0xd4, 0x5a, 0x3a, 0x51, 0x12, 0x7a, 0x08, 0x12, 0x5f, 0x7f, 0x35, 0x79, 0x41, 0xaf, 0xcc, - 0x8a, 0xb4, 0xe5, 0x34, 0x08, 0xc1, 0x16, 0x0b, 0xe7, 0x91, 0xb9, 0x23, 0x2d, 0xf2, 0x8c, 0x9a, - 0x50, 0x67, 0xab, 0x89, 0xac, 0x68, 0x1a, 0x9f, 0x99, 0xd5, 0xa6, 0xd6, 0x6a, 0x90, 0xbc, 0x4a, - 0x64, 0x3b, 0xa3, 0xd1, 0x9c, 0x2f, 0xcc, 0x9a, 0x34, 0x2a, 0xc9, 0xfa, 0x0e, 0xa0, 0x7f, 0xdc, - 0x3f, 0xa5, 0x8c, 0x05, 0x73, 0x8a, 0x5a, 0x50, 0x59, 0xc8, 0x4e, 0xc8, 0xc2, 0xeb, 0xc7, 0xc6, - 0x53, 0xd9, 0xc3, 0xa7, 0xeb, 0x0e, 0x11, 0x65, 0x17, 0x28, 0x66, 0x01, 0x0f, 0x64, 0xf9, 0x3a, - 0x91, 0x67, 0xcb, 0x87, 0xad, 0x7e, 0x18, 0xcd, 0xd1, 0xe7, 0xb0, 0x37, 0xa1, 0x8c, 0x8f, 0x65, - 0xe3, 0xc7, 0x8b, 0x80, 0x2d, 0x64, 0x38, 0x9d, 0x34, 0x84, 0xfa, 0x44, 0x68, 0xbb, 0x01, 0x5b, - 0xa0, 0xcf, 0xa0, 0x2e, 0xfd, 0x16, 0x34, 0x9c, 0x2f, 0xb8, 0x0c, 0xb5, 0x45, 0x40, 0xa8, 0xba, - 0x52, 0x63, 0xf5, 0x60, 0xab, 0x1f, 0x47, 0x73, 0x31, 0x96, 0xc2, 0x97, 0xef, 0x0e, 0xf7, 0x10, - 0x72, 0xdf, 0xbe, 0x23, 0xda, 0xdf, 0x25, 0xa8, 0x0c, 0x78, 0xc0, 0x57, 0x0c, 0x3d, 0x86, 0x0a, - 0xa3, 0xd1, 0xa6, 0x4e, 0xa4, 0xea, 0xec, 0x53, 0x9a, 0xd8, 0xb3, 0x59, 0x42, 0x19, 0x23, 0xca, - 0xe3, 0x66, 0xf2, 0xd2, 0xed, 0xc9, 0xcb, 0xd7, 0x93, 0x23, 0x13, 0x76, 0x24, 0x05, 0x3d, 0x47, - 0xd2, 0x40, 0x27, 0x99, 0x88, 0x8e, 0xa0, 0x1a, 0xc5, 0xee, 0xe5, 0x32, 0x66, 0x54, 0x32, 0xa1, - 0x4a, 0xd6, 0xb2, 0xf8, 0xea, 0x8d, 0x62, 0x62, 0x45, 0x12, 0x2a, 0x13, 0x85, 0x65, 0x4e, 0x23, - 0xca, 0x42, 0xa6, 0x88, 0x90, 0x89, 0xe8, 0x5b, 0xd0, 0xa7, 0x34, 0xe1, 0xe1, 0xeb, 0x70, 0x1a, - 0x70, 0xca, 0xcc, 0x6a, 0xb3, 0xdc, 0xaa, 0x1f, 0x1f, 0xaa, 0x0a, 0xed, 0x39, 0x8d, 0x78, 0x7b, - 0x63, 0x27, 0x05, 0x67, 0xf4, 0x18, 0x8c, 0x90, 0xb1, 0x15, 0xcd, 0x79, 0x48, 0xc2, 0x54, 0xc9, - 0x0d, 0xbd, 0xd5, 0x02, 0xbd, 0x13, 0xdb, 0x17, 0xc1, 0x15, 0x8e, 0x79, 0x38, 0x95, 0x60, 0xcf, - 0x53, 0x1e, 0xa9, 0x6b, 0x93, 0x89, 0xd6, 0x2b, 0x30, 0x54, 0x57, 0x29, 0x23, 0xf4, 0x97, 0x15, - 0x65, 0xfc, 0x3f, 0x8d, 0x40, 0x44, 0x0e, 0x2e, 0x07, 0xe1, 0x5b, 0x2a, 0x9b, 0xdf, 0x20, 0x99, - 0x68, 0xfd, 0x04, 0xfb, 0xb9, 0xc8, 0x6c, 0x19, 0x47, 0x8c, 0xa2, 0xaf, 0xa0, 0xc2, 0xe4, 0x9c, - 0x65, 0xe8, 0xdd, 0xe3, 0x03, 0x15, 0x9a, 0x50, 0xb6, 0x3a, 0xe3, 0x29, 0x05, 0x88, 0x72, 0x41, - 0x2d, 0xd8, 0x16, 0x17, 0x8f, 0x99, 0x25, 0xd9, 0xa7, 0x77, 0xc1, 0x48, 0x1d, 0xac, 0x2e, 0xec, - 0x62, 0x7a, 0x21, 0x47, 0xae, 0x2a, 0x7e, 0x00, 0xb5, 0xc9, 0x35, 0x4e, 0x6e, 0x14, 0x02, 0xf5, - 0x24, 0x75, 0x56, 0x64, 0xcc, 0x44, 0x8b, 0xc1, 0x81, 0x0c, 0xd3, 0x4f, 0xe2, 0xd9, 0x6a, 0x4a, - 0x67, 0x2a, 0xdc, 0x43, 0x80, 0x65, 0xaa, 0x11, 0x5b, 0x21, 0x8d, 0x97, 0xd3, 0xbc, 0x3f, 0x20, - 0xb2, 0x60, 0x5b, 0x1e, 0x25, 0xf1, 0xea, 0xc7, 0xba, 0x2a, 0x42, 0x26, 0x21, 0xa9, 0xc9, 0xfa, - 0x4d, 0x83, 0xfb, 0x1d, 0xaa, 0x28, 0x2b, 0x2f, 0xf1, 0x7a, 0x16, 0x08, 0xb6, 0x72, 0xb7, 0x54, - 0x9e, 0xc5, 0xc2, 0x28, 0xdc, 0x4b, 0x25, 0x09, 0x7d, 0xfc, 0xfa, 0x35, 0xa3, 0x19, 0xc9, 0x95, - 0x94, 0xae, 0xa5, 0xb7, 0x54, 0xb2, 0xbb, 0x41, 0xe4, 0x19, 0x19, 0x50, 0x0e, 0xd8, 0x54, 0xb1, - 0x5a, 0x1c, 0xad, 0x3f, 0x35, 0x38, 0xbc, 0x01, 0xe2, 0x2e, 0x63, 0x13, 0xf0, 0x02, 0xb6, 0xa0, - 0xe9, 0xdc, 0x74, 0xa2, 0x24, 0xf4, 0x04, 0x76, 0xd2, 0x0d, 0xc5, 0xcc, 0x72, 0x61, 0xa0, 0xb9, - 0x94, 0x24, 0x73, 0x11, 0x1d, 0x5d, 0x04, 0x0c, 0xd3, 0x4b, 0xae, 0x96, 0x73, 0x26, 0x5a, 0x5f, - 0xc2, 0x5e, 0x86, 0x33, 0xeb, 0xd2, 0x26, 0xa5, 0x96, 0x4f, 0x69, 0xfd, 0x0a, 0xc6, 0xc6, 0xf5, - 0x2e, 0xb5, 0x3c, 0x82, 0x8a, 0x1c, 0x51, 0xc6, 0xc1, 0xe2, 0xf8, 0x94, 0x2d, 0x8f, 0xb5, 0x5c, - 0xc4, 0xfa, 0x0c, 0xee, 0x61, 0x7a, 0x31, 0x4c, 0x82, 0x88, 0x05, 0x53, 0x1e, 0xc6, 0x11, 0x53, - 0x84, 0x3a, 0x82, 0x2a, 0xbf, 0xec, 0xe6, 0x31, 0xaf, 0x65, 0xeb, 0x6b, 0xc9, 0x86, 0xfc, 0x47, - 0xb7, 0xd5, 0xf9, 0x47, 0x3a, 0xbb, 0xe2, 0x27, 0x1f, 0x73, 0x76, 0x9f, 0x42, 0x99, 0x5f, 0x66, - 0x73, 0xab, 0xa9, 0x08, 0xc3, 0x4b, 0x22, 0xb4, 0x1f, 0x18, 0x55, 0x07, 0xf6, 0x3b, 0x94, 0x9f, - 0x86, 0x8c, 0x85, 0xd1, 0xfc, 0x96, 0x22, 0x44, 0x4b, 0x18, 0x8f, 0x97, 0x8b, 0xcd, 0x22, 0x5f, - 0xcb, 0xd6, 0x13, 0x40, 0x1d, 0xca, 0xed, 0x68, 0x4a, 0x19, 0x8f, 0x93, 0xdb, 0xda, 0xf1, 0xbb, - 0x06, 0x07, 0x05, 0xf7, 0xbb, 0xb4, 0xc2, 0x02, 0x3d, 0x50, 0x01, 0x72, 0x6f, 0x4b, 0x41, 0x27, - 0xd6, 0x42, 0x26, 0xe3, 0x38, 0x7b, 0x5a, 0x36, 0x1a, 0xeb, 0x0b, 0xa8, 0x77, 0x28, 0x17, 0xae, - 0x27, 0x57, 0x38, 0xce, 0x6f, 0x09, 0xad, 0xb8, 0x76, 0x7e, 0x94, 0x80, 0x33, 0xc7, 0xbb, 0x01, - 0x2e, 0xac, 0xbc, 0xd2, 0xb5, 0x95, 0x67, 0x4d, 0xe4, 0x55, 0x48, 0x19, 0x96, 0xf5, 0xef, 0x08, - 0xaa, 0xcb, 0x84, 0xbe, 0xc9, 0xed, 0xc8, 0xb5, 0x9c, 0x6e, 0x3c, 0xfa, 0x06, 0xaf, 0xce, 0x27, - 0x34, 0xc9, 0x9e, 0xec, 0x8d, 0x66, 0xbd, 0x54, 0xd2, 0xa2, 0xe5, 0xd9, 0x4a, 0xe4, 0xb8, 0xb3, - 0x1c, 0x1f, 0x93, 0x7f, 0xef, 0xbf, 0x61, 0x9f, 0xc0, 0xa1, 0x77, 0xed, 0xf9, 0x53, 0xe5, 0x89, - 0xb5, 0x6a, 0xde, 0xb4, 0xdd, 0x05, 0xd6, 0x37, 0x50, 0xcf, 0xbd, 0xc5, 0xb2, 0x1b, 0x1f, 0x78, - 0xb7, 0xf3, 0xbe, 0xd6, 0x08, 0xcc, 0x42, 0xfa, 0x88, 0x5e, 0xac, 0x5f, 0x95, 0xbb, 0x87, 0x7d, - 0xfc, 0x57, 0x09, 0xf4, 0x3c, 0x54, 0x54, 0x81, 0x92, 0xff, 0xc2, 0xf8, 0x1f, 0xd2, 0xa1, 0xda, - 0xb6, 0x71, 0xdb, 0xed, 0xb9, 0x8e, 0xa1, 0xa1, 0x3a, 0xec, 0x8c, 0xf0, 0x0b, 0xec, 0x7f, 0x8f, - 0x8d, 0x12, 0xfa, 0x3f, 0x18, 0x1e, 0x7e, 0x69, 0xf7, 0x3c, 0x67, 0x6c, 0x93, 0xce, 0xe8, 0xd4, - 0xc5, 0x43, 0xa3, 0x8c, 0xee, 0xc1, 0xbe, 0xe3, 0xda, 0x4e, 0xcf, 0xc3, 0xee, 0xd8, 0x7d, 0xd5, - 0x76, 0x5d, 0xc7, 0x75, 0x8c, 0x2d, 0xd4, 0x80, 0x1a, 0xf6, 0x87, 0xe3, 0xe7, 0xfe, 0x08, 0x3b, - 0xc6, 0x36, 0x42, 0xb0, 0x6b, 0xf7, 0x88, 0x6b, 0x3b, 0x3f, 0x8c, 0xdd, 0x57, 0xde, 0x60, 0x38, - 0x30, 0x2a, 0xe2, 0xcb, 0xbe, 0x4b, 0x4e, 0xbd, 0xc1, 0xc0, 0xf3, 0xf1, 0xd8, 0x71, 0xb1, 0xe7, - 0x3a, 0xc6, 0x0e, 0xba, 0x0f, 0x88, 0xb8, 0x03, 0x7f, 0x44, 0xda, 0x22, 0x60, 0xd7, 0x1e, 0x0d, - 0x86, 0xae, 0x63, 0x54, 0xd1, 0x21, 0x1c, 0x3c, 0xb7, 0xbd, 0x9e, 0xeb, 0x8c, 0xfb, 0xc4, 0x6d, - 0xfb, 0xd8, 0xf1, 0x86, 0x9e, 0x8f, 0x8d, 0x9a, 0x00, 0x69, 0x9f, 0xf8, 0x44, 0x78, 0x01, 0x32, - 0x40, 0xf7, 0x47, 0xc3, 0xb1, 0xff, 0x7c, 0x4c, 0x6c, 0xdc, 0x71, 0x8d, 0x3a, 0xda, 0x87, 0xc6, - 0x08, 0x7b, 0xa7, 0xfd, 0x9e, 0x2b, 0x10, 0xbb, 0x8e, 0xa1, 0x8b, 0x22, 0x3d, 0x3c, 0x74, 0x09, - 0xb6, 0x7b, 0x46, 0x03, 0xed, 0x41, 0x7d, 0x84, 0xed, 0x97, 0xb6, 0xd7, 0xb3, 0x4f, 0x7a, 0xae, - 0xb1, 0x2b, 0xb0, 0x3b, 0xf6, 0xd0, 0x1e, 0xf7, 0xfc, 0xc1, 0xc0, 0xd8, 0x43, 0x07, 0xb0, 0x37, - 0xc2, 0xf6, 0x68, 0xd8, 0x75, 0xf1, 0xd0, 0x6b, 0xdb, 0x22, 0x84, 0x31, 0xa9, 0xc8, 0xff, 0xef, - 0x67, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xcc, 0xa1, 0xfe, 0x94, 0x96, 0x0c, 0x00, 0x00, +var File_p2p_proto protoreflect.FileDescriptor + +var file_p2p_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x70, 0x32, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x1a, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xfd, 0x01, 0x0a, 0x09, 0x4d, 0x73, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x24, + 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x65, + 0x65, 0x72, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, + 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x50, 0x75, 0x62, 0x4b, + 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x75, 0x62, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x73, 0x75, 0x62, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x22, 0x4a, 0x0a, 0x0a, 0x50, 0x32, 0x50, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x28, + 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x73, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x4f, 0x0a, 0x04, + 0x50, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x62, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x62, + 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x0b, + 0x62, 0x65, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0a, 0x62, 0x65, 0x73, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x4c, 0x0a, + 0x04, 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x62, 0x65, + 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x62, + 0x65, 0x73, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0a, 0x62, 0x65, 0x73, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xcd, 0x02, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, + 0x65, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x62, 0x65, 0x73, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x65, 0x73, 0x74, + 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x62, 0x65, + 0x73, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x6f, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x6f, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, + 0x73, 0x69, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x73, + 0x69, 0x73, 0x12, 0x3b, 0x0a, 0x0c, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x52, 0x0c, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x12, + 0x2a, 0x0a, 0x10, 0x69, 0x73, 0x73, 0x75, 0x65, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x73, 0x73, 0x75, 0x65, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x28, 0x0a, 0x0c, 0x47, + 0x6f, 0x41, 0x77, 0x61, 0x79, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x58, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x06, 0x73, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x22, + 0x6a, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x28, 0x0a, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x52, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x22, 0x48, 0x0a, 0x0e, 0x4e, + 0x65, 0x77, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x22, 0x73, 0x0a, 0x13, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x50, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, + 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x12, 0x22, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x82, 0x01, 0x0a, 0x16, 0x47, + 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x61, 0x73, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x73, 0x63, 0x22, + 0xa6, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, + 0x12, 0x2c, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x18, + 0x0a, 0x07, 0x68, 0x61, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x68, 0x61, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x22, 0x29, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, + 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, + 0x68, 0x65, 0x73, 0x22, 0x7f, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x61, + 0x73, 0x4e, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, + 0x4e, 0x65, 0x78, 0x74, 0x22, 0x33, 0x0a, 0x15, 0x4e, 0x65, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x08, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x30, 0x0a, 0x16, 0x47, 0x65, 0x74, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x95, 0x01, 0x0a, 0x17, + 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x03, + 0x74, 0x78, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x54, 0x78, 0x52, 0x03, 0x74, 0x78, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x61, 0x73, + 0x4e, 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4e, + 0x65, 0x78, 0x74, 0x22, 0x47, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, + 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x74, 0x6f, 0x70, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x08, 0x73, 0x74, 0x6f, 0x70, 0x68, 0x61, 0x73, 0x68, 0x22, 0x2c, 0x0a, 0x12, + 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x22, 0x86, 0x01, 0x0a, 0x13, 0x47, + 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x22, 0x0a, 0x0c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x48, 0x61, 0x73, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x4e, + 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, + 0x72, 0x4e, 0x6f, 0x22, 0x27, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x48, 0x61, 0x73, 0x68, 0x42, 0x79, + 0x4e, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x22, 0x60, 0x0a, 0x13, + 0x47, 0x65, 0x74, 0x48, 0x61, 0x73, 0x68, 0x42, 0x79, 0x4e, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0x62, + 0x0a, 0x10, 0x47, 0x65, 0x74, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x70, 0x72, 0x65, 0x76, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1e, + 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, + 0x7a, 0x65, 0x22, 0x72, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x68, 0x61, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, + 0x61, 0x73, 0x4e, 0x65, 0x78, 0x74, 0x22, 0x19, 0x0a, 0x17, 0x49, 0x73, 0x73, 0x75, 0x65, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x82, 0x01, 0x0a, 0x18, 0x49, 0x73, 0x73, 0x75, 0x65, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, + 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x63, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0x55, 0x0a, 0x18, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6e, 0x65, 0x77, 0x65, 0x64, 0x4e, 0x6f, 0x74, 0x69, + 0x63, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2a, 0xbe, 0x02, + 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x06, + 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, + 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x02, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47, + 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x45, 0x41, 0x44, 0x4c, + 0x49, 0x4e, 0x45, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x04, 0x12, 0x0d, + 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x05, 0x12, 0x12, 0x0a, + 0x0e, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, + 0x06, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, + 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, 0x07, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x53, 0x4f, + 0x55, 0x52, 0x43, 0x45, 0x5f, 0x45, 0x58, 0x48, 0x41, 0x55, 0x53, 0x54, 0x45, 0x44, 0x10, 0x08, + 0x12, 0x17, 0x0a, 0x13, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x50, 0x52, 0x45, 0x43, 0x4f, + 0x4e, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x09, 0x12, 0x0b, 0x0a, 0x07, 0x41, 0x42, 0x4f, + 0x52, 0x54, 0x45, 0x44, 0x10, 0x0a, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, + 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x0b, 0x12, 0x11, 0x0a, 0x0d, 0x55, 0x4e, 0x49, 0x4d, + 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, 0x0c, 0x12, 0x0c, 0x0a, 0x08, 0x49, + 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x10, 0x0d, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x41, + 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x0e, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x41, + 0x54, 0x41, 0x5f, 0x4c, 0x4f, 0x53, 0x53, 0x10, 0x0f, 0x12, 0x13, 0x0a, 0x0f, 0x55, 0x4e, 0x41, + 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x45, 0x44, 0x10, 0x10, 0x42, 0x08, + 0x5a, 0x06, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_p2p_proto_rawDescOnce sync.Once + file_p2p_proto_rawDescData = file_p2p_proto_rawDesc +) + +func file_p2p_proto_rawDescGZIP() []byte { + file_p2p_proto_rawDescOnce.Do(func() { + file_p2p_proto_rawDescData = protoimpl.X.CompressGZIP(file_p2p_proto_rawDescData) + }) + return file_p2p_proto_rawDescData +} + +var file_p2p_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_p2p_proto_msgTypes = make([]protoimpl.MessageInfo, 27) +var file_p2p_proto_goTypes = []interface{}{ + (ResultStatus)(0), // 0: types.ResultStatus + (*MsgHeader)(nil), // 1: types.MsgHeader + (*P2PMessage)(nil), // 2: types.P2PMessage + (*Ping)(nil), // 3: types.Ping + (*Pong)(nil), // 4: types.Pong + (*Status)(nil), // 5: types.Status + (*GoAwayNotice)(nil), // 6: types.GoAwayNotice + (*AddressesRequest)(nil), // 7: types.AddressesRequest + (*AddressesResponse)(nil), // 8: types.AddressesResponse + (*NewBlockNotice)(nil), // 9: types.NewBlockNotice + (*BlockProducedNotice)(nil), // 10: types.BlockProducedNotice + (*GetBlockHeadersRequest)(nil), // 11: types.GetBlockHeadersRequest + (*GetBlockHeadersResponse)(nil), // 12: types.GetBlockHeadersResponse + (*GetBlockRequest)(nil), // 13: types.GetBlockRequest + (*GetBlockResponse)(nil), // 14: types.GetBlockResponse + (*NewTransactionsNotice)(nil), // 15: types.NewTransactionsNotice + (*GetTransactionsRequest)(nil), // 16: types.GetTransactionsRequest + (*GetTransactionsResponse)(nil), // 17: types.GetTransactionsResponse + (*GetMissingRequest)(nil), // 18: types.GetMissingRequest + (*GetAncestorRequest)(nil), // 19: types.GetAncestorRequest + (*GetAncestorResponse)(nil), // 20: types.GetAncestorResponse + (*GetHashByNo)(nil), // 21: types.GetHashByNo + (*GetHashByNoResponse)(nil), // 22: types.GetHashByNoResponse + (*GetHashesRequest)(nil), // 23: types.GetHashesRequest + (*GetHashesResponse)(nil), // 24: types.GetHashesResponse + (*IssueCertificateRequest)(nil), // 25: types.IssueCertificateRequest + (*IssueCertificateResponse)(nil), // 26: types.IssueCertificateResponse + (*CertificateRenewedNotice)(nil), // 27: types.CertificateRenewedNotice + (*PeerAddress)(nil), // 28: types.PeerAddress + (*AgentCertificate)(nil), // 29: types.AgentCertificate + (*Block)(nil), // 30: types.Block + (*BlockHeader)(nil), // 31: types.BlockHeader + (*Tx)(nil), // 32: types.Tx +} +var file_p2p_proto_depIdxs = []int32{ + 1, // 0: types.P2PMessage.header:type_name -> types.MsgHeader + 28, // 1: types.Status.sender:type_name -> types.PeerAddress + 29, // 2: types.Status.certificates:type_name -> types.AgentCertificate + 28, // 3: types.AddressesRequest.sender:type_name -> types.PeerAddress + 0, // 4: types.AddressesResponse.status:type_name -> types.ResultStatus + 28, // 5: types.AddressesResponse.peers:type_name -> types.PeerAddress + 30, // 6: types.BlockProducedNotice.block:type_name -> types.Block + 0, // 7: types.GetBlockHeadersResponse.status:type_name -> types.ResultStatus + 31, // 8: types.GetBlockHeadersResponse.headers:type_name -> types.BlockHeader + 0, // 9: types.GetBlockResponse.status:type_name -> types.ResultStatus + 30, // 10: types.GetBlockResponse.blocks:type_name -> types.Block + 0, // 11: types.GetTransactionsResponse.status:type_name -> types.ResultStatus + 32, // 12: types.GetTransactionsResponse.txs:type_name -> types.Tx + 0, // 13: types.GetAncestorResponse.status:type_name -> types.ResultStatus + 0, // 14: types.GetHashByNoResponse.status:type_name -> types.ResultStatus + 0, // 15: types.GetHashesResponse.status:type_name -> types.ResultStatus + 0, // 16: types.IssueCertificateResponse.status:type_name -> types.ResultStatus + 29, // 17: types.IssueCertificateResponse.certificate:type_name -> types.AgentCertificate + 29, // 18: types.CertificateRenewedNotice.certificate:type_name -> types.AgentCertificate + 19, // [19:19] is the sub-list for method output_type + 19, // [19:19] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name +} + +func init() { file_p2p_proto_init() } +func file_p2p_proto_init() { + if File_p2p_proto != nil { + return + } + file_blockchain_proto_init() + file_node_proto_init() + if !protoimpl.UnsafeEnabled { + file_p2p_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*P2PMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ping); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pong); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Status); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GoAwayNotice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddressesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddressesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NewBlockNotice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockProducedNotice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBlockHeadersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBlockHeadersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetBlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NewTransactionsNotice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTransactionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTransactionsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMissingRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAncestorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAncestorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetHashByNo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetHashByNoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetHashesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetHashesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IssueCertificateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IssueCertificateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_p2p_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertificateRenewedNotice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_p2p_proto_rawDesc, + NumEnums: 1, + NumMessages: 27, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_p2p_proto_goTypes, + DependencyIndexes: file_p2p_proto_depIdxs, + EnumInfos: file_p2p_proto_enumTypes, + MessageInfos: file_p2p_proto_msgTypes, + }.Build() + File_p2p_proto = out.File + file_p2p_proto_rawDesc = nil + file_p2p_proto_goTypes = nil + file_p2p_proto_depIdxs = nil } diff --git a/types/pmap.pb.go b/types/pmap.pb.go index 8b074df48..b3155e1b8 100644 --- a/types/pmap.pb.go +++ b/types/pmap.pb.go @@ -1,162 +1,265 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.15.8 // source: pmap.proto package types -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // query to polaris type MapQuery struct { - Status *Status `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"` - AddMe bool `protobuf:"varint,2,opt,name=addMe" json:"addMe,omitempty"` - Size int32 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"` - Excludes [][]byte `protobuf:"bytes,4,rep,name=excludes,proto3" json:"excludes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MapQuery) Reset() { *m = MapQuery{} } -func (m *MapQuery) String() string { return proto.CompactTextString(m) } -func (*MapQuery) ProtoMessage() {} -func (*MapQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_pmap_34fd0f2e9b6a5bb5, []int{0} -} -func (m *MapQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MapQuery.Unmarshal(m, b) -} -func (m *MapQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MapQuery.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + AddMe bool `protobuf:"varint,2,opt,name=addMe,proto3" json:"addMe,omitempty"` + Size int32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` + Excludes [][]byte `protobuf:"bytes,4,rep,name=excludes,proto3" json:"excludes,omitempty"` } -func (dst *MapQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_MapQuery.Merge(dst, src) + +func (x *MapQuery) Reset() { + *x = MapQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_pmap_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MapQuery) XXX_Size() int { - return xxx_messageInfo_MapQuery.Size(m) + +func (x *MapQuery) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MapQuery) XXX_DiscardUnknown() { - xxx_messageInfo_MapQuery.DiscardUnknown(m) + +func (*MapQuery) ProtoMessage() {} + +func (x *MapQuery) ProtoReflect() protoreflect.Message { + mi := &file_pmap_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_MapQuery proto.InternalMessageInfo +// Deprecated: Use MapQuery.ProtoReflect.Descriptor instead. +func (*MapQuery) Descriptor() ([]byte, []int) { + return file_pmap_proto_rawDescGZIP(), []int{0} +} -func (m *MapQuery) GetStatus() *Status { - if m != nil { - return m.Status +func (x *MapQuery) GetStatus() *Status { + if x != nil { + return x.Status } return nil } -func (m *MapQuery) GetAddMe() bool { - if m != nil { - return m.AddMe +func (x *MapQuery) GetAddMe() bool { + if x != nil { + return x.AddMe } return false } -func (m *MapQuery) GetSize() int32 { - if m != nil { - return m.Size +func (x *MapQuery) GetSize() int32 { + if x != nil { + return x.Size } return 0 } -func (m *MapQuery) GetExcludes() [][]byte { - if m != nil { - return m.Excludes +func (x *MapQuery) GetExcludes() [][]byte { + if x != nil { + return x.Excludes } return nil } type MapResponse struct { - Status ResultStatus `protobuf:"varint,1,opt,name=status,enum=types.ResultStatus" json:"status,omitempty"` - Addresses []*PeerAddress `protobuf:"bytes,2,rep,name=addresses" json:"addresses,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *MapResponse) Reset() { *m = MapResponse{} } -func (m *MapResponse) String() string { return proto.CompactTextString(m) } -func (*MapResponse) ProtoMessage() {} -func (*MapResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_pmap_34fd0f2e9b6a5bb5, []int{1} -} -func (m *MapResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MapResponse.Unmarshal(m, b) + Status ResultStatus `protobuf:"varint,1,opt,name=status,proto3,enum=types.ResultStatus" json:"status,omitempty"` + Addresses []*PeerAddress `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` } -func (m *MapResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MapResponse.Marshal(b, m, deterministic) -} -func (dst *MapResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MapResponse.Merge(dst, src) + +func (x *MapResponse) Reset() { + *x = MapResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pmap_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MapResponse) XXX_Size() int { - return xxx_messageInfo_MapResponse.Size(m) + +func (x *MapResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MapResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MapResponse.DiscardUnknown(m) + +func (*MapResponse) ProtoMessage() {} + +func (x *MapResponse) ProtoReflect() protoreflect.Message { + mi := &file_pmap_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_MapResponse proto.InternalMessageInfo +// Deprecated: Use MapResponse.ProtoReflect.Descriptor instead. +func (*MapResponse) Descriptor() ([]byte, []int) { + return file_pmap_proto_rawDescGZIP(), []int{1} +} -func (m *MapResponse) GetStatus() ResultStatus { - if m != nil { - return m.Status +func (x *MapResponse) GetStatus() ResultStatus { + if x != nil { + return x.Status } return ResultStatus_OK } -func (m *MapResponse) GetAddresses() []*PeerAddress { - if m != nil { - return m.Addresses +func (x *MapResponse) GetAddresses() []*PeerAddress { + if x != nil { + return x.Addresses } return nil } -func (m *MapResponse) GetMessage() string { - if m != nil { - return m.Message +func (x *MapResponse) GetMessage() string { + if x != nil { + return x.Message } return "" } -func init() { - proto.RegisterType((*MapQuery)(nil), "types.MapQuery") - proto.RegisterType((*MapResponse)(nil), "types.MapResponse") -} - -func init() { proto.RegisterFile("pmap.proto", fileDescriptor_pmap_34fd0f2e9b6a5bb5) } - -var fileDescriptor_pmap_34fd0f2e9b6a5bb5 = []byte{ - // 228 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x51, 0x4a, 0xc4, 0x40, - 0x10, 0x44, 0x99, 0xcd, 0x66, 0x4d, 0x3a, 0xea, 0x47, 0xeb, 0xc7, 0x90, 0xaf, 0x61, 0x41, 0x18, - 0x10, 0x82, 0xc4, 0x13, 0x78, 0x80, 0x80, 0xb6, 0x27, 0x18, 0x9d, 0x46, 0x84, 0xdd, 0x4d, 0x93, - 0x9e, 0xa0, 0xeb, 0x01, 0x3c, 0xb7, 0x90, 0x44, 0x45, 0xff, 0xa6, 0xea, 0xd5, 0x50, 0x45, 0x03, - 0xc8, 0x3e, 0x48, 0x23, 0x43, 0x9f, 0x7a, 0xcc, 0xd3, 0x51, 0x58, 0x6b, 0x38, 0xf4, 0x91, 0x67, - 0xab, 0x2e, 0xa5, 0x5d, 0xe8, 0xf6, 0x0d, 0x8a, 0x2e, 0xc8, 0xc3, 0xc8, 0xc3, 0x11, 0xaf, 0x60, - 0xa3, 0x29, 0xa4, 0x51, 0xad, 0x71, 0xc6, 0x57, 0xed, 0x59, 0x33, 0x7d, 0x6d, 0x1e, 0x27, 0x93, - 0x16, 0x88, 0x97, 0x90, 0x87, 0x18, 0x3b, 0xb6, 0x2b, 0x67, 0x7c, 0x41, 0xb3, 0x40, 0x84, 0xb5, - 0xbe, 0x7e, 0xb0, 0xcd, 0x9c, 0xf1, 0x39, 0x4d, 0x6f, 0xac, 0xa1, 0xe0, 0xf7, 0xe7, 0xdd, 0x18, - 0x59, 0xed, 0xda, 0x65, 0xfe, 0x94, 0x7e, 0xf4, 0xf6, 0xd3, 0x40, 0xd5, 0x05, 0x21, 0x56, 0xe9, - 0x0f, 0xca, 0x78, 0xfd, 0xa7, 0xfc, 0xbc, 0xbd, 0x58, 0xca, 0x89, 0x75, 0xdc, 0xa5, 0x7f, 0x13, - 0x6e, 0xa0, 0x0c, 0x31, 0x0e, 0xac, 0xca, 0x6a, 0x57, 0x2e, 0xf3, 0x55, 0x8b, 0x4b, 0xfe, 0x9e, - 0x79, 0xb8, 0x9b, 0x19, 0xfd, 0x86, 0xd0, 0xc2, 0xc9, 0x9e, 0x55, 0xc3, 0xcb, 0xbc, 0xb0, 0xa4, - 0x6f, 0xf9, 0xb4, 0x99, 0x0e, 0x71, 0xfb, 0x15, 0x00, 0x00, 0xff, 0xff, 0x62, 0x00, 0xba, 0x72, - 0x34, 0x01, 0x00, 0x00, +var File_pmap_proto protoreflect.FileDescriptor + +var file_pmap_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x70, 0x6d, 0x61, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x1a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x09, 0x70, 0x32, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x77, 0x0a, 0x08, 0x4d, 0x61, + 0x70, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x25, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x61, 0x64, 0x64, 0x4d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x61, 0x64, + 0x64, 0x4d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x63, 0x6c, 0x75, + 0x64, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x65, 0x78, 0x63, 0x6c, 0x75, + 0x64, 0x65, 0x73, 0x22, 0x86, 0x01, 0x0a, 0x0b, 0x4d, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x30, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x08, 0x5a, 0x06, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pmap_proto_rawDescOnce sync.Once + file_pmap_proto_rawDescData = file_pmap_proto_rawDesc +) + +func file_pmap_proto_rawDescGZIP() []byte { + file_pmap_proto_rawDescOnce.Do(func() { + file_pmap_proto_rawDescData = protoimpl.X.CompressGZIP(file_pmap_proto_rawDescData) + }) + return file_pmap_proto_rawDescData +} + +var file_pmap_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_pmap_proto_goTypes = []interface{}{ + (*MapQuery)(nil), // 0: types.MapQuery + (*MapResponse)(nil), // 1: types.MapResponse + (*Status)(nil), // 2: types.Status + (ResultStatus)(0), // 3: types.ResultStatus + (*PeerAddress)(nil), // 4: types.PeerAddress +} +var file_pmap_proto_depIdxs = []int32{ + 2, // 0: types.MapQuery.status:type_name -> types.Status + 3, // 1: types.MapResponse.status:type_name -> types.ResultStatus + 4, // 2: types.MapResponse.addresses:type_name -> types.PeerAddress + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_pmap_proto_init() } +func file_pmap_proto_init() { + if File_pmap_proto != nil { + return + } + file_node_proto_init() + file_p2p_proto_init() + if !protoimpl.UnsafeEnabled { + file_pmap_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MapQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pmap_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MapResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pmap_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pmap_proto_goTypes, + DependencyIndexes: file_pmap_proto_depIdxs, + MessageInfos: file_pmap_proto_msgTypes, + }.Build() + File_pmap_proto = out.File + file_pmap_proto_rawDesc = nil + file_pmap_proto_goTypes = nil + file_pmap_proto_depIdxs = nil } diff --git a/types/polarrpc.pb.go b/types/polarrpc.pb.go index bfb286fea..0c249db0d 100644 --- a/types/polarrpc.pb.go +++ b/types/polarrpc.pb.go @@ -1,681 +1,604 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.15.8 // source: polarrpc.proto package types -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type Paginations struct { - Ref []byte `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` - Size uint32 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Paginations) Reset() { *m = Paginations{} } -func (m *Paginations) String() string { return proto.CompactTextString(m) } -func (*Paginations) ProtoMessage() {} -func (*Paginations) Descriptor() ([]byte, []int) { - return fileDescriptor_polarrpc_1f6dae6536e3253f, []int{0} + Ref []byte `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"` + Size uint32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` } -func (m *Paginations) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Paginations.Unmarshal(m, b) -} -func (m *Paginations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Paginations.Marshal(b, m, deterministic) -} -func (dst *Paginations) XXX_Merge(src proto.Message) { - xxx_messageInfo_Paginations.Merge(dst, src) + +func (x *Paginations) Reset() { + *x = Paginations{} + if protoimpl.UnsafeEnabled { + mi := &file_polarrpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Paginations) XXX_Size() int { - return xxx_messageInfo_Paginations.Size(m) + +func (x *Paginations) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Paginations) XXX_DiscardUnknown() { - xxx_messageInfo_Paginations.DiscardUnknown(m) + +func (*Paginations) ProtoMessage() {} + +func (x *Paginations) ProtoReflect() protoreflect.Message { + mi := &file_polarrpc_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Paginations proto.InternalMessageInfo +// Deprecated: Use Paginations.ProtoReflect.Descriptor instead. +func (*Paginations) Descriptor() ([]byte, []int) { + return file_polarrpc_proto_rawDescGZIP(), []int{0} +} -func (m *Paginations) GetRef() []byte { - if m != nil { - return m.Ref +func (x *Paginations) GetRef() []byte { + if x != nil { + return x.Ref } return nil } -func (m *Paginations) GetSize() uint32 { - if m != nil { - return m.Size +func (x *Paginations) GetSize() uint32 { + if x != nil { + return x.Size } return 0 } type PolarisPeerList struct { - Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"` - HasNext bool `protobuf:"varint,2,opt,name=hasNext" json:"hasNext,omitempty"` - Peers []*PolarisPeer `protobuf:"bytes,3,rep,name=peers" json:"peers,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *PolarisPeerList) Reset() { *m = PolarisPeerList{} } -func (m *PolarisPeerList) String() string { return proto.CompactTextString(m) } -func (*PolarisPeerList) ProtoMessage() {} -func (*PolarisPeerList) Descriptor() ([]byte, []int) { - return fileDescriptor_polarrpc_1f6dae6536e3253f, []int{1} -} -func (m *PolarisPeerList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PolarisPeerList.Unmarshal(m, b) + Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + HasNext bool `protobuf:"varint,2,opt,name=hasNext,proto3" json:"hasNext,omitempty"` + Peers []*PolarisPeer `protobuf:"bytes,3,rep,name=peers,proto3" json:"peers,omitempty"` } -func (m *PolarisPeerList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PolarisPeerList.Marshal(b, m, deterministic) -} -func (dst *PolarisPeerList) XXX_Merge(src proto.Message) { - xxx_messageInfo_PolarisPeerList.Merge(dst, src) + +func (x *PolarisPeerList) Reset() { + *x = PolarisPeerList{} + if protoimpl.UnsafeEnabled { + mi := &file_polarrpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PolarisPeerList) XXX_Size() int { - return xxx_messageInfo_PolarisPeerList.Size(m) + +func (x *PolarisPeerList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PolarisPeerList) XXX_DiscardUnknown() { - xxx_messageInfo_PolarisPeerList.DiscardUnknown(m) + +func (*PolarisPeerList) ProtoMessage() {} + +func (x *PolarisPeerList) ProtoReflect() protoreflect.Message { + mi := &file_polarrpc_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PolarisPeerList proto.InternalMessageInfo +// Deprecated: Use PolarisPeerList.ProtoReflect.Descriptor instead. +func (*PolarisPeerList) Descriptor() ([]byte, []int) { + return file_polarrpc_proto_rawDescGZIP(), []int{1} +} -func (m *PolarisPeerList) GetTotal() uint32 { - if m != nil { - return m.Total +func (x *PolarisPeerList) GetTotal() uint32 { + if x != nil { + return x.Total } return 0 } -func (m *PolarisPeerList) GetHasNext() bool { - if m != nil { - return m.HasNext +func (x *PolarisPeerList) GetHasNext() bool { + if x != nil { + return x.HasNext } return false } -func (m *PolarisPeerList) GetPeers() []*PolarisPeer { - if m != nil { - return m.Peers +func (x *PolarisPeerList) GetPeers() []*PolarisPeer { + if x != nil { + return x.Peers } return nil } type PolarisPeer struct { - Address *PeerAddress `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` - Connected int64 `protobuf:"varint,2,opt,name=connected" json:"connected,omitempty"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address *PeerAddress `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Connected int64 `protobuf:"varint,2,opt,name=connected,proto3" json:"connected,omitempty"` // lastCheck contains unix timestamp with nanoseconds precision - LastCheck int64 `protobuf:"varint,3,opt,name=lastCheck" json:"lastCheck,omitempty"` - Verion string `protobuf:"bytes,4,opt,name=verion" json:"verion,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + LastCheck int64 `protobuf:"varint,3,opt,name=lastCheck,proto3" json:"lastCheck,omitempty"` + Verion string `protobuf:"bytes,4,opt,name=verion,proto3" json:"verion,omitempty"` } -func (m *PolarisPeer) Reset() { *m = PolarisPeer{} } -func (m *PolarisPeer) String() string { return proto.CompactTextString(m) } -func (*PolarisPeer) ProtoMessage() {} -func (*PolarisPeer) Descriptor() ([]byte, []int) { - return fileDescriptor_polarrpc_1f6dae6536e3253f, []int{2} -} -func (m *PolarisPeer) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PolarisPeer.Unmarshal(m, b) -} -func (m *PolarisPeer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PolarisPeer.Marshal(b, m, deterministic) -} -func (dst *PolarisPeer) XXX_Merge(src proto.Message) { - xxx_messageInfo_PolarisPeer.Merge(dst, src) +func (x *PolarisPeer) Reset() { + *x = PolarisPeer{} + if protoimpl.UnsafeEnabled { + mi := &file_polarrpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PolarisPeer) XXX_Size() int { - return xxx_messageInfo_PolarisPeer.Size(m) + +func (x *PolarisPeer) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PolarisPeer) XXX_DiscardUnknown() { - xxx_messageInfo_PolarisPeer.DiscardUnknown(m) + +func (*PolarisPeer) ProtoMessage() {} + +func (x *PolarisPeer) ProtoReflect() protoreflect.Message { + mi := &file_polarrpc_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PolarisPeer proto.InternalMessageInfo +// Deprecated: Use PolarisPeer.ProtoReflect.Descriptor instead. +func (*PolarisPeer) Descriptor() ([]byte, []int) { + return file_polarrpc_proto_rawDescGZIP(), []int{2} +} -func (m *PolarisPeer) GetAddress() *PeerAddress { - if m != nil { - return m.Address +func (x *PolarisPeer) GetAddress() *PeerAddress { + if x != nil { + return x.Address } return nil } -func (m *PolarisPeer) GetConnected() int64 { - if m != nil { - return m.Connected +func (x *PolarisPeer) GetConnected() int64 { + if x != nil { + return x.Connected } return 0 } -func (m *PolarisPeer) GetLastCheck() int64 { - if m != nil { - return m.LastCheck +func (x *PolarisPeer) GetLastCheck() int64 { + if x != nil { + return x.LastCheck } return 0 } -func (m *PolarisPeer) GetVerion() string { - if m != nil { - return m.Verion +func (x *PolarisPeer) GetVerion() string { + if x != nil { + return x.Verion } return "" } type BLConfEntries struct { - Enabled bool `protobuf:"varint,1,opt,name=enabled" json:"enabled,omitempty"` - Entries []string `protobuf:"bytes,2,rep,name=entries" json:"entries,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BLConfEntries) Reset() { *m = BLConfEntries{} } -func (m *BLConfEntries) String() string { return proto.CompactTextString(m) } -func (*BLConfEntries) ProtoMessage() {} -func (*BLConfEntries) Descriptor() ([]byte, []int) { - return fileDescriptor_polarrpc_1f6dae6536e3253f, []int{3} -} -func (m *BLConfEntries) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BLConfEntries.Unmarshal(m, b) -} -func (m *BLConfEntries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BLConfEntries.Marshal(b, m, deterministic) -} -func (dst *BLConfEntries) XXX_Merge(src proto.Message) { - xxx_messageInfo_BLConfEntries.Merge(dst, src) -} -func (m *BLConfEntries) XXX_Size() int { - return xxx_messageInfo_BLConfEntries.Size(m) -} -func (m *BLConfEntries) XXX_DiscardUnknown() { - xxx_messageInfo_BLConfEntries.DiscardUnknown(m) -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -var xxx_messageInfo_BLConfEntries proto.InternalMessageInfo - -func (m *BLConfEntries) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + Entries []string `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` } -func (m *BLConfEntries) GetEntries() []string { - if m != nil { - return m.Entries +func (x *BLConfEntries) Reset() { + *x = BLConfEntries{} + if protoimpl.UnsafeEnabled { + mi := &file_polarrpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil -} - -type AddEntryParams struct { - PeerID string `protobuf:"bytes,1,opt,name=peerID" json:"peerID,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"` - Cidr string `protobuf:"bytes,3,opt,name=cidr" json:"cidr,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *AddEntryParams) Reset() { *m = AddEntryParams{} } -func (m *AddEntryParams) String() string { return proto.CompactTextString(m) } -func (*AddEntryParams) ProtoMessage() {} -func (*AddEntryParams) Descriptor() ([]byte, []int) { - return fileDescriptor_polarrpc_1f6dae6536e3253f, []int{4} -} -func (m *AddEntryParams) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddEntryParams.Unmarshal(m, b) -} -func (m *AddEntryParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddEntryParams.Marshal(b, m, deterministic) -} -func (dst *AddEntryParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddEntryParams.Merge(dst, src) -} -func (m *AddEntryParams) XXX_Size() int { - return xxx_messageInfo_AddEntryParams.Size(m) -} -func (m *AddEntryParams) XXX_DiscardUnknown() { - xxx_messageInfo_AddEntryParams.DiscardUnknown(m) +func (x *BLConfEntries) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_AddEntryParams proto.InternalMessageInfo +func (*BLConfEntries) ProtoMessage() {} -func (m *AddEntryParams) GetPeerID() string { - if m != nil { - return m.PeerID +func (x *BLConfEntries) ProtoReflect() protoreflect.Message { + mi := &file_polarrpc_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (m *AddEntryParams) GetAddress() string { - if m != nil { - return m.Address - } - return "" +// Deprecated: Use BLConfEntries.ProtoReflect.Descriptor instead. +func (*BLConfEntries) Descriptor() ([]byte, []int) { + return file_polarrpc_proto_rawDescGZIP(), []int{3} } -func (m *AddEntryParams) GetCidr() string { - if m != nil { - return m.Cidr +func (x *BLConfEntries) GetEnabled() bool { + if x != nil { + return x.Enabled } - return "" -} - -type RmEntryParams struct { - Index uint32 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RmEntryParams) Reset() { *m = RmEntryParams{} } -func (m *RmEntryParams) String() string { return proto.CompactTextString(m) } -func (*RmEntryParams) ProtoMessage() {} -func (*RmEntryParams) Descriptor() ([]byte, []int) { - return fileDescriptor_polarrpc_1f6dae6536e3253f, []int{5} -} -func (m *RmEntryParams) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RmEntryParams.Unmarshal(m, b) -} -func (m *RmEntryParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RmEntryParams.Marshal(b, m, deterministic) -} -func (dst *RmEntryParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_RmEntryParams.Merge(dst, src) -} -func (m *RmEntryParams) XXX_Size() int { - return xxx_messageInfo_RmEntryParams.Size(m) -} -func (m *RmEntryParams) XXX_DiscardUnknown() { - xxx_messageInfo_RmEntryParams.DiscardUnknown(m) + return false } -var xxx_messageInfo_RmEntryParams proto.InternalMessageInfo - -func (m *RmEntryParams) GetIndex() uint32 { - if m != nil { - return m.Index +func (x *BLConfEntries) GetEntries() []string { + if x != nil { + return x.Entries } - return 0 -} - -func init() { - proto.RegisterType((*Paginations)(nil), "types.Paginations") - proto.RegisterType((*PolarisPeerList)(nil), "types.PolarisPeerList") - proto.RegisterType((*PolarisPeer)(nil), "types.PolarisPeer") - proto.RegisterType((*BLConfEntries)(nil), "types.BLConfEntries") - proto.RegisterType((*AddEntryParams)(nil), "types.AddEntryParams") - proto.RegisterType((*RmEntryParams)(nil), "types.RmEntryParams") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for PolarisRPCService service - -type PolarisRPCServiceClient interface { - // Returns the current state of this node - NodeState(ctx context.Context, in *NodeReq, opts ...grpc.CallOption) (*SingleBytes, error) - // Returns node metrics according to request - Metric(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*Metrics, error) - CurrentList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) - WhiteList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) - BlackList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) - ListBLEntries(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BLConfEntries, error) - AddBLEntry(ctx context.Context, in *AddEntryParams, opts ...grpc.CallOption) (*SingleString, error) - RemoveBLEntry(ctx context.Context, in *RmEntryParams, opts ...grpc.CallOption) (*SingleString, error) + return nil } -type polarisRPCServiceClient struct { - cc *grpc.ClientConn -} +type AddEntryParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func NewPolarisRPCServiceClient(cc *grpc.ClientConn) PolarisRPCServiceClient { - return &polarisRPCServiceClient{cc} + PeerID string `protobuf:"bytes,1,opt,name=peerID,proto3" json:"peerID,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Cidr string `protobuf:"bytes,3,opt,name=cidr,proto3" json:"cidr,omitempty"` } -func (c *polarisRPCServiceClient) NodeState(ctx context.Context, in *NodeReq, opts ...grpc.CallOption) (*SingleBytes, error) { - out := new(SingleBytes) - err := grpc.Invoke(ctx, "/types.PolarisRPCService/NodeState", in, out, c.cc, opts...) - if err != nil { - return nil, err +func (x *AddEntryParams) Reset() { + *x = AddEntryParams{} + if protoimpl.UnsafeEnabled { + mi := &file_polarrpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return out, nil } -func (c *polarisRPCServiceClient) Metric(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*Metrics, error) { - out := new(Metrics) - err := grpc.Invoke(ctx, "/types.PolarisRPCService/Metric", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil +func (x *AddEntryParams) String() string { + return protoimpl.X.MessageStringOf(x) } -func (c *polarisRPCServiceClient) CurrentList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) { - out := new(PolarisPeerList) - err := grpc.Invoke(ctx, "/types.PolarisRPCService/CurrentList", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} +func (*AddEntryParams) ProtoMessage() {} -func (c *polarisRPCServiceClient) WhiteList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) { - out := new(PolarisPeerList) - err := grpc.Invoke(ctx, "/types.PolarisRPCService/WhiteList", in, out, c.cc, opts...) - if err != nil { - return nil, err +func (x *AddEntryParams) ProtoReflect() protoreflect.Message { + mi := &file_polarrpc_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return out, nil + return mi.MessageOf(x) } -func (c *polarisRPCServiceClient) BlackList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) { - out := new(PolarisPeerList) - err := grpc.Invoke(ctx, "/types.PolarisRPCService/BlackList", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil +// Deprecated: Use AddEntryParams.ProtoReflect.Descriptor instead. +func (*AddEntryParams) Descriptor() ([]byte, []int) { + return file_polarrpc_proto_rawDescGZIP(), []int{4} } -func (c *polarisRPCServiceClient) ListBLEntries(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BLConfEntries, error) { - out := new(BLConfEntries) - err := grpc.Invoke(ctx, "/types.PolarisRPCService/ListBLEntries", in, out, c.cc, opts...) - if err != nil { - return nil, err +func (x *AddEntryParams) GetPeerID() string { + if x != nil { + return x.PeerID } - return out, nil + return "" } -func (c *polarisRPCServiceClient) AddBLEntry(ctx context.Context, in *AddEntryParams, opts ...grpc.CallOption) (*SingleString, error) { - out := new(SingleString) - err := grpc.Invoke(ctx, "/types.PolarisRPCService/AddBLEntry", in, out, c.cc, opts...) - if err != nil { - return nil, err +func (x *AddEntryParams) GetAddress() string { + if x != nil { + return x.Address } - return out, nil + return "" } -func (c *polarisRPCServiceClient) RemoveBLEntry(ctx context.Context, in *RmEntryParams, opts ...grpc.CallOption) (*SingleString, error) { - out := new(SingleString) - err := grpc.Invoke(ctx, "/types.PolarisRPCService/RemoveBLEntry", in, out, c.cc, opts...) - if err != nil { - return nil, err +func (x *AddEntryParams) GetCidr() string { + if x != nil { + return x.Cidr } - return out, nil -} - -// Server API for PolarisRPCService service - -type PolarisRPCServiceServer interface { - // Returns the current state of this node - NodeState(context.Context, *NodeReq) (*SingleBytes, error) - // Returns node metrics according to request - Metric(context.Context, *MetricsRequest) (*Metrics, error) - CurrentList(context.Context, *Paginations) (*PolarisPeerList, error) - WhiteList(context.Context, *Paginations) (*PolarisPeerList, error) - BlackList(context.Context, *Paginations) (*PolarisPeerList, error) - ListBLEntries(context.Context, *Empty) (*BLConfEntries, error) - AddBLEntry(context.Context, *AddEntryParams) (*SingleString, error) - RemoveBLEntry(context.Context, *RmEntryParams) (*SingleString, error) + return "" } -func RegisterPolarisRPCServiceServer(s *grpc.Server, srv PolarisRPCServiceServer) { - s.RegisterService(&_PolarisRPCService_serviceDesc, srv) -} +type RmEntryParams struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func _PolarisRPCService_NodeState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NodeReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PolarisRPCServiceServer).NodeState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.PolarisRPCService/NodeState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PolarisRPCServiceServer).NodeState(ctx, req.(*NodeReq)) - } - return interceptor(ctx, in, info, handler) + Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` } -func _PolarisRPCService_Metric_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MetricsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PolarisRPCServiceServer).Metric(ctx, in) +func (x *RmEntryParams) Reset() { + *x = RmEntryParams{} + if protoimpl.UnsafeEnabled { + mi := &file_polarrpc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.PolarisRPCService/Metric", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PolarisRPCServiceServer).Metric(ctx, req.(*MetricsRequest)) - } - return interceptor(ctx, in, info, handler) } -func _PolarisRPCService_CurrentList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Paginations) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PolarisRPCServiceServer).CurrentList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.PolarisRPCService/CurrentList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PolarisRPCServiceServer).CurrentList(ctx, req.(*Paginations)) - } - return interceptor(ctx, in, info, handler) +func (x *RmEntryParams) String() string { + return protoimpl.X.MessageStringOf(x) } -func _PolarisRPCService_WhiteList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Paginations) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PolarisRPCServiceServer).WhiteList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.PolarisRPCService/WhiteList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PolarisRPCServiceServer).WhiteList(ctx, req.(*Paginations)) - } - return interceptor(ctx, in, info, handler) -} +func (*RmEntryParams) ProtoMessage() {} -func _PolarisRPCService_BlackList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Paginations) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PolarisRPCServiceServer).BlackList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.PolarisRPCService/BlackList", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PolarisRPCServiceServer).BlackList(ctx, req.(*Paginations)) +func (x *RmEntryParams) ProtoReflect() protoreflect.Message { + mi := &file_polarrpc_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return interceptor(ctx, in, info, handler) + return mi.MessageOf(x) } -func _PolarisRPCService_ListBLEntries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PolarisRPCServiceServer).ListBLEntries(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.PolarisRPCService/ListBLEntries", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PolarisRPCServiceServer).ListBLEntries(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) +// Deprecated: Use RmEntryParams.ProtoReflect.Descriptor instead. +func (*RmEntryParams) Descriptor() ([]byte, []int) { + return file_polarrpc_proto_rawDescGZIP(), []int{5} } -func _PolarisRPCService_AddBLEntry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddEntryParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PolarisRPCServiceServer).AddBLEntry(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.PolarisRPCService/AddBLEntry", +func (x *RmEntryParams) GetIndex() uint32 { + if x != nil { + return x.Index } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PolarisRPCServiceServer).AddBLEntry(ctx, req.(*AddEntryParams)) - } - return interceptor(ctx, in, info, handler) + return 0 } -func _PolarisRPCService_RemoveBLEntry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RmEntryParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PolarisRPCServiceServer).RemoveBLEntry(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.PolarisRPCService/RemoveBLEntry", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PolarisRPCServiceServer).RemoveBLEntry(ctx, req.(*RmEntryParams)) - } - return interceptor(ctx, in, info, handler) -} +var File_polarrpc_proto protoreflect.FileDescriptor + +var file_polarrpc_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x70, 0x6f, 0x6c, 0x61, 0x72, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x09, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x33, 0x0a, 0x0b, + 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x72, + 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x72, 0x65, 0x66, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x22, 0x6b, 0x0a, 0x0f, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x50, 0x65, 0x65, 0x72, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x61, + 0x73, 0x4e, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, + 0x4e, 0x65, 0x78, 0x74, 0x12, 0x28, 0x0a, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x6c, 0x61, + 0x72, 0x69, 0x73, 0x50, 0x65, 0x65, 0x72, 0x52, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x22, 0x8f, + 0x01, 0x0a, 0x0b, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2c, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, 0x09, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x61, + 0x73, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, + 0x61, 0x73, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x72, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x76, 0x65, 0x72, 0x69, 0x6f, 0x6e, + 0x22, 0x43, 0x0a, 0x0d, 0x42, 0x4c, 0x43, 0x6f, 0x6e, 0x66, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, + 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, + 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0x56, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x44, 0x12, + 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x64, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x64, 0x72, 0x22, 0x25, 0x0a, + 0x0d, 0x52, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x32, 0xdd, 0x03, 0x0a, 0x11, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, + 0x52, 0x50, 0x43, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x09, 0x4e, 0x6f, + 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x00, 0x12, 0x31, 0x0a, + 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x15, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x00, + 0x12, 0x3b, 0x0a, 0x0b, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x1a, 0x16, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x6c, 0x61, + 0x72, 0x69, 0x73, 0x50, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x39, 0x0a, + 0x09, 0x57, 0x68, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x16, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x50, 0x65, + 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x09, 0x42, 0x6c, 0x61, 0x63, + 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x16, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x50, 0x6f, 0x6c, 0x61, 0x72, 0x69, 0x73, 0x50, 0x65, 0x65, 0x72, 0x4c, 0x69, 0x73, + 0x74, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x4c, 0x45, 0x6e, 0x74, + 0x72, 0x69, 0x65, 0x73, 0x12, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x14, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x4c, 0x43, 0x6f, 0x6e, + 0x66, 0x45, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x0a, 0x41, 0x64, + 0x64, 0x42, 0x4c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x15, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, + 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x42, 0x4c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x14, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x52, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x13, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x22, 0x00, 0x42, 0x08, 0x5a, 0x06, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_polarrpc_proto_rawDescOnce sync.Once + file_polarrpc_proto_rawDescData = file_polarrpc_proto_rawDesc +) -var _PolarisRPCService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "types.PolarisRPCService", - HandlerType: (*PolarisRPCServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "NodeState", - Handler: _PolarisRPCService_NodeState_Handler, - }, - { - MethodName: "Metric", - Handler: _PolarisRPCService_Metric_Handler, - }, - { - MethodName: "CurrentList", - Handler: _PolarisRPCService_CurrentList_Handler, - }, - { - MethodName: "WhiteList", - Handler: _PolarisRPCService_WhiteList_Handler, - }, - { - MethodName: "BlackList", - Handler: _PolarisRPCService_BlackList_Handler, - }, - { - MethodName: "ListBLEntries", - Handler: _PolarisRPCService_ListBLEntries_Handler, - }, - { - MethodName: "AddBLEntry", - Handler: _PolarisRPCService_AddBLEntry_Handler, - }, - { - MethodName: "RemoveBLEntry", - Handler: _PolarisRPCService_RemoveBLEntry_Handler, +func file_polarrpc_proto_rawDescGZIP() []byte { + file_polarrpc_proto_rawDescOnce.Do(func() { + file_polarrpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_polarrpc_proto_rawDescData) + }) + return file_polarrpc_proto_rawDescData +} + +var file_polarrpc_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_polarrpc_proto_goTypes = []interface{}{ + (*Paginations)(nil), // 0: types.Paginations + (*PolarisPeerList)(nil), // 1: types.PolarisPeerList + (*PolarisPeer)(nil), // 2: types.PolarisPeer + (*BLConfEntries)(nil), // 3: types.BLConfEntries + (*AddEntryParams)(nil), // 4: types.AddEntryParams + (*RmEntryParams)(nil), // 5: types.RmEntryParams + (*PeerAddress)(nil), // 6: types.PeerAddress + (*NodeReq)(nil), // 7: types.NodeReq + (*MetricsRequest)(nil), // 8: types.MetricsRequest + (*Empty)(nil), // 9: types.Empty + (*SingleBytes)(nil), // 10: types.SingleBytes + (*Metrics)(nil), // 11: types.Metrics + (*SingleString)(nil), // 12: types.SingleString +} +var file_polarrpc_proto_depIdxs = []int32{ + 2, // 0: types.PolarisPeerList.peers:type_name -> types.PolarisPeer + 6, // 1: types.PolarisPeer.address:type_name -> types.PeerAddress + 7, // 2: types.PolarisRPCService.NodeState:input_type -> types.NodeReq + 8, // 3: types.PolarisRPCService.Metric:input_type -> types.MetricsRequest + 0, // 4: types.PolarisRPCService.CurrentList:input_type -> types.Paginations + 0, // 5: types.PolarisRPCService.WhiteList:input_type -> types.Paginations + 0, // 6: types.PolarisRPCService.BlackList:input_type -> types.Paginations + 9, // 7: types.PolarisRPCService.ListBLEntries:input_type -> types.Empty + 4, // 8: types.PolarisRPCService.AddBLEntry:input_type -> types.AddEntryParams + 5, // 9: types.PolarisRPCService.RemoveBLEntry:input_type -> types.RmEntryParams + 10, // 10: types.PolarisRPCService.NodeState:output_type -> types.SingleBytes + 11, // 11: types.PolarisRPCService.Metric:output_type -> types.Metrics + 1, // 12: types.PolarisRPCService.CurrentList:output_type -> types.PolarisPeerList + 1, // 13: types.PolarisRPCService.WhiteList:output_type -> types.PolarisPeerList + 1, // 14: types.PolarisRPCService.BlackList:output_type -> types.PolarisPeerList + 3, // 15: types.PolarisRPCService.ListBLEntries:output_type -> types.BLConfEntries + 12, // 16: types.PolarisRPCService.AddBLEntry:output_type -> types.SingleString + 12, // 17: types.PolarisRPCService.RemoveBLEntry:output_type -> types.SingleString + 10, // [10:18] is the sub-list for method output_type + 2, // [2:10] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_polarrpc_proto_init() } +func file_polarrpc_proto_init() { + if File_polarrpc_proto != nil { + return + } + file_node_proto_init() + file_rpc_proto_init() + file_metric_proto_init() + if !protoimpl.UnsafeEnabled { + file_polarrpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Paginations); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_polarrpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PolarisPeerList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_polarrpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PolarisPeer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_polarrpc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BLConfEntries); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_polarrpc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddEntryParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_polarrpc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RmEntryParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_polarrpc_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "polarrpc.proto", -} - -func init() { proto.RegisterFile("polarrpc.proto", fileDescriptor_polarrpc_1f6dae6536e3253f) } - -var fileDescriptor_polarrpc_1f6dae6536e3253f = []byte{ - // 535 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xcb, 0x6a, 0xdb, 0x40, - 0x14, 0xb5, 0xa2, 0xd8, 0x89, 0xae, 0x2d, 0xb7, 0x9d, 0xba, 0x41, 0x88, 0x2e, 0x84, 0xa0, 0xa0, - 0x45, 0x31, 0x24, 0xa1, 0x8b, 0x3e, 0x36, 0xb6, 0x9b, 0x45, 0xc1, 0x0d, 0x66, 0x0c, 0xed, 0x7a, - 0xa2, 0xb9, 0xb1, 0x07, 0xcb, 0x23, 0x65, 0x66, 0x62, 0xe2, 0xfe, 0x44, 0xbf, 0xb0, 0xff, 0x52, - 0x34, 0x92, 0xfc, 0xa0, 0x74, 0x93, 0xdd, 0x9c, 0x7b, 0xee, 0xb9, 0xef, 0x81, 0x7e, 0x91, 0x67, - 0x4c, 0xa9, 0x22, 0x1d, 0x16, 0x2a, 0x37, 0x39, 0x69, 0x9b, 0x6d, 0x81, 0x3a, 0x04, 0x99, 0x73, - 0xac, 0x4c, 0xa1, 0xb7, 0x63, 0xc3, 0xde, 0x1a, 0x8d, 0x12, 0x35, 0x8a, 0xaf, 0xa1, 0x3b, 0x63, - 0x0b, 0x21, 0x99, 0x11, 0xb9, 0xd4, 0xe4, 0x25, 0xb8, 0x0a, 0xef, 0x03, 0x27, 0x72, 0x92, 0x1e, - 0x2d, 0x9f, 0x84, 0xc0, 0xa9, 0x16, 0xbf, 0x30, 0x70, 0x23, 0x27, 0xf1, 0xa9, 0x7d, 0xc7, 0x2b, - 0x78, 0x31, 0x2b, 0x53, 0x0a, 0x3d, 0x43, 0x54, 0x53, 0xa1, 0x0d, 0x19, 0x40, 0xdb, 0xe4, 0x86, - 0x65, 0x56, 0xea, 0xd3, 0x0a, 0x90, 0x00, 0xce, 0x96, 0x4c, 0xdf, 0xe2, 0x93, 0x09, 0x4e, 0x22, - 0x27, 0x39, 0xa7, 0x0d, 0x24, 0x09, 0xb4, 0x0b, 0x44, 0xa5, 0x03, 0x37, 0x72, 0x93, 0xee, 0x15, - 0x19, 0xda, 0x9a, 0x87, 0x07, 0x61, 0x69, 0xe5, 0x10, 0xff, 0x76, 0xa0, 0x7b, 0x60, 0x26, 0xef, - 0xe1, 0x8c, 0x71, 0xae, 0x50, 0x6b, 0x9b, 0xeb, 0x40, 0x8b, 0xa8, 0x46, 0x15, 0x43, 0x1b, 0x17, - 0xf2, 0x16, 0xbc, 0x34, 0x97, 0x12, 0x53, 0x83, 0xdc, 0xd6, 0xe0, 0xd2, 0xbd, 0xa1, 0x64, 0x33, - 0xa6, 0xcd, 0x64, 0x89, 0xe9, 0xca, 0x76, 0xe8, 0xd2, 0xbd, 0x81, 0x5c, 0x40, 0x67, 0x83, 0x4a, - 0xe4, 0x32, 0x38, 0x8d, 0x9c, 0xc4, 0xa3, 0x35, 0x8a, 0x27, 0xe0, 0x8f, 0xa7, 0x93, 0x5c, 0xde, - 0xdf, 0x48, 0xa3, 0x04, 0xea, 0xb2, 0x4d, 0x94, 0xec, 0x2e, 0x43, 0x6e, 0x4b, 0x3a, 0xa7, 0x0d, - 0xac, 0x18, 0xeb, 0x14, 0x9c, 0x44, 0x6e, 0xe2, 0xd1, 0x06, 0xc6, 0x3f, 0xa0, 0x3f, 0xe2, 0xbc, - 0x8c, 0xb0, 0x9d, 0x31, 0xc5, 0xd6, 0xba, 0x4c, 0x57, 0x76, 0xfc, 0xed, 0xab, 0x0d, 0xe2, 0xd1, - 0x1a, 0x95, 0x31, 0x9a, 0x86, 0x4f, 0x2c, 0xb1, 0x6b, 0x8e, 0xc0, 0x69, 0x2a, 0xb8, 0xb2, 0x95, - 0x7b, 0xd4, 0xbe, 0xe3, 0x77, 0xe0, 0xd3, 0xf5, 0x61, 0xd8, 0x01, 0xb4, 0x85, 0xe4, 0xf8, 0xd4, - 0x6c, 0xc6, 0x82, 0xab, 0x3f, 0x2e, 0xbc, 0xaa, 0xa7, 0x4a, 0x67, 0x93, 0x39, 0xaa, 0x8d, 0x48, - 0x91, 0x5c, 0x82, 0x77, 0x9b, 0x73, 0x9c, 0x1b, 0x66, 0x90, 0xf4, 0xeb, 0xb9, 0x96, 0x16, 0x8a, - 0x0f, 0x61, 0x33, 0xe7, 0xb9, 0x90, 0x8b, 0x0c, 0xc7, 0x5b, 0x83, 0x3a, 0x6e, 0x91, 0x4b, 0xe8, - 0x7c, 0xb7, 0x07, 0x45, 0xde, 0xd4, 0x7c, 0x05, 0x35, 0xc5, 0x87, 0x47, 0xd4, 0x26, 0xec, 0x1f, - 0x9b, 0xe3, 0x16, 0xf9, 0x0c, 0xdd, 0xc9, 0xa3, 0x52, 0x28, 0x8d, 0x3d, 0x9d, 0xdd, 0xfe, 0xf6, - 0x77, 0x18, 0x5e, 0xfc, 0x7b, 0x0f, 0xa5, 0x6f, 0xdc, 0x22, 0x1f, 0xc1, 0xfb, 0xb9, 0x14, 0x06, - 0x9f, 0x27, 0x1d, 0x67, 0x2c, 0x5d, 0x3d, 0x43, 0xfa, 0x01, 0xfc, 0xf2, 0x35, 0x9e, 0x36, 0x2b, - 0xef, 0xd5, 0xae, 0x37, 0xeb, 0xc2, 0x6c, 0xc3, 0x41, 0x8d, 0x8e, 0xce, 0x22, 0x6e, 0x91, 0x4f, - 0x00, 0x23, 0xce, 0x2b, 0xd5, 0x76, 0x37, 0xa0, 0xe3, 0xbd, 0x87, 0xaf, 0x8f, 0xe6, 0x3a, 0x37, - 0x4a, 0xc8, 0x45, 0xdc, 0x22, 0x5f, 0xc0, 0xa7, 0xb8, 0xce, 0x37, 0xd8, 0xc8, 0x9b, 0x24, 0x47, - 0xeb, 0xfd, 0x8f, 0xfa, 0xae, 0x63, 0xbf, 0xf7, 0xf5, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf2, - 0x5a, 0x3f, 0xbc, 0x1c, 0x04, 0x00, 0x00, + GoTypes: file_polarrpc_proto_goTypes, + DependencyIndexes: file_polarrpc_proto_depIdxs, + MessageInfos: file_polarrpc_proto_msgTypes, + }.Build() + File_polarrpc_proto = out.File + file_polarrpc_proto_rawDesc = nil + file_polarrpc_proto_goTypes = nil + file_polarrpc_proto_depIdxs = nil } diff --git a/types/polarrpc_grpc.pb.go b/types/polarrpc_grpc.pb.go new file mode 100644 index 000000000..ae74e2509 --- /dev/null +++ b/types/polarrpc_grpc.pb.go @@ -0,0 +1,372 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.15.8 +// source: polarrpc.proto + +package types + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + PolarisRPCService_NodeState_FullMethodName = "/types.PolarisRPCService/NodeState" + PolarisRPCService_Metric_FullMethodName = "/types.PolarisRPCService/Metric" + PolarisRPCService_CurrentList_FullMethodName = "/types.PolarisRPCService/CurrentList" + PolarisRPCService_WhiteList_FullMethodName = "/types.PolarisRPCService/WhiteList" + PolarisRPCService_BlackList_FullMethodName = "/types.PolarisRPCService/BlackList" + PolarisRPCService_ListBLEntries_FullMethodName = "/types.PolarisRPCService/ListBLEntries" + PolarisRPCService_AddBLEntry_FullMethodName = "/types.PolarisRPCService/AddBLEntry" + PolarisRPCService_RemoveBLEntry_FullMethodName = "/types.PolarisRPCService/RemoveBLEntry" +) + +// PolarisRPCServiceClient is the client API for PolarisRPCService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PolarisRPCServiceClient interface { + // Returns the current state of this node + NodeState(ctx context.Context, in *NodeReq, opts ...grpc.CallOption) (*SingleBytes, error) + // Returns node metrics according to request + Metric(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*Metrics, error) + CurrentList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) + WhiteList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) + BlackList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) + ListBLEntries(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BLConfEntries, error) + AddBLEntry(ctx context.Context, in *AddEntryParams, opts ...grpc.CallOption) (*SingleString, error) + RemoveBLEntry(ctx context.Context, in *RmEntryParams, opts ...grpc.CallOption) (*SingleString, error) +} + +type polarisRPCServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPolarisRPCServiceClient(cc grpc.ClientConnInterface) PolarisRPCServiceClient { + return &polarisRPCServiceClient{cc} +} + +func (c *polarisRPCServiceClient) NodeState(ctx context.Context, in *NodeReq, opts ...grpc.CallOption) (*SingleBytes, error) { + out := new(SingleBytes) + err := c.cc.Invoke(ctx, PolarisRPCService_NodeState_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *polarisRPCServiceClient) Metric(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*Metrics, error) { + out := new(Metrics) + err := c.cc.Invoke(ctx, PolarisRPCService_Metric_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *polarisRPCServiceClient) CurrentList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) { + out := new(PolarisPeerList) + err := c.cc.Invoke(ctx, PolarisRPCService_CurrentList_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *polarisRPCServiceClient) WhiteList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) { + out := new(PolarisPeerList) + err := c.cc.Invoke(ctx, PolarisRPCService_WhiteList_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *polarisRPCServiceClient) BlackList(ctx context.Context, in *Paginations, opts ...grpc.CallOption) (*PolarisPeerList, error) { + out := new(PolarisPeerList) + err := c.cc.Invoke(ctx, PolarisRPCService_BlackList_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *polarisRPCServiceClient) ListBLEntries(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BLConfEntries, error) { + out := new(BLConfEntries) + err := c.cc.Invoke(ctx, PolarisRPCService_ListBLEntries_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *polarisRPCServiceClient) AddBLEntry(ctx context.Context, in *AddEntryParams, opts ...grpc.CallOption) (*SingleString, error) { + out := new(SingleString) + err := c.cc.Invoke(ctx, PolarisRPCService_AddBLEntry_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *polarisRPCServiceClient) RemoveBLEntry(ctx context.Context, in *RmEntryParams, opts ...grpc.CallOption) (*SingleString, error) { + out := new(SingleString) + err := c.cc.Invoke(ctx, PolarisRPCService_RemoveBLEntry_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PolarisRPCServiceServer is the server API for PolarisRPCService service. +// All implementations must embed UnimplementedPolarisRPCServiceServer +// for forward compatibility +type PolarisRPCServiceServer interface { + // Returns the current state of this node + NodeState(context.Context, *NodeReq) (*SingleBytes, error) + // Returns node metrics according to request + Metric(context.Context, *MetricsRequest) (*Metrics, error) + CurrentList(context.Context, *Paginations) (*PolarisPeerList, error) + WhiteList(context.Context, *Paginations) (*PolarisPeerList, error) + BlackList(context.Context, *Paginations) (*PolarisPeerList, error) + ListBLEntries(context.Context, *Empty) (*BLConfEntries, error) + AddBLEntry(context.Context, *AddEntryParams) (*SingleString, error) + RemoveBLEntry(context.Context, *RmEntryParams) (*SingleString, error) + mustEmbedUnimplementedPolarisRPCServiceServer() +} + +// UnimplementedPolarisRPCServiceServer must be embedded to have forward compatible implementations. +type UnimplementedPolarisRPCServiceServer struct { +} + +func (UnimplementedPolarisRPCServiceServer) NodeState(context.Context, *NodeReq) (*SingleBytes, error) { + return nil, status.Errorf(codes.Unimplemented, "method NodeState not implemented") +} +func (UnimplementedPolarisRPCServiceServer) Metric(context.Context, *MetricsRequest) (*Metrics, error) { + return nil, status.Errorf(codes.Unimplemented, "method Metric not implemented") +} +func (UnimplementedPolarisRPCServiceServer) CurrentList(context.Context, *Paginations) (*PolarisPeerList, error) { + return nil, status.Errorf(codes.Unimplemented, "method CurrentList not implemented") +} +func (UnimplementedPolarisRPCServiceServer) WhiteList(context.Context, *Paginations) (*PolarisPeerList, error) { + return nil, status.Errorf(codes.Unimplemented, "method WhiteList not implemented") +} +func (UnimplementedPolarisRPCServiceServer) BlackList(context.Context, *Paginations) (*PolarisPeerList, error) { + return nil, status.Errorf(codes.Unimplemented, "method BlackList not implemented") +} +func (UnimplementedPolarisRPCServiceServer) ListBLEntries(context.Context, *Empty) (*BLConfEntries, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBLEntries not implemented") +} +func (UnimplementedPolarisRPCServiceServer) AddBLEntry(context.Context, *AddEntryParams) (*SingleString, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddBLEntry not implemented") +} +func (UnimplementedPolarisRPCServiceServer) RemoveBLEntry(context.Context, *RmEntryParams) (*SingleString, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveBLEntry not implemented") +} +func (UnimplementedPolarisRPCServiceServer) mustEmbedUnimplementedPolarisRPCServiceServer() {} + +// UnsafePolarisRPCServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PolarisRPCServiceServer will +// result in compilation errors. +type UnsafePolarisRPCServiceServer interface { + mustEmbedUnimplementedPolarisRPCServiceServer() +} + +func RegisterPolarisRPCServiceServer(s grpc.ServiceRegistrar, srv PolarisRPCServiceServer) { + s.RegisterService(&PolarisRPCService_ServiceDesc, srv) +} + +func _PolarisRPCService_NodeState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodeReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PolarisRPCServiceServer).NodeState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PolarisRPCService_NodeState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PolarisRPCServiceServer).NodeState(ctx, req.(*NodeReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PolarisRPCService_Metric_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MetricsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PolarisRPCServiceServer).Metric(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PolarisRPCService_Metric_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PolarisRPCServiceServer).Metric(ctx, req.(*MetricsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PolarisRPCService_CurrentList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Paginations) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PolarisRPCServiceServer).CurrentList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PolarisRPCService_CurrentList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PolarisRPCServiceServer).CurrentList(ctx, req.(*Paginations)) + } + return interceptor(ctx, in, info, handler) +} + +func _PolarisRPCService_WhiteList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Paginations) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PolarisRPCServiceServer).WhiteList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PolarisRPCService_WhiteList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PolarisRPCServiceServer).WhiteList(ctx, req.(*Paginations)) + } + return interceptor(ctx, in, info, handler) +} + +func _PolarisRPCService_BlackList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Paginations) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PolarisRPCServiceServer).BlackList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PolarisRPCService_BlackList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PolarisRPCServiceServer).BlackList(ctx, req.(*Paginations)) + } + return interceptor(ctx, in, info, handler) +} + +func _PolarisRPCService_ListBLEntries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PolarisRPCServiceServer).ListBLEntries(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PolarisRPCService_ListBLEntries_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PolarisRPCServiceServer).ListBLEntries(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _PolarisRPCService_AddBLEntry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddEntryParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PolarisRPCServiceServer).AddBLEntry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PolarisRPCService_AddBLEntry_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PolarisRPCServiceServer).AddBLEntry(ctx, req.(*AddEntryParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _PolarisRPCService_RemoveBLEntry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RmEntryParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PolarisRPCServiceServer).RemoveBLEntry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PolarisRPCService_RemoveBLEntry_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PolarisRPCServiceServer).RemoveBLEntry(ctx, req.(*RmEntryParams)) + } + return interceptor(ctx, in, info, handler) +} + +// PolarisRPCService_ServiceDesc is the grpc.ServiceDesc for PolarisRPCService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PolarisRPCService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "types.PolarisRPCService", + HandlerType: (*PolarisRPCServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "NodeState", + Handler: _PolarisRPCService_NodeState_Handler, + }, + { + MethodName: "Metric", + Handler: _PolarisRPCService_Metric_Handler, + }, + { + MethodName: "CurrentList", + Handler: _PolarisRPCService_CurrentList_Handler, + }, + { + MethodName: "WhiteList", + Handler: _PolarisRPCService_WhiteList_Handler, + }, + { + MethodName: "BlackList", + Handler: _PolarisRPCService_BlackList_Handler, + }, + { + MethodName: "ListBLEntries", + Handler: _PolarisRPCService_ListBLEntries_Handler, + }, + { + MethodName: "AddBLEntry", + Handler: _PolarisRPCService_AddBLEntry_Handler, + }, + { + MethodName: "RemoveBLEntry", + Handler: _PolarisRPCService_RemoveBLEntry_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "polarrpc.proto", +} diff --git a/types/raft.pb.go b/types/raft.pb.go deleted file mode 100644 index a50fe76ca..000000000 --- a/types/raft.pb.go +++ /dev/null @@ -1,544 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: raft.proto - -package types - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -// cluster member for raft consensus -type MembershipChangeType int32 - -const ( - MembershipChangeType_ADD_MEMBER MembershipChangeType = 0 - MembershipChangeType_REMOVE_MEMBER MembershipChangeType = 1 -) - -var MembershipChangeType_name = map[int32]string{ - 0: "ADD_MEMBER", - 1: "REMOVE_MEMBER", -} -var MembershipChangeType_value = map[string]int32{ - "ADD_MEMBER": 0, - "REMOVE_MEMBER": 1, -} - -func (x MembershipChangeType) String() string { - return proto.EnumName(MembershipChangeType_name, int32(x)) -} -func (MembershipChangeType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_raft_1576fa0cf6fb69b6, []int{0} -} - -type ConfChangeState int32 - -const ( - ConfChangeState_CONF_CHANGE_STATE_PROPOSED ConfChangeState = 0 - ConfChangeState_CONF_CHANGE_STATE_SAVED ConfChangeState = 1 - ConfChangeState_CONF_CHANGE_STATE_APPLIED ConfChangeState = 2 -) - -var ConfChangeState_name = map[int32]string{ - 0: "CONF_CHANGE_STATE_PROPOSED", - 1: "CONF_CHANGE_STATE_SAVED", - 2: "CONF_CHANGE_STATE_APPLIED", -} -var ConfChangeState_value = map[string]int32{ - "CONF_CHANGE_STATE_PROPOSED": 0, - "CONF_CHANGE_STATE_SAVED": 1, - "CONF_CHANGE_STATE_APPLIED": 2, -} - -func (x ConfChangeState) String() string { - return proto.EnumName(ConfChangeState_name, int32(x)) -} -func (ConfChangeState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_raft_1576fa0cf6fb69b6, []int{1} -} - -type MemberAttr struct { - ID uint64 `protobuf:"varint,1,opt,name=ID" json:"ID,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Address string `protobuf:"bytes,3,opt,name=address" json:"address,omitempty"` - PeerID []byte `protobuf:"bytes,4,opt,name=peerID,proto3" json:"peerID,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MemberAttr) Reset() { *m = MemberAttr{} } -func (m *MemberAttr) String() string { return proto.CompactTextString(m) } -func (*MemberAttr) ProtoMessage() {} -func (*MemberAttr) Descriptor() ([]byte, []int) { - return fileDescriptor_raft_1576fa0cf6fb69b6, []int{0} -} -func (m *MemberAttr) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MemberAttr.Unmarshal(m, b) -} -func (m *MemberAttr) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MemberAttr.Marshal(b, m, deterministic) -} -func (dst *MemberAttr) XXX_Merge(src proto.Message) { - xxx_messageInfo_MemberAttr.Merge(dst, src) -} -func (m *MemberAttr) XXX_Size() int { - return xxx_messageInfo_MemberAttr.Size(m) -} -func (m *MemberAttr) XXX_DiscardUnknown() { - xxx_messageInfo_MemberAttr.DiscardUnknown(m) -} - -var xxx_messageInfo_MemberAttr proto.InternalMessageInfo - -func (m *MemberAttr) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *MemberAttr) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *MemberAttr) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *MemberAttr) GetPeerID() []byte { - if m != nil { - return m.PeerID - } - return nil -} - -type MembershipChange struct { - Type MembershipChangeType `protobuf:"varint,1,opt,name=type,enum=types.MembershipChangeType" json:"type,omitempty"` - RequestID uint64 `protobuf:"varint,2,opt,name=requestID" json:"requestID,omitempty"` - Attr *MemberAttr `protobuf:"bytes,3,opt,name=attr" json:"attr,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MembershipChange) Reset() { *m = MembershipChange{} } -func (m *MembershipChange) String() string { return proto.CompactTextString(m) } -func (*MembershipChange) ProtoMessage() {} -func (*MembershipChange) Descriptor() ([]byte, []int) { - return fileDescriptor_raft_1576fa0cf6fb69b6, []int{1} -} -func (m *MembershipChange) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MembershipChange.Unmarshal(m, b) -} -func (m *MembershipChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MembershipChange.Marshal(b, m, deterministic) -} -func (dst *MembershipChange) XXX_Merge(src proto.Message) { - xxx_messageInfo_MembershipChange.Merge(dst, src) -} -func (m *MembershipChange) XXX_Size() int { - return xxx_messageInfo_MembershipChange.Size(m) -} -func (m *MembershipChange) XXX_DiscardUnknown() { - xxx_messageInfo_MembershipChange.DiscardUnknown(m) -} - -var xxx_messageInfo_MembershipChange proto.InternalMessageInfo - -func (m *MembershipChange) GetType() MembershipChangeType { - if m != nil { - return m.Type - } - return MembershipChangeType_ADD_MEMBER -} - -func (m *MembershipChange) GetRequestID() uint64 { - if m != nil { - return m.RequestID - } - return 0 -} - -func (m *MembershipChange) GetAttr() *MemberAttr { - if m != nil { - return m.Attr - } - return nil -} - -type MembershipChangeReply struct { - Attr *MemberAttr `protobuf:"bytes,1,opt,name=attr" json:"attr,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MembershipChangeReply) Reset() { *m = MembershipChangeReply{} } -func (m *MembershipChangeReply) String() string { return proto.CompactTextString(m) } -func (*MembershipChangeReply) ProtoMessage() {} -func (*MembershipChangeReply) Descriptor() ([]byte, []int) { - return fileDescriptor_raft_1576fa0cf6fb69b6, []int{2} -} -func (m *MembershipChangeReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MembershipChangeReply.Unmarshal(m, b) -} -func (m *MembershipChangeReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MembershipChangeReply.Marshal(b, m, deterministic) -} -func (dst *MembershipChangeReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_MembershipChangeReply.Merge(dst, src) -} -func (m *MembershipChangeReply) XXX_Size() int { - return xxx_messageInfo_MembershipChangeReply.Size(m) -} -func (m *MembershipChangeReply) XXX_DiscardUnknown() { - xxx_messageInfo_MembershipChangeReply.DiscardUnknown(m) -} - -var xxx_messageInfo_MembershipChangeReply proto.InternalMessageInfo - -func (m *MembershipChangeReply) GetAttr() *MemberAttr { - if m != nil { - return m.Attr - } - return nil -} - -type HardStateInfo struct { - Term uint64 `protobuf:"varint,1,opt,name=term" json:"term,omitempty"` - Commit uint64 `protobuf:"varint,2,opt,name=commit" json:"commit,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HardStateInfo) Reset() { *m = HardStateInfo{} } -func (m *HardStateInfo) String() string { return proto.CompactTextString(m) } -func (*HardStateInfo) ProtoMessage() {} -func (*HardStateInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_raft_1576fa0cf6fb69b6, []int{3} -} -func (m *HardStateInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HardStateInfo.Unmarshal(m, b) -} -func (m *HardStateInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HardStateInfo.Marshal(b, m, deterministic) -} -func (dst *HardStateInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_HardStateInfo.Merge(dst, src) -} -func (m *HardStateInfo) XXX_Size() int { - return xxx_messageInfo_HardStateInfo.Size(m) -} -func (m *HardStateInfo) XXX_DiscardUnknown() { - xxx_messageInfo_HardStateInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_HardStateInfo proto.InternalMessageInfo - -func (m *HardStateInfo) GetTerm() uint64 { - if m != nil { - return m.Term - } - return 0 -} - -func (m *HardStateInfo) GetCommit() uint64 { - if m != nil { - return m.Commit - } - return 0 -} - -// data types for raft support -// GetClusterInfoRequest -type GetClusterInfoRequest struct { - BestBlockHash []byte `protobuf:"bytes,1,opt,name=bestBlockHash,proto3" json:"bestBlockHash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetClusterInfoRequest) Reset() { *m = GetClusterInfoRequest{} } -func (m *GetClusterInfoRequest) String() string { return proto.CompactTextString(m) } -func (*GetClusterInfoRequest) ProtoMessage() {} -func (*GetClusterInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_raft_1576fa0cf6fb69b6, []int{4} -} -func (m *GetClusterInfoRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetClusterInfoRequest.Unmarshal(m, b) -} -func (m *GetClusterInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetClusterInfoRequest.Marshal(b, m, deterministic) -} -func (dst *GetClusterInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetClusterInfoRequest.Merge(dst, src) -} -func (m *GetClusterInfoRequest) XXX_Size() int { - return xxx_messageInfo_GetClusterInfoRequest.Size(m) -} -func (m *GetClusterInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetClusterInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetClusterInfoRequest proto.InternalMessageInfo - -func (m *GetClusterInfoRequest) GetBestBlockHash() []byte { - if m != nil { - return m.BestBlockHash - } - return nil -} - -type GetClusterInfoResponse struct { - ChainID []byte `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` - ClusterID uint64 `protobuf:"varint,2,opt,name=clusterID" json:"clusterID,omitempty"` - Error string `protobuf:"bytes,3,opt,name=error" json:"error,omitempty"` - MbrAttrs []*MemberAttr `protobuf:"bytes,4,rep,name=mbrAttrs" json:"mbrAttrs,omitempty"` - BestBlockNo uint64 `protobuf:"varint,5,opt,name=bestBlockNo" json:"bestBlockNo,omitempty"` - HardStateInfo *HardStateInfo `protobuf:"bytes,6,opt,name=hardStateInfo" json:"hardStateInfo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetClusterInfoResponse) Reset() { *m = GetClusterInfoResponse{} } -func (m *GetClusterInfoResponse) String() string { return proto.CompactTextString(m) } -func (*GetClusterInfoResponse) ProtoMessage() {} -func (*GetClusterInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_raft_1576fa0cf6fb69b6, []int{5} -} -func (m *GetClusterInfoResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetClusterInfoResponse.Unmarshal(m, b) -} -func (m *GetClusterInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetClusterInfoResponse.Marshal(b, m, deterministic) -} -func (dst *GetClusterInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetClusterInfoResponse.Merge(dst, src) -} -func (m *GetClusterInfoResponse) XXX_Size() int { - return xxx_messageInfo_GetClusterInfoResponse.Size(m) -} -func (m *GetClusterInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetClusterInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetClusterInfoResponse proto.InternalMessageInfo - -func (m *GetClusterInfoResponse) GetChainID() []byte { - if m != nil { - return m.ChainID - } - return nil -} - -func (m *GetClusterInfoResponse) GetClusterID() uint64 { - if m != nil { - return m.ClusterID - } - return 0 -} - -func (m *GetClusterInfoResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -func (m *GetClusterInfoResponse) GetMbrAttrs() []*MemberAttr { - if m != nil { - return m.MbrAttrs - } - return nil -} - -func (m *GetClusterInfoResponse) GetBestBlockNo() uint64 { - if m != nil { - return m.BestBlockNo - } - return 0 -} - -func (m *GetClusterInfoResponse) GetHardStateInfo() *HardStateInfo { - if m != nil { - return m.HardStateInfo - } - return nil -} - -type ConfChangeProgress struct { - State ConfChangeState `protobuf:"varint,1,opt,name=State,enum=types.ConfChangeState" json:"State,omitempty"` - Err string `protobuf:"bytes,2,opt,name=Err" json:"Err,omitempty"` - Members []*MemberAttr `protobuf:"bytes,3,rep,name=Members" json:"Members,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfChangeProgress) Reset() { *m = ConfChangeProgress{} } -func (m *ConfChangeProgress) String() string { return proto.CompactTextString(m) } -func (*ConfChangeProgress) ProtoMessage() {} -func (*ConfChangeProgress) Descriptor() ([]byte, []int) { - return fileDescriptor_raft_1576fa0cf6fb69b6, []int{6} -} -func (m *ConfChangeProgress) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfChangeProgress.Unmarshal(m, b) -} -func (m *ConfChangeProgress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfChangeProgress.Marshal(b, m, deterministic) -} -func (dst *ConfChangeProgress) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfChangeProgress.Merge(dst, src) -} -func (m *ConfChangeProgress) XXX_Size() int { - return xxx_messageInfo_ConfChangeProgress.Size(m) -} -func (m *ConfChangeProgress) XXX_DiscardUnknown() { - xxx_messageInfo_ConfChangeProgress.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfChangeProgress proto.InternalMessageInfo - -func (m *ConfChangeProgress) GetState() ConfChangeState { - if m != nil { - return m.State - } - return ConfChangeState_CONF_CHANGE_STATE_PROPOSED -} - -func (m *ConfChangeProgress) GetErr() string { - if m != nil { - return m.Err - } - return "" -} - -func (m *ConfChangeProgress) GetMembers() []*MemberAttr { - if m != nil { - return m.Members - } - return nil -} - -// SnapshotResponse is response message of receiving peer -type SnapshotResponse struct { - Status ResultStatus `protobuf:"varint,1,opt,name=status,enum=types.ResultStatus" json:"status,omitempty"` - Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SnapshotResponse) Reset() { *m = SnapshotResponse{} } -func (m *SnapshotResponse) String() string { return proto.CompactTextString(m) } -func (*SnapshotResponse) ProtoMessage() {} -func (*SnapshotResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_raft_1576fa0cf6fb69b6, []int{7} -} -func (m *SnapshotResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SnapshotResponse.Unmarshal(m, b) -} -func (m *SnapshotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SnapshotResponse.Marshal(b, m, deterministic) -} -func (dst *SnapshotResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotResponse.Merge(dst, src) -} -func (m *SnapshotResponse) XXX_Size() int { - return xxx_messageInfo_SnapshotResponse.Size(m) -} -func (m *SnapshotResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotResponse proto.InternalMessageInfo - -func (m *SnapshotResponse) GetStatus() ResultStatus { - if m != nil { - return m.Status - } - return ResultStatus_OK -} - -func (m *SnapshotResponse) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -func init() { - proto.RegisterType((*MemberAttr)(nil), "types.MemberAttr") - proto.RegisterType((*MembershipChange)(nil), "types.MembershipChange") - proto.RegisterType((*MembershipChangeReply)(nil), "types.MembershipChangeReply") - proto.RegisterType((*HardStateInfo)(nil), "types.HardStateInfo") - proto.RegisterType((*GetClusterInfoRequest)(nil), "types.GetClusterInfoRequest") - proto.RegisterType((*GetClusterInfoResponse)(nil), "types.GetClusterInfoResponse") - proto.RegisterType((*ConfChangeProgress)(nil), "types.ConfChangeProgress") - proto.RegisterType((*SnapshotResponse)(nil), "types.SnapshotResponse") - proto.RegisterEnum("types.MembershipChangeType", MembershipChangeType_name, MembershipChangeType_value) - proto.RegisterEnum("types.ConfChangeState", ConfChangeState_name, ConfChangeState_value) -} - -func init() { proto.RegisterFile("raft.proto", fileDescriptor_raft_1576fa0cf6fb69b6) } - -var fileDescriptor_raft_1576fa0cf6fb69b6 = []byte{ - // 577 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xad, 0x13, 0x27, 0xa5, 0xd3, 0xa6, 0xb8, 0x4b, 0x5b, 0x4c, 0x0b, 0x28, 0xb2, 0x40, 0x8a, - 0x5a, 0x08, 0x52, 0x38, 0x01, 0x02, 0xc9, 0x8d, 0x4d, 0x63, 0x89, 0x7c, 0x68, 0x1d, 0x55, 0xe2, - 0x14, 0x6d, 0x92, 0x4d, 0x1c, 0x11, 0x7f, 0xb0, 0xbb, 0x39, 0xe4, 0xc8, 0x8d, 0xff, 0xcb, 0x1f, - 0x40, 0x5e, 0xaf, 0xdd, 0x26, 0x2d, 0xdc, 0x76, 0x66, 0xde, 0xcc, 0xbc, 0x79, 0x33, 0x36, 0x00, - 0x23, 0x33, 0xd1, 0x4c, 0x58, 0x2c, 0x62, 0x54, 0x11, 0xeb, 0x84, 0xf2, 0xb3, 0xbd, 0xa4, 0x95, - 0x64, 0x1e, 0x6b, 0x0c, 0xd0, 0xa5, 0xe1, 0x98, 0x32, 0x5b, 0x08, 0x86, 0x0e, 0xa1, 0xe4, 0x39, - 0xa6, 0x56, 0xd7, 0x1a, 0x3a, 0x2e, 0x79, 0x0e, 0x42, 0xa0, 0x47, 0x24, 0xa4, 0x66, 0xa9, 0xae, - 0x35, 0xf6, 0xb0, 0x7c, 0x23, 0x13, 0x76, 0xc9, 0x74, 0xca, 0x28, 0xe7, 0x66, 0x59, 0xba, 0x73, - 0x13, 0x9d, 0x42, 0x35, 0xa1, 0x94, 0x79, 0x8e, 0xa9, 0xd7, 0xb5, 0xc6, 0x01, 0x56, 0x96, 0xf5, - 0x5b, 0x03, 0x23, 0x6b, 0xc2, 0x83, 0x45, 0xd2, 0x0e, 0x48, 0x34, 0xa7, 0xe8, 0x1d, 0xe8, 0x29, - 0x19, 0xd9, 0xec, 0xb0, 0x75, 0xde, 0x94, 0xcc, 0x9a, 0xdb, 0xb0, 0xe1, 0x3a, 0xa1, 0x58, 0x02, - 0xd1, 0x73, 0xd8, 0x63, 0xf4, 0xe7, 0x8a, 0x72, 0xe1, 0x39, 0x92, 0x90, 0x8e, 0x6f, 0x1d, 0xe8, - 0x35, 0xe8, 0x44, 0x08, 0x26, 0x29, 0xed, 0xb7, 0x8e, 0x36, 0xca, 0xa5, 0xa3, 0x61, 0x19, 0xb6, - 0xbe, 0xc0, 0xc9, 0x76, 0x0b, 0x4c, 0x93, 0xe5, 0xba, 0xc8, 0xd7, 0xfe, 0x9f, 0xff, 0x09, 0x6a, - 0x1d, 0xc2, 0xa6, 0xbe, 0x20, 0x82, 0x7a, 0xd1, 0x2c, 0x4e, 0x15, 0x12, 0x94, 0x85, 0x4a, 0x33, - 0xf9, 0x4e, 0x75, 0x98, 0xc4, 0x61, 0xb8, 0x10, 0x8a, 0xa6, 0xb2, 0xac, 0xcf, 0x70, 0x72, 0x4d, - 0x45, 0x7b, 0xb9, 0xe2, 0x82, 0xb2, 0x34, 0x1b, 0x67, 0xf4, 0xd1, 0x2b, 0xa8, 0x8d, 0x29, 0x17, - 0x57, 0xcb, 0x78, 0xf2, 0xa3, 0x43, 0x78, 0x20, 0xab, 0x1d, 0xe0, 0x4d, 0xa7, 0xf5, 0x47, 0x83, - 0xd3, 0xed, 0x7c, 0x9e, 0xc4, 0x11, 0x97, 0x3b, 0x99, 0x04, 0x64, 0x11, 0xa9, 0xe5, 0x1d, 0xe0, - 0xdc, 0x4c, 0x55, 0x9b, 0xa8, 0x84, 0x42, 0xb5, 0xc2, 0x81, 0x8e, 0xa1, 0x42, 0x19, 0x8b, 0x99, - 0xda, 0x64, 0x66, 0xa0, 0xb7, 0xf0, 0x28, 0x1c, 0xcb, 0xa9, 0xb9, 0xa9, 0xd7, 0xcb, 0x0f, 0xeb, - 0x51, 0x40, 0x50, 0x1d, 0xf6, 0x0b, 0xa2, 0xbd, 0xd8, 0xac, 0xc8, 0x26, 0x77, 0x5d, 0xe8, 0x23, - 0xd4, 0x82, 0xbb, 0xaa, 0x99, 0x55, 0xa9, 0xf2, 0xb1, 0xaa, 0xba, 0xa1, 0x28, 0xde, 0x84, 0x5a, - 0xbf, 0x34, 0x40, 0xed, 0x38, 0x9a, 0x65, 0xcb, 0x1a, 0xb0, 0x78, 0x2e, 0x6f, 0xed, 0x0d, 0x54, - 0x24, 0x46, 0xdd, 0xcf, 0xa9, 0x2a, 0x75, 0x8b, 0x94, 0x51, 0x9c, 0x81, 0x90, 0x01, 0x65, 0x97, - 0x31, 0x75, 0xc6, 0xe9, 0x13, 0x5d, 0xc2, 0xae, 0x3a, 0x04, 0xb3, 0xfc, 0xaf, 0x11, 0x73, 0x84, - 0xf5, 0x1d, 0x0c, 0x3f, 0x22, 0x09, 0x0f, 0x62, 0x51, 0x48, 0x7e, 0x09, 0x55, 0x2e, 0x88, 0x58, - 0x71, 0xc5, 0xe0, 0x89, 0xca, 0xc7, 0x94, 0xaf, 0x96, 0xc2, 0x97, 0x21, 0xac, 0x20, 0xe9, 0x7e, - 0x42, 0xca, 0x39, 0x99, 0xe7, 0x9f, 0x52, 0x6e, 0x5e, 0x7c, 0x80, 0xe3, 0x87, 0x6e, 0x1e, 0x1d, - 0x02, 0xd8, 0x8e, 0x33, 0xea, 0xba, 0xdd, 0x2b, 0x17, 0x1b, 0x3b, 0xe8, 0x08, 0x6a, 0xd8, 0xed, - 0xf6, 0x6f, 0xdc, 0xdc, 0xa5, 0x5d, 0x84, 0xf0, 0x78, 0x6b, 0x5c, 0xf4, 0x12, 0xce, 0xda, 0xfd, - 0xde, 0xd7, 0x51, 0xbb, 0x63, 0xf7, 0xae, 0xdd, 0x91, 0x3f, 0xb4, 0x87, 0xee, 0x68, 0x80, 0xfb, - 0x83, 0xbe, 0xef, 0x3a, 0xc6, 0x0e, 0x3a, 0x87, 0xa7, 0xf7, 0xe3, 0xbe, 0x7d, 0xe3, 0x3a, 0x86, - 0x86, 0x5e, 0xc0, 0xb3, 0xfb, 0x41, 0x7b, 0x30, 0xf8, 0xe6, 0xb9, 0x8e, 0x51, 0x1a, 0x57, 0xe5, - 0x0f, 0xe3, 0xfd, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x67, 0x2b, 0xa7, 0x50, 0x04, 0x00, - 0x00, -} diff --git a/types/rpc.pb.go b/types/rpc.pb.go index aa6c788a0..d5c43b3b1 100644 --- a/types/rpc.pb.go +++ b/types/rpc.pb.go @@ -1,27 +1,24 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v3.15.8 // source: rpc.proto package types -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type CommitStatus int32 @@ -37,34 +34,57 @@ const ( CommitStatus_TX_INTERNAL_ERROR CommitStatus = 9 ) -var CommitStatus_name = map[int32]string{ - 0: "TX_OK", - 1: "TX_NONCE_TOO_LOW", - 2: "TX_ALREADY_EXISTS", - 3: "TX_INVALID_HASH", - 4: "TX_INVALID_SIGN", - 5: "TX_INVALID_FORMAT", - 6: "TX_INSUFFICIENT_BALANCE", - 7: "TX_HAS_SAME_NONCE", - 9: "TX_INTERNAL_ERROR", -} -var CommitStatus_value = map[string]int32{ - "TX_OK": 0, - "TX_NONCE_TOO_LOW": 1, - "TX_ALREADY_EXISTS": 2, - "TX_INVALID_HASH": 3, - "TX_INVALID_SIGN": 4, - "TX_INVALID_FORMAT": 5, - "TX_INSUFFICIENT_BALANCE": 6, - "TX_HAS_SAME_NONCE": 7, - "TX_INTERNAL_ERROR": 9, +// Enum value maps for CommitStatus. +var ( + CommitStatus_name = map[int32]string{ + 0: "TX_OK", + 1: "TX_NONCE_TOO_LOW", + 2: "TX_ALREADY_EXISTS", + 3: "TX_INVALID_HASH", + 4: "TX_INVALID_SIGN", + 5: "TX_INVALID_FORMAT", + 6: "TX_INSUFFICIENT_BALANCE", + 7: "TX_HAS_SAME_NONCE", + 9: "TX_INTERNAL_ERROR", + } + CommitStatus_value = map[string]int32{ + "TX_OK": 0, + "TX_NONCE_TOO_LOW": 1, + "TX_ALREADY_EXISTS": 2, + "TX_INVALID_HASH": 3, + "TX_INVALID_SIGN": 4, + "TX_INVALID_FORMAT": 5, + "TX_INSUFFICIENT_BALANCE": 6, + "TX_HAS_SAME_NONCE": 7, + "TX_INTERNAL_ERROR": 9, + } +) + +func (x CommitStatus) Enum() *CommitStatus { + p := new(CommitStatus) + *p = x + return p } func (x CommitStatus) String() string { - return proto.EnumName(CommitStatus_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CommitStatus) Descriptor() protoreflect.EnumDescriptor { + return file_rpc_proto_enumTypes[0].Descriptor() +} + +func (CommitStatus) Type() protoreflect.EnumType { + return &file_rpc_proto_enumTypes[0] +} + +func (x CommitStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } + +// Deprecated: Use CommitStatus.Descriptor instead. func (CommitStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{0} + return file_rpc_proto_rawDescGZIP(), []int{0} } type VerifyStatus int32 @@ -72,3978 +92,3747 @@ type VerifyStatus int32 const ( VerifyStatus_VERIFY_STATUS_OK VerifyStatus = 0 VerifyStatus_VERIFY_STATUS_SIGN_NOT_MATCH VerifyStatus = 1 - VerifyStatus_VERIFY_STATUS_INVALID_HASH VerifyStatus = 2 + VerifyStatus_VERIFY_STATUS_INVALID_HASH VerifyStatus = 2 //TODO: not yet impl ) -var VerifyStatus_name = map[int32]string{ - 0: "VERIFY_STATUS_OK", - 1: "VERIFY_STATUS_SIGN_NOT_MATCH", - 2: "VERIFY_STATUS_INVALID_HASH", -} -var VerifyStatus_value = map[string]int32{ - "VERIFY_STATUS_OK": 0, - "VERIFY_STATUS_SIGN_NOT_MATCH": 1, - "VERIFY_STATUS_INVALID_HASH": 2, +// Enum value maps for VerifyStatus. +var ( + VerifyStatus_name = map[int32]string{ + 0: "VERIFY_STATUS_OK", + 1: "VERIFY_STATUS_SIGN_NOT_MATCH", + 2: "VERIFY_STATUS_INVALID_HASH", + } + VerifyStatus_value = map[string]int32{ + "VERIFY_STATUS_OK": 0, + "VERIFY_STATUS_SIGN_NOT_MATCH": 1, + "VERIFY_STATUS_INVALID_HASH": 2, + } +) + +func (x VerifyStatus) Enum() *VerifyStatus { + p := new(VerifyStatus) + *p = x + return p } func (x VerifyStatus) String() string { - return proto.EnumName(VerifyStatus_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (VerifyStatus) Descriptor() protoreflect.EnumDescriptor { + return file_rpc_proto_enumTypes[1].Descriptor() +} + +func (VerifyStatus) Type() protoreflect.EnumType { + return &file_rpc_proto_enumTypes[1] +} + +func (x VerifyStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } + +// Deprecated: Use VerifyStatus.Descriptor instead. func (VerifyStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{1} + return file_rpc_proto_rawDescGZIP(), []int{1} } // BlockchainStatus is current status of blockchain type BlockchainStatus struct { - BestBlockHash []byte `protobuf:"bytes,1,opt,name=best_block_hash,json=bestBlockHash,proto3" json:"best_block_hash,omitempty"` - BestHeight uint64 `protobuf:"varint,2,opt,name=best_height,json=bestHeight" json:"best_height,omitempty"` - ConsensusInfo string `protobuf:"bytes,3,opt,name=consensus_info,json=consensusInfo" json:"consensus_info,omitempty"` - BestChainIdHash []byte `protobuf:"bytes,4,opt,name=best_chain_id_hash,json=bestChainIdHash,proto3" json:"best_chain_id_hash,omitempty"` - ChainInfo *ChainInfo `protobuf:"bytes,5,opt,name=chain_info,json=chainInfo" json:"chain_info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockchainStatus) Reset() { *m = BlockchainStatus{} } -func (m *BlockchainStatus) String() string { return proto.CompactTextString(m) } -func (*BlockchainStatus) ProtoMessage() {} -func (*BlockchainStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{0} -} -func (m *BlockchainStatus) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockchainStatus.Unmarshal(m, b) -} -func (m *BlockchainStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockchainStatus.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BestBlockHash []byte `protobuf:"bytes,1,opt,name=best_block_hash,json=bestBlockHash,proto3" json:"best_block_hash,omitempty"` + BestHeight uint64 `protobuf:"varint,2,opt,name=best_height,json=bestHeight,proto3" json:"best_height,omitempty"` + ConsensusInfo string `protobuf:"bytes,3,opt,name=consensus_info,json=consensusInfo,proto3" json:"consensus_info,omitempty"` + BestChainIdHash []byte `protobuf:"bytes,4,opt,name=best_chain_id_hash,json=bestChainIdHash,proto3" json:"best_chain_id_hash,omitempty"` + ChainInfo *ChainInfo `protobuf:"bytes,5,opt,name=chain_info,json=chainInfo,proto3" json:"chain_info,omitempty"` } -func (dst *BlockchainStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockchainStatus.Merge(dst, src) + +func (x *BlockchainStatus) Reset() { + *x = BlockchainStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BlockchainStatus) XXX_Size() int { - return xxx_messageInfo_BlockchainStatus.Size(m) + +func (x *BlockchainStatus) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BlockchainStatus) XXX_DiscardUnknown() { - xxx_messageInfo_BlockchainStatus.DiscardUnknown(m) + +func (*BlockchainStatus) ProtoMessage() {} + +func (x *BlockchainStatus) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BlockchainStatus proto.InternalMessageInfo +// Deprecated: Use BlockchainStatus.ProtoReflect.Descriptor instead. +func (*BlockchainStatus) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{0} +} -func (m *BlockchainStatus) GetBestBlockHash() []byte { - if m != nil { - return m.BestBlockHash +func (x *BlockchainStatus) GetBestBlockHash() []byte { + if x != nil { + return x.BestBlockHash } return nil } -func (m *BlockchainStatus) GetBestHeight() uint64 { - if m != nil { - return m.BestHeight +func (x *BlockchainStatus) GetBestHeight() uint64 { + if x != nil { + return x.BestHeight } return 0 } -func (m *BlockchainStatus) GetConsensusInfo() string { - if m != nil { - return m.ConsensusInfo +func (x *BlockchainStatus) GetConsensusInfo() string { + if x != nil { + return x.ConsensusInfo } return "" } -func (m *BlockchainStatus) GetBestChainIdHash() []byte { - if m != nil { - return m.BestChainIdHash +func (x *BlockchainStatus) GetBestChainIdHash() []byte { + if x != nil { + return x.BestChainIdHash } return nil } -func (m *BlockchainStatus) GetChainInfo() *ChainInfo { - if m != nil { - return m.ChainInfo +func (x *BlockchainStatus) GetChainInfo() *ChainInfo { + if x != nil { + return x.ChainInfo } return nil } type ChainId struct { - Magic string `protobuf:"bytes,1,opt,name=magic" json:"magic,omitempty"` - Public bool `protobuf:"varint,2,opt,name=public" json:"public,omitempty"` - Mainnet bool `protobuf:"varint,3,opt,name=mainnet" json:"mainnet,omitempty"` - Consensus string `protobuf:"bytes,4,opt,name=consensus" json:"consensus,omitempty"` - Version int32 `protobuf:"varint,5,opt,name=version" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChainId) Reset() { *m = ChainId{} } -func (m *ChainId) String() string { return proto.CompactTextString(m) } -func (*ChainId) ProtoMessage() {} -func (*ChainId) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{1} -} -func (m *ChainId) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChainId.Unmarshal(m, b) -} -func (m *ChainId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChainId.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Magic string `protobuf:"bytes,1,opt,name=magic,proto3" json:"magic,omitempty"` + Public bool `protobuf:"varint,2,opt,name=public,proto3" json:"public,omitempty"` + Mainnet bool `protobuf:"varint,3,opt,name=mainnet,proto3" json:"mainnet,omitempty"` + Consensus string `protobuf:"bytes,4,opt,name=consensus,proto3" json:"consensus,omitempty"` + Version int32 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` } -func (dst *ChainId) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainId.Merge(dst, src) + +func (x *ChainId) Reset() { + *x = ChainId{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ChainId) XXX_Size() int { - return xxx_messageInfo_ChainId.Size(m) + +func (x *ChainId) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ChainId) XXX_DiscardUnknown() { - xxx_messageInfo_ChainId.DiscardUnknown(m) + +func (*ChainId) ProtoMessage() {} + +func (x *ChainId) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ChainId proto.InternalMessageInfo +// Deprecated: Use ChainId.ProtoReflect.Descriptor instead. +func (*ChainId) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{1} +} -func (m *ChainId) GetMagic() string { - if m != nil { - return m.Magic +func (x *ChainId) GetMagic() string { + if x != nil { + return x.Magic } return "" } -func (m *ChainId) GetPublic() bool { - if m != nil { - return m.Public +func (x *ChainId) GetPublic() bool { + if x != nil { + return x.Public } return false } -func (m *ChainId) GetMainnet() bool { - if m != nil { - return m.Mainnet +func (x *ChainId) GetMainnet() bool { + if x != nil { + return x.Mainnet } return false } -func (m *ChainId) GetConsensus() string { - if m != nil { - return m.Consensus +func (x *ChainId) GetConsensus() string { + if x != nil { + return x.Consensus } return "" } -func (m *ChainId) GetVersion() int32 { - if m != nil { - return m.Version +func (x *ChainId) GetVersion() int32 { + if x != nil { + return x.Version } return 0 } // ChainInfo returns chain configuration type ChainInfo struct { - Id *ChainId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - BpNumber uint32 `protobuf:"varint,2,opt,name=bpNumber" json:"bpNumber,omitempty"` - Maxblocksize uint64 `protobuf:"varint,3,opt,name=maxblocksize" json:"maxblocksize,omitempty"` - Maxtokens []byte `protobuf:"bytes,4,opt,name=maxtokens,proto3" json:"maxtokens,omitempty"` - Stakingminimum []byte `protobuf:"bytes,5,opt,name=stakingminimum,proto3" json:"stakingminimum,omitempty"` - Totalstaking []byte `protobuf:"bytes,6,opt,name=totalstaking,proto3" json:"totalstaking,omitempty"` - Gasprice []byte `protobuf:"bytes,7,opt,name=gasprice,proto3" json:"gasprice,omitempty"` - Nameprice []byte `protobuf:"bytes,8,opt,name=nameprice,proto3" json:"nameprice,omitempty"` - Totalvotingpower []byte `protobuf:"bytes,9,opt,name=totalvotingpower,proto3" json:"totalvotingpower,omitempty"` - Votingreward []byte `protobuf:"bytes,10,opt,name=votingreward,proto3" json:"votingreward,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChainInfo) Reset() { *m = ChainInfo{} } -func (m *ChainInfo) String() string { return proto.CompactTextString(m) } -func (*ChainInfo) ProtoMessage() {} -func (*ChainInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{2} -} -func (m *ChainInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChainInfo.Unmarshal(m, b) -} -func (m *ChainInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChainInfo.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *ChainId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + BpNumber uint32 `protobuf:"varint,2,opt,name=bpNumber,proto3" json:"bpNumber,omitempty"` + Maxblocksize uint64 `protobuf:"varint,3,opt,name=maxblocksize,proto3" json:"maxblocksize,omitempty"` + Maxtokens []byte `protobuf:"bytes,4,opt,name=maxtokens,proto3" json:"maxtokens,omitempty"` + Stakingminimum []byte `protobuf:"bytes,5,opt,name=stakingminimum,proto3" json:"stakingminimum,omitempty"` + Totalstaking []byte `protobuf:"bytes,6,opt,name=totalstaking,proto3" json:"totalstaking,omitempty"` + Gasprice []byte `protobuf:"bytes,7,opt,name=gasprice,proto3" json:"gasprice,omitempty"` + Nameprice []byte `protobuf:"bytes,8,opt,name=nameprice,proto3" json:"nameprice,omitempty"` + Totalvotingpower []byte `protobuf:"bytes,9,opt,name=totalvotingpower,proto3" json:"totalvotingpower,omitempty"` + Votingreward []byte `protobuf:"bytes,10,opt,name=votingreward,proto3" json:"votingreward,omitempty"` } -func (dst *ChainInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainInfo.Merge(dst, src) + +func (x *ChainInfo) Reset() { + *x = ChainInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ChainInfo) XXX_Size() int { - return xxx_messageInfo_ChainInfo.Size(m) + +func (x *ChainInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ChainInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ChainInfo.DiscardUnknown(m) + +func (*ChainInfo) ProtoMessage() {} + +func (x *ChainInfo) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ChainInfo proto.InternalMessageInfo +// Deprecated: Use ChainInfo.ProtoReflect.Descriptor instead. +func (*ChainInfo) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{2} +} -func (m *ChainInfo) GetId() *ChainId { - if m != nil { - return m.Id +func (x *ChainInfo) GetId() *ChainId { + if x != nil { + return x.Id } return nil } -func (m *ChainInfo) GetBpNumber() uint32 { - if m != nil { - return m.BpNumber +func (x *ChainInfo) GetBpNumber() uint32 { + if x != nil { + return x.BpNumber } return 0 } -func (m *ChainInfo) GetMaxblocksize() uint64 { - if m != nil { - return m.Maxblocksize +func (x *ChainInfo) GetMaxblocksize() uint64 { + if x != nil { + return x.Maxblocksize } return 0 } -func (m *ChainInfo) GetMaxtokens() []byte { - if m != nil { - return m.Maxtokens +func (x *ChainInfo) GetMaxtokens() []byte { + if x != nil { + return x.Maxtokens } return nil } -func (m *ChainInfo) GetStakingminimum() []byte { - if m != nil { - return m.Stakingminimum +func (x *ChainInfo) GetStakingminimum() []byte { + if x != nil { + return x.Stakingminimum } return nil } -func (m *ChainInfo) GetTotalstaking() []byte { - if m != nil { - return m.Totalstaking +func (x *ChainInfo) GetTotalstaking() []byte { + if x != nil { + return x.Totalstaking } return nil } -func (m *ChainInfo) GetGasprice() []byte { - if m != nil { - return m.Gasprice +func (x *ChainInfo) GetGasprice() []byte { + if x != nil { + return x.Gasprice } return nil } -func (m *ChainInfo) GetNameprice() []byte { - if m != nil { - return m.Nameprice +func (x *ChainInfo) GetNameprice() []byte { + if x != nil { + return x.Nameprice } return nil } -func (m *ChainInfo) GetTotalvotingpower() []byte { - if m != nil { - return m.Totalvotingpower +func (x *ChainInfo) GetTotalvotingpower() []byte { + if x != nil { + return x.Totalvotingpower } return nil } -func (m *ChainInfo) GetVotingreward() []byte { - if m != nil { - return m.Votingreward +func (x *ChainInfo) GetVotingreward() []byte { + if x != nil { + return x.Votingreward } return nil } // ChainStats corresponds to a chain statistics report. type ChainStats struct { - Report string `protobuf:"bytes,1,opt,name=report" json:"report,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ChainStats) Reset() { *m = ChainStats{} } -func (m *ChainStats) String() string { return proto.CompactTextString(m) } -func (*ChainStats) ProtoMessage() {} -func (*ChainStats) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{3} + Report string `protobuf:"bytes,1,opt,name=report,proto3" json:"report,omitempty"` } -func (m *ChainStats) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChainStats.Unmarshal(m, b) -} -func (m *ChainStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChainStats.Marshal(b, m, deterministic) -} -func (dst *ChainStats) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainStats.Merge(dst, src) + +func (x *ChainStats) Reset() { + *x = ChainStats{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ChainStats) XXX_Size() int { - return xxx_messageInfo_ChainStats.Size(m) + +func (x *ChainStats) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ChainStats) XXX_DiscardUnknown() { - xxx_messageInfo_ChainStats.DiscardUnknown(m) + +func (*ChainStats) ProtoMessage() {} + +func (x *ChainStats) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ChainStats proto.InternalMessageInfo +// Deprecated: Use ChainStats.ProtoReflect.Descriptor instead. +func (*ChainStats) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{3} +} -func (m *ChainStats) GetReport() string { - if m != nil { - return m.Report +func (x *ChainStats) GetReport() string { + if x != nil { + return x.Report } return "" } type Input struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Address [][]byte `protobuf:"bytes,2,rep,name=address,proto3" json:"address,omitempty"` - Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - Script []byte `protobuf:"bytes,4,opt,name=script,proto3" json:"script,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Input) Reset() { *m = Input{} } -func (m *Input) String() string { return proto.CompactTextString(m) } -func (*Input) ProtoMessage() {} -func (*Input) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{4} -} -func (m *Input) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Input.Unmarshal(m, b) -} -func (m *Input) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Input.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Address [][]byte `protobuf:"bytes,2,rep,name=address,proto3" json:"address,omitempty"` + Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + Script []byte `protobuf:"bytes,4,opt,name=script,proto3" json:"script,omitempty"` } -func (dst *Input) XXX_Merge(src proto.Message) { - xxx_messageInfo_Input.Merge(dst, src) + +func (x *Input) Reset() { + *x = Input{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Input) XXX_Size() int { - return xxx_messageInfo_Input.Size(m) + +func (x *Input) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Input) XXX_DiscardUnknown() { - xxx_messageInfo_Input.DiscardUnknown(m) + +func (*Input) ProtoMessage() {} + +func (x *Input) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Input proto.InternalMessageInfo +// Deprecated: Use Input.ProtoReflect.Descriptor instead. +func (*Input) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{4} +} -func (m *Input) GetHash() []byte { - if m != nil { - return m.Hash +func (x *Input) GetHash() []byte { + if x != nil { + return x.Hash } return nil } -func (m *Input) GetAddress() [][]byte { - if m != nil { - return m.Address +func (x *Input) GetAddress() [][]byte { + if x != nil { + return x.Address } return nil } -func (m *Input) GetValue() []byte { - if m != nil { - return m.Value +func (x *Input) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *Input) GetScript() []byte { - if m != nil { - return m.Script +func (x *Input) GetScript() []byte { + if x != nil { + return x.Script } return nil } type Output struct { - Index uint32 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"` - Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - Script []byte `protobuf:"bytes,4,opt,name=script,proto3" json:"script,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Output) Reset() { *m = Output{} } -func (m *Output) String() string { return proto.CompactTextString(m) } -func (*Output) ProtoMessage() {} -func (*Output) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{5} -} -func (m *Output) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Output.Unmarshal(m, b) -} -func (m *Output) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Output.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + Script []byte `protobuf:"bytes,4,opt,name=script,proto3" json:"script,omitempty"` } -func (dst *Output) XXX_Merge(src proto.Message) { - xxx_messageInfo_Output.Merge(dst, src) + +func (x *Output) Reset() { + *x = Output{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Output) XXX_Size() int { - return xxx_messageInfo_Output.Size(m) + +func (x *Output) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Output) XXX_DiscardUnknown() { - xxx_messageInfo_Output.DiscardUnknown(m) + +func (*Output) ProtoMessage() {} + +func (x *Output) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Output proto.InternalMessageInfo +// Deprecated: Use Output.ProtoReflect.Descriptor instead. +func (*Output) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{5} +} -func (m *Output) GetIndex() uint32 { - if m != nil { - return m.Index +func (x *Output) GetIndex() uint32 { + if x != nil { + return x.Index } return 0 } -func (m *Output) GetAddress() []byte { - if m != nil { - return m.Address +func (x *Output) GetAddress() []byte { + if x != nil { + return x.Address } return nil } -func (m *Output) GetValue() []byte { - if m != nil { - return m.Value +func (x *Output) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *Output) GetScript() []byte { - if m != nil { - return m.Script +func (x *Output) GetScript() []byte { + if x != nil { + return x.Script } return nil } type Empty struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto.CompactTextString(m) } -func (*Empty) ProtoMessage() {} -func (*Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{6} -} -func (m *Empty) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Empty.Unmarshal(m, b) -} -func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Empty.Marshal(b, m, deterministic) -} -func (dst *Empty) XXX_Merge(src proto.Message) { - xxx_messageInfo_Empty.Merge(dst, src) -} -func (m *Empty) XXX_Size() int { - return xxx_messageInfo_Empty.Size(m) +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Empty) XXX_DiscardUnknown() { - xxx_messageInfo_Empty.DiscardUnknown(m) + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_Empty proto.InternalMessageInfo +func (*Empty) ProtoMessage() {} -type SingleBytes struct { - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *SingleBytes) Reset() { *m = SingleBytes{} } -func (m *SingleBytes) String() string { return proto.CompactTextString(m) } -func (*SingleBytes) ProtoMessage() {} -func (*SingleBytes) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{7} -} -func (m *SingleBytes) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SingleBytes.Unmarshal(m, b) +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{6} } -func (m *SingleBytes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SingleBytes.Marshal(b, m, deterministic) + +type SingleBytes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } -func (dst *SingleBytes) XXX_Merge(src proto.Message) { - xxx_messageInfo_SingleBytes.Merge(dst, src) + +func (x *SingleBytes) Reset() { + *x = SingleBytes{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SingleBytes) XXX_Size() int { - return xxx_messageInfo_SingleBytes.Size(m) + +func (x *SingleBytes) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SingleBytes) XXX_DiscardUnknown() { - xxx_messageInfo_SingleBytes.DiscardUnknown(m) + +func (*SingleBytes) ProtoMessage() {} + +func (x *SingleBytes) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SingleBytes proto.InternalMessageInfo +// Deprecated: Use SingleBytes.ProtoReflect.Descriptor instead. +func (*SingleBytes) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{7} +} -func (m *SingleBytes) GetValue() []byte { - if m != nil { - return m.Value +func (x *SingleBytes) GetValue() []byte { + if x != nil { + return x.Value } return nil } type SingleString struct { - Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *SingleString) Reset() { *m = SingleString{} } -func (m *SingleString) String() string { return proto.CompactTextString(m) } -func (*SingleString) ProtoMessage() {} -func (*SingleString) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{8} -} -func (m *SingleString) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SingleString.Unmarshal(m, b) + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } -func (m *SingleString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SingleString.Marshal(b, m, deterministic) -} -func (dst *SingleString) XXX_Merge(src proto.Message) { - xxx_messageInfo_SingleString.Merge(dst, src) + +func (x *SingleString) Reset() { + *x = SingleString{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SingleString) XXX_Size() int { - return xxx_messageInfo_SingleString.Size(m) + +func (x *SingleString) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SingleString) XXX_DiscardUnknown() { - xxx_messageInfo_SingleString.DiscardUnknown(m) + +func (*SingleString) ProtoMessage() {} + +func (x *SingleString) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SingleString proto.InternalMessageInfo +// Deprecated: Use SingleString.ProtoReflect.Descriptor instead. +func (*SingleString) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{8} +} -func (m *SingleString) GetValue() string { - if m != nil { - return m.Value +func (x *SingleString) GetValue() string { + if x != nil { + return x.Value } return "" } type AccountAddress struct { - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AccountAddress) Reset() { *m = AccountAddress{} } -func (m *AccountAddress) String() string { return proto.CompactTextString(m) } -func (*AccountAddress) ProtoMessage() {} -func (*AccountAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{9} -} -func (m *AccountAddress) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AccountAddress.Unmarshal(m, b) + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } -func (m *AccountAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AccountAddress.Marshal(b, m, deterministic) -} -func (dst *AccountAddress) XXX_Merge(src proto.Message) { - xxx_messageInfo_AccountAddress.Merge(dst, src) + +func (x *AccountAddress) Reset() { + *x = AccountAddress{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AccountAddress) XXX_Size() int { - return xxx_messageInfo_AccountAddress.Size(m) + +func (x *AccountAddress) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AccountAddress) XXX_DiscardUnknown() { - xxx_messageInfo_AccountAddress.DiscardUnknown(m) + +func (*AccountAddress) ProtoMessage() {} + +func (x *AccountAddress) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AccountAddress proto.InternalMessageInfo +// Deprecated: Use AccountAddress.ProtoReflect.Descriptor instead. +func (*AccountAddress) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{9} +} -func (m *AccountAddress) GetValue() []byte { - if m != nil { - return m.Value +func (x *AccountAddress) GetValue() []byte { + if x != nil { + return x.Value } return nil } type AccountAndRoot struct { - Account []byte `protobuf:"bytes,1,opt,name=Account,proto3" json:"Account,omitempty"` - Root []byte `protobuf:"bytes,2,opt,name=Root,proto3" json:"Root,omitempty"` - Compressed bool `protobuf:"varint,3,opt,name=Compressed" json:"Compressed,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AccountAndRoot) Reset() { *m = AccountAndRoot{} } -func (m *AccountAndRoot) String() string { return proto.CompactTextString(m) } -func (*AccountAndRoot) ProtoMessage() {} -func (*AccountAndRoot) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{10} -} -func (m *AccountAndRoot) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AccountAndRoot.Unmarshal(m, b) + Account []byte `protobuf:"bytes,1,opt,name=Account,proto3" json:"Account,omitempty"` + Root []byte `protobuf:"bytes,2,opt,name=Root,proto3" json:"Root,omitempty"` + Compressed bool `protobuf:"varint,3,opt,name=Compressed,proto3" json:"Compressed,omitempty"` } -func (m *AccountAndRoot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AccountAndRoot.Marshal(b, m, deterministic) -} -func (dst *AccountAndRoot) XXX_Merge(src proto.Message) { - xxx_messageInfo_AccountAndRoot.Merge(dst, src) + +func (x *AccountAndRoot) Reset() { + *x = AccountAndRoot{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AccountAndRoot) XXX_Size() int { - return xxx_messageInfo_AccountAndRoot.Size(m) + +func (x *AccountAndRoot) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AccountAndRoot) XXX_DiscardUnknown() { - xxx_messageInfo_AccountAndRoot.DiscardUnknown(m) + +func (*AccountAndRoot) ProtoMessage() {} + +func (x *AccountAndRoot) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AccountAndRoot proto.InternalMessageInfo +// Deprecated: Use AccountAndRoot.ProtoReflect.Descriptor instead. +func (*AccountAndRoot) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{10} +} -func (m *AccountAndRoot) GetAccount() []byte { - if m != nil { - return m.Account +func (x *AccountAndRoot) GetAccount() []byte { + if x != nil { + return x.Account } return nil } -func (m *AccountAndRoot) GetRoot() []byte { - if m != nil { - return m.Root +func (x *AccountAndRoot) GetRoot() []byte { + if x != nil { + return x.Root } return nil } -func (m *AccountAndRoot) GetCompressed() bool { - if m != nil { - return m.Compressed +func (x *AccountAndRoot) GetCompressed() bool { + if x != nil { + return x.Compressed } return false } type Peer struct { - Address *PeerAddress `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` - Bestblock *NewBlockNotice `protobuf:"bytes,2,opt,name=bestblock" json:"bestblock,omitempty"` - State int32 `protobuf:"varint,3,opt,name=state" json:"state,omitempty"` - Hidden bool `protobuf:"varint,4,opt,name=hidden" json:"hidden,omitempty"` - LashCheck int64 `protobuf:"varint,5,opt,name=lashCheck" json:"lashCheck,omitempty"` - Selfpeer bool `protobuf:"varint,6,opt,name=selfpeer" json:"selfpeer,omitempty"` - Version string `protobuf:"bytes,7,opt,name=version" json:"version,omitempty"` - Certificates []*AgentCertificate `protobuf:"bytes,8,rep,name=certificates" json:"certificates,omitempty"` - AcceptedRole PeerRole `protobuf:"varint,9,opt,name=acceptedRole,enum=types.PeerRole" json:"acceptedRole,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Peer) Reset() { *m = Peer{} } -func (m *Peer) String() string { return proto.CompactTextString(m) } -func (*Peer) ProtoMessage() {} -func (*Peer) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{11} -} -func (m *Peer) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Peer.Unmarshal(m, b) -} -func (m *Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Peer.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address *PeerAddress `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Bestblock *NewBlockNotice `protobuf:"bytes,2,opt,name=bestblock,proto3" json:"bestblock,omitempty"` + State int32 `protobuf:"varint,3,opt,name=state,proto3" json:"state,omitempty"` + Hidden bool `protobuf:"varint,4,opt,name=hidden,proto3" json:"hidden,omitempty"` + LashCheck int64 `protobuf:"varint,5,opt,name=lashCheck,proto3" json:"lashCheck,omitempty"` + Selfpeer bool `protobuf:"varint,6,opt,name=selfpeer,proto3" json:"selfpeer,omitempty"` + Version string `protobuf:"bytes,7,opt,name=version,proto3" json:"version,omitempty"` + Certificates []*AgentCertificate `protobuf:"bytes,8,rep,name=certificates,proto3" json:"certificates,omitempty"` + AcceptedRole PeerRole `protobuf:"varint,9,opt,name=acceptedRole,proto3,enum=types.PeerRole" json:"acceptedRole,omitempty"` } -func (dst *Peer) XXX_Merge(src proto.Message) { - xxx_messageInfo_Peer.Merge(dst, src) + +func (x *Peer) Reset() { + *x = Peer{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Peer) XXX_Size() int { - return xxx_messageInfo_Peer.Size(m) + +func (x *Peer) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Peer) XXX_DiscardUnknown() { - xxx_messageInfo_Peer.DiscardUnknown(m) + +func (*Peer) ProtoMessage() {} + +func (x *Peer) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Peer proto.InternalMessageInfo +// Deprecated: Use Peer.ProtoReflect.Descriptor instead. +func (*Peer) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{11} +} -func (m *Peer) GetAddress() *PeerAddress { - if m != nil { - return m.Address +func (x *Peer) GetAddress() *PeerAddress { + if x != nil { + return x.Address } return nil } -func (m *Peer) GetBestblock() *NewBlockNotice { - if m != nil { - return m.Bestblock +func (x *Peer) GetBestblock() *NewBlockNotice { + if x != nil { + return x.Bestblock } return nil } -func (m *Peer) GetState() int32 { - if m != nil { - return m.State +func (x *Peer) GetState() int32 { + if x != nil { + return x.State } return 0 } -func (m *Peer) GetHidden() bool { - if m != nil { - return m.Hidden +func (x *Peer) GetHidden() bool { + if x != nil { + return x.Hidden } return false } -func (m *Peer) GetLashCheck() int64 { - if m != nil { - return m.LashCheck +func (x *Peer) GetLashCheck() int64 { + if x != nil { + return x.LashCheck } return 0 } -func (m *Peer) GetSelfpeer() bool { - if m != nil { - return m.Selfpeer +func (x *Peer) GetSelfpeer() bool { + if x != nil { + return x.Selfpeer } return false } -func (m *Peer) GetVersion() string { - if m != nil { - return m.Version +func (x *Peer) GetVersion() string { + if x != nil { + return x.Version } return "" } -func (m *Peer) GetCertificates() []*AgentCertificate { - if m != nil { - return m.Certificates +func (x *Peer) GetCertificates() []*AgentCertificate { + if x != nil { + return x.Certificates } return nil } -func (m *Peer) GetAcceptedRole() PeerRole { - if m != nil { - return m.AcceptedRole +func (x *Peer) GetAcceptedRole() PeerRole { + if x != nil { + return x.AcceptedRole } return PeerRole_LegacyVersion } type PeerList struct { - Peers []*Peer `protobuf:"bytes,1,rep,name=peers" json:"peers,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *PeerList) Reset() { *m = PeerList{} } -func (m *PeerList) String() string { return proto.CompactTextString(m) } -func (*PeerList) ProtoMessage() {} -func (*PeerList) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{12} -} -func (m *PeerList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PeerList.Unmarshal(m, b) + Peers []*Peer `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` } -func (m *PeerList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PeerList.Marshal(b, m, deterministic) -} -func (dst *PeerList) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeerList.Merge(dst, src) + +func (x *PeerList) Reset() { + *x = PeerList{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PeerList) XXX_Size() int { - return xxx_messageInfo_PeerList.Size(m) + +func (x *PeerList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PeerList) XXX_DiscardUnknown() { - xxx_messageInfo_PeerList.DiscardUnknown(m) + +func (*PeerList) ProtoMessage() {} + +func (x *PeerList) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PeerList proto.InternalMessageInfo +// Deprecated: Use PeerList.ProtoReflect.Descriptor instead. +func (*PeerList) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{12} +} -func (m *PeerList) GetPeers() []*Peer { - if m != nil { - return m.Peers +func (x *PeerList) GetPeers() []*Peer { + if x != nil { + return x.Peers } return nil } type ListParams struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Height uint64 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"` - Size uint32 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"` - Offset uint32 `protobuf:"varint,4,opt,name=offset" json:"offset,omitempty"` - Asc bool `protobuf:"varint,5,opt,name=asc" json:"asc,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ListParams) Reset() { *m = ListParams{} } -func (m *ListParams) String() string { return proto.CompactTextString(m) } -func (*ListParams) ProtoMessage() {} -func (*ListParams) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{13} -} -func (m *ListParams) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListParams.Unmarshal(m, b) -} -func (m *ListParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListParams.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Size uint32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` + Offset uint32 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` + Asc bool `protobuf:"varint,5,opt,name=asc,proto3" json:"asc,omitempty"` } -func (dst *ListParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListParams.Merge(dst, src) + +func (x *ListParams) Reset() { + *x = ListParams{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ListParams) XXX_Size() int { - return xxx_messageInfo_ListParams.Size(m) + +func (x *ListParams) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ListParams) XXX_DiscardUnknown() { - xxx_messageInfo_ListParams.DiscardUnknown(m) + +func (*ListParams) ProtoMessage() {} + +func (x *ListParams) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ListParams proto.InternalMessageInfo +// Deprecated: Use ListParams.ProtoReflect.Descriptor instead. +func (*ListParams) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{13} +} -func (m *ListParams) GetHash() []byte { - if m != nil { - return m.Hash +func (x *ListParams) GetHash() []byte { + if x != nil { + return x.Hash } return nil } -func (m *ListParams) GetHeight() uint64 { - if m != nil { - return m.Height +func (x *ListParams) GetHeight() uint64 { + if x != nil { + return x.Height } return 0 } -func (m *ListParams) GetSize() uint32 { - if m != nil { - return m.Size +func (x *ListParams) GetSize() uint32 { + if x != nil { + return x.Size } return 0 } -func (m *ListParams) GetOffset() uint32 { - if m != nil { - return m.Offset +func (x *ListParams) GetOffset() uint32 { + if x != nil { + return x.Offset } return 0 } -func (m *ListParams) GetAsc() bool { - if m != nil { - return m.Asc +func (x *ListParams) GetAsc() bool { + if x != nil { + return x.Asc } return false } type PageParams struct { - Offset uint32 `protobuf:"varint,1,opt,name=offset" json:"offset,omitempty"` - Size uint32 `protobuf:"varint,2,opt,name=size" json:"size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *PageParams) Reset() { *m = PageParams{} } -func (m *PageParams) String() string { return proto.CompactTextString(m) } -func (*PageParams) ProtoMessage() {} -func (*PageParams) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{14} -} -func (m *PageParams) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PageParams.Unmarshal(m, b) + Offset uint32 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` + Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` } -func (m *PageParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PageParams.Marshal(b, m, deterministic) -} -func (dst *PageParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_PageParams.Merge(dst, src) + +func (x *PageParams) Reset() { + *x = PageParams{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PageParams) XXX_Size() int { - return xxx_messageInfo_PageParams.Size(m) + +func (x *PageParams) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PageParams) XXX_DiscardUnknown() { - xxx_messageInfo_PageParams.DiscardUnknown(m) + +func (*PageParams) ProtoMessage() {} + +func (x *PageParams) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PageParams proto.InternalMessageInfo +// Deprecated: Use PageParams.ProtoReflect.Descriptor instead. +func (*PageParams) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{14} +} -func (m *PageParams) GetOffset() uint32 { - if m != nil { - return m.Offset +func (x *PageParams) GetOffset() uint32 { + if x != nil { + return x.Offset } return 0 } -func (m *PageParams) GetSize() uint32 { - if m != nil { - return m.Size +func (x *PageParams) GetSize() uint32 { + if x != nil { + return x.Size } return 0 } type BlockBodyPaged struct { - Total uint32 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"` - Offset uint32 `protobuf:"varint,2,opt,name=offset" json:"offset,omitempty"` - Size uint32 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"` - Body *BlockBody `protobuf:"bytes,4,opt,name=body" json:"body,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockBodyPaged) Reset() { *m = BlockBodyPaged{} } -func (m *BlockBodyPaged) String() string { return proto.CompactTextString(m) } -func (*BlockBodyPaged) ProtoMessage() {} -func (*BlockBodyPaged) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{15} -} -func (m *BlockBodyPaged) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockBodyPaged.Unmarshal(m, b) -} -func (m *BlockBodyPaged) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockBodyPaged.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` + Offset uint32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + Size uint32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` + Body *BlockBody `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` } -func (dst *BlockBodyPaged) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockBodyPaged.Merge(dst, src) + +func (x *BlockBodyPaged) Reset() { + *x = BlockBodyPaged{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BlockBodyPaged) XXX_Size() int { - return xxx_messageInfo_BlockBodyPaged.Size(m) + +func (x *BlockBodyPaged) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BlockBodyPaged) XXX_DiscardUnknown() { - xxx_messageInfo_BlockBodyPaged.DiscardUnknown(m) + +func (*BlockBodyPaged) ProtoMessage() {} + +func (x *BlockBodyPaged) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BlockBodyPaged proto.InternalMessageInfo +// Deprecated: Use BlockBodyPaged.ProtoReflect.Descriptor instead. +func (*BlockBodyPaged) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{15} +} -func (m *BlockBodyPaged) GetTotal() uint32 { - if m != nil { - return m.Total +func (x *BlockBodyPaged) GetTotal() uint32 { + if x != nil { + return x.Total } return 0 } -func (m *BlockBodyPaged) GetOffset() uint32 { - if m != nil { - return m.Offset +func (x *BlockBodyPaged) GetOffset() uint32 { + if x != nil { + return x.Offset } return 0 } -func (m *BlockBodyPaged) GetSize() uint32 { - if m != nil { - return m.Size +func (x *BlockBodyPaged) GetSize() uint32 { + if x != nil { + return x.Size } return 0 } -func (m *BlockBodyPaged) GetBody() *BlockBody { - if m != nil { - return m.Body +func (x *BlockBodyPaged) GetBody() *BlockBody { + if x != nil { + return x.Body } return nil } type BlockBodyParams struct { - Hashornumber []byte `protobuf:"bytes,1,opt,name=hashornumber,proto3" json:"hashornumber,omitempty"` - Paging *PageParams `protobuf:"bytes,2,opt,name=paging" json:"paging,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *BlockBodyParams) Reset() { *m = BlockBodyParams{} } -func (m *BlockBodyParams) String() string { return proto.CompactTextString(m) } -func (*BlockBodyParams) ProtoMessage() {} -func (*BlockBodyParams) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{16} -} -func (m *BlockBodyParams) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockBodyParams.Unmarshal(m, b) + Hashornumber []byte `protobuf:"bytes,1,opt,name=hashornumber,proto3" json:"hashornumber,omitempty"` + Paging *PageParams `protobuf:"bytes,2,opt,name=paging,proto3" json:"paging,omitempty"` } -func (m *BlockBodyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockBodyParams.Marshal(b, m, deterministic) -} -func (dst *BlockBodyParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockBodyParams.Merge(dst, src) + +func (x *BlockBodyParams) Reset() { + *x = BlockBodyParams{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BlockBodyParams) XXX_Size() int { - return xxx_messageInfo_BlockBodyParams.Size(m) + +func (x *BlockBodyParams) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BlockBodyParams) XXX_DiscardUnknown() { - xxx_messageInfo_BlockBodyParams.DiscardUnknown(m) + +func (*BlockBodyParams) ProtoMessage() {} + +func (x *BlockBodyParams) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BlockBodyParams proto.InternalMessageInfo +// Deprecated: Use BlockBodyParams.ProtoReflect.Descriptor instead. +func (*BlockBodyParams) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{16} +} -func (m *BlockBodyParams) GetHashornumber() []byte { - if m != nil { - return m.Hashornumber +func (x *BlockBodyParams) GetHashornumber() []byte { + if x != nil { + return x.Hashornumber } return nil } -func (m *BlockBodyParams) GetPaging() *PageParams { - if m != nil { - return m.Paging +func (x *BlockBodyParams) GetPaging() *PageParams { + if x != nil { + return x.Paging } return nil } type BlockHeaderList struct { - Blocks []*Block `protobuf:"bytes,1,rep,name=blocks" json:"blocks,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *BlockHeaderList) Reset() { *m = BlockHeaderList{} } -func (m *BlockHeaderList) String() string { return proto.CompactTextString(m) } -func (*BlockHeaderList) ProtoMessage() {} -func (*BlockHeaderList) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{17} -} -func (m *BlockHeaderList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockHeaderList.Unmarshal(m, b) + Blocks []*Block `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` } -func (m *BlockHeaderList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockHeaderList.Marshal(b, m, deterministic) -} -func (dst *BlockHeaderList) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockHeaderList.Merge(dst, src) + +func (x *BlockHeaderList) Reset() { + *x = BlockHeaderList{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BlockHeaderList) XXX_Size() int { - return xxx_messageInfo_BlockHeaderList.Size(m) + +func (x *BlockHeaderList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BlockHeaderList) XXX_DiscardUnknown() { - xxx_messageInfo_BlockHeaderList.DiscardUnknown(m) + +func (*BlockHeaderList) ProtoMessage() {} + +func (x *BlockHeaderList) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BlockHeaderList proto.InternalMessageInfo +// Deprecated: Use BlockHeaderList.ProtoReflect.Descriptor instead. +func (*BlockHeaderList) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{17} +} -func (m *BlockHeaderList) GetBlocks() []*Block { - if m != nil { - return m.Blocks +func (x *BlockHeaderList) GetBlocks() []*Block { + if x != nil { + return x.Blocks } return nil } type BlockMetadata struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Header *BlockHeader `protobuf:"bytes,2,opt,name=header" json:"header,omitempty"` - Txcount int32 `protobuf:"varint,3,opt,name=txcount" json:"txcount,omitempty"` - Size int64 `protobuf:"varint,4,opt,name=size" json:"size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockMetadata) Reset() { *m = BlockMetadata{} } -func (m *BlockMetadata) String() string { return proto.CompactTextString(m) } -func (*BlockMetadata) ProtoMessage() {} -func (*BlockMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{18} -} -func (m *BlockMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockMetadata.Unmarshal(m, b) -} -func (m *BlockMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockMetadata.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Header *BlockHeader `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"` + Txcount int32 `protobuf:"varint,3,opt,name=txcount,proto3" json:"txcount,omitempty"` + Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` // blocksize in bytes } -func (dst *BlockMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockMetadata.Merge(dst, src) + +func (x *BlockMetadata) Reset() { + *x = BlockMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BlockMetadata) XXX_Size() int { - return xxx_messageInfo_BlockMetadata.Size(m) + +func (x *BlockMetadata) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BlockMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_BlockMetadata.DiscardUnknown(m) + +func (*BlockMetadata) ProtoMessage() {} + +func (x *BlockMetadata) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BlockMetadata proto.InternalMessageInfo +// Deprecated: Use BlockMetadata.ProtoReflect.Descriptor instead. +func (*BlockMetadata) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{18} +} -func (m *BlockMetadata) GetHash() []byte { - if m != nil { - return m.Hash +func (x *BlockMetadata) GetHash() []byte { + if x != nil { + return x.Hash } return nil } -func (m *BlockMetadata) GetHeader() *BlockHeader { - if m != nil { - return m.Header +func (x *BlockMetadata) GetHeader() *BlockHeader { + if x != nil { + return x.Header } return nil } -func (m *BlockMetadata) GetTxcount() int32 { - if m != nil { - return m.Txcount +func (x *BlockMetadata) GetTxcount() int32 { + if x != nil { + return x.Txcount } return 0 } -func (m *BlockMetadata) GetSize() int64 { - if m != nil { - return m.Size +func (x *BlockMetadata) GetSize() int64 { + if x != nil { + return x.Size } return 0 } type BlockMetadataList struct { - Blocks []*BlockMetadata `protobuf:"bytes,1,rep,name=blocks" json:"blocks,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blocks []*BlockMetadata `protobuf:"bytes,1,rep,name=blocks,proto3" json:"blocks,omitempty"` } -func (m *BlockMetadataList) Reset() { *m = BlockMetadataList{} } -func (m *BlockMetadataList) String() string { return proto.CompactTextString(m) } -func (*BlockMetadataList) ProtoMessage() {} -func (*BlockMetadataList) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{19} +func (x *BlockMetadataList) Reset() { + *x = BlockMetadataList{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BlockMetadataList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockMetadataList.Unmarshal(m, b) -} -func (m *BlockMetadataList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockMetadataList.Marshal(b, m, deterministic) -} -func (dst *BlockMetadataList) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockMetadataList.Merge(dst, src) -} -func (m *BlockMetadataList) XXX_Size() int { - return xxx_messageInfo_BlockMetadataList.Size(m) + +func (x *BlockMetadataList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BlockMetadataList) XXX_DiscardUnknown() { - xxx_messageInfo_BlockMetadataList.DiscardUnknown(m) + +func (*BlockMetadataList) ProtoMessage() {} + +func (x *BlockMetadataList) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BlockMetadataList proto.InternalMessageInfo +// Deprecated: Use BlockMetadataList.ProtoReflect.Descriptor instead. +func (*BlockMetadataList) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{19} +} -func (m *BlockMetadataList) GetBlocks() []*BlockMetadata { - if m != nil { - return m.Blocks +func (x *BlockMetadataList) GetBlocks() []*BlockMetadata { + if x != nil { + return x.Blocks } return nil } type CommitResult struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Error CommitStatus `protobuf:"varint,2,opt,name=error,enum=types.CommitStatus" json:"error,omitempty"` - Detail string `protobuf:"bytes,3,opt,name=detail" json:"detail,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *CommitResult) Reset() { *m = CommitResult{} } -func (m *CommitResult) String() string { return proto.CompactTextString(m) } -func (*CommitResult) ProtoMessage() {} -func (*CommitResult) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{20} -} -func (m *CommitResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommitResult.Unmarshal(m, b) + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Error CommitStatus `protobuf:"varint,2,opt,name=error,proto3,enum=types.CommitStatus" json:"error,omitempty"` + Detail string `protobuf:"bytes,3,opt,name=detail,proto3" json:"detail,omitempty"` } -func (m *CommitResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommitResult.Marshal(b, m, deterministic) -} -func (dst *CommitResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommitResult.Merge(dst, src) + +func (x *CommitResult) Reset() { + *x = CommitResult{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CommitResult) XXX_Size() int { - return xxx_messageInfo_CommitResult.Size(m) + +func (x *CommitResult) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CommitResult) XXX_DiscardUnknown() { - xxx_messageInfo_CommitResult.DiscardUnknown(m) + +func (*CommitResult) ProtoMessage() {} + +func (x *CommitResult) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CommitResult proto.InternalMessageInfo +// Deprecated: Use CommitResult.ProtoReflect.Descriptor instead. +func (*CommitResult) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{20} +} -func (m *CommitResult) GetHash() []byte { - if m != nil { - return m.Hash +func (x *CommitResult) GetHash() []byte { + if x != nil { + return x.Hash } return nil } -func (m *CommitResult) GetError() CommitStatus { - if m != nil { - return m.Error +func (x *CommitResult) GetError() CommitStatus { + if x != nil { + return x.Error } return CommitStatus_TX_OK } -func (m *CommitResult) GetDetail() string { - if m != nil { - return m.Detail +func (x *CommitResult) GetDetail() string { + if x != nil { + return x.Detail } return "" } type CommitResultList struct { - Results []*CommitResult `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *CommitResultList) Reset() { *m = CommitResultList{} } -func (m *CommitResultList) String() string { return proto.CompactTextString(m) } -func (*CommitResultList) ProtoMessage() {} -func (*CommitResultList) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{21} -} -func (m *CommitResultList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommitResultList.Unmarshal(m, b) + Results []*CommitResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } -func (m *CommitResultList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommitResultList.Marshal(b, m, deterministic) -} -func (dst *CommitResultList) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommitResultList.Merge(dst, src) + +func (x *CommitResultList) Reset() { + *x = CommitResultList{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CommitResultList) XXX_Size() int { - return xxx_messageInfo_CommitResultList.Size(m) + +func (x *CommitResultList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CommitResultList) XXX_DiscardUnknown() { - xxx_messageInfo_CommitResultList.DiscardUnknown(m) + +func (*CommitResultList) ProtoMessage() {} + +func (x *CommitResultList) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CommitResultList proto.InternalMessageInfo +// Deprecated: Use CommitResultList.ProtoReflect.Descriptor instead. +func (*CommitResultList) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{21} +} -func (m *CommitResultList) GetResults() []*CommitResult { - if m != nil { - return m.Results +func (x *CommitResultList) GetResults() []*CommitResult { + if x != nil { + return x.Results } return nil } type VerifyResult struct { - Tx *Tx `protobuf:"bytes,1,opt,name=tx" json:"tx,omitempty"` - Error VerifyStatus `protobuf:"varint,2,opt,name=error,enum=types.VerifyStatus" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *VerifyResult) Reset() { *m = VerifyResult{} } -func (m *VerifyResult) String() string { return proto.CompactTextString(m) } -func (*VerifyResult) ProtoMessage() {} -func (*VerifyResult) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{22} -} -func (m *VerifyResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VerifyResult.Unmarshal(m, b) + Tx *Tx `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` + Error VerifyStatus `protobuf:"varint,2,opt,name=error,proto3,enum=types.VerifyStatus" json:"error,omitempty"` } -func (m *VerifyResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VerifyResult.Marshal(b, m, deterministic) -} -func (dst *VerifyResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_VerifyResult.Merge(dst, src) + +func (x *VerifyResult) Reset() { + *x = VerifyResult{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *VerifyResult) XXX_Size() int { - return xxx_messageInfo_VerifyResult.Size(m) + +func (x *VerifyResult) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *VerifyResult) XXX_DiscardUnknown() { - xxx_messageInfo_VerifyResult.DiscardUnknown(m) + +func (*VerifyResult) ProtoMessage() {} + +func (x *VerifyResult) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_VerifyResult proto.InternalMessageInfo +// Deprecated: Use VerifyResult.ProtoReflect.Descriptor instead. +func (*VerifyResult) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{22} +} -func (m *VerifyResult) GetTx() *Tx { - if m != nil { - return m.Tx +func (x *VerifyResult) GetTx() *Tx { + if x != nil { + return x.Tx } return nil } -func (m *VerifyResult) GetError() VerifyStatus { - if m != nil { - return m.Error +func (x *VerifyResult) GetError() VerifyStatus { + if x != nil { + return x.Error } return VerifyStatus_VERIFY_STATUS_OK } type Personal struct { - Passphrase string `protobuf:"bytes,1,opt,name=passphrase" json:"passphrase,omitempty"` - Account *Account `protobuf:"bytes,2,opt,name=account" json:"account,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Personal) Reset() { *m = Personal{} } -func (m *Personal) String() string { return proto.CompactTextString(m) } -func (*Personal) ProtoMessage() {} -func (*Personal) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{23} -} -func (m *Personal) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Personal.Unmarshal(m, b) + Passphrase string `protobuf:"bytes,1,opt,name=passphrase,proto3" json:"passphrase,omitempty"` + Account *Account `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"` } -func (m *Personal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Personal.Marshal(b, m, deterministic) -} -func (dst *Personal) XXX_Merge(src proto.Message) { - xxx_messageInfo_Personal.Merge(dst, src) + +func (x *Personal) Reset() { + *x = Personal{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Personal) XXX_Size() int { - return xxx_messageInfo_Personal.Size(m) + +func (x *Personal) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Personal) XXX_DiscardUnknown() { - xxx_messageInfo_Personal.DiscardUnknown(m) + +func (*Personal) ProtoMessage() {} + +func (x *Personal) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Personal proto.InternalMessageInfo +// Deprecated: Use Personal.ProtoReflect.Descriptor instead. +func (*Personal) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{23} +} -func (m *Personal) GetPassphrase() string { - if m != nil { - return m.Passphrase +func (x *Personal) GetPassphrase() string { + if x != nil { + return x.Passphrase } return "" } -func (m *Personal) GetAccount() *Account { - if m != nil { - return m.Account +func (x *Personal) GetAccount() *Account { + if x != nil { + return x.Account } return nil } type ImportFormat struct { - Wif *SingleBytes `protobuf:"bytes,1,opt,name=wif" json:"wif,omitempty"` - Oldpass string `protobuf:"bytes,2,opt,name=oldpass" json:"oldpass,omitempty"` - Newpass string `protobuf:"bytes,3,opt,name=newpass" json:"newpass,omitempty"` - Keystore *SingleBytes `protobuf:"bytes,4,opt,name=keystore" json:"keystore,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ImportFormat) Reset() { *m = ImportFormat{} } -func (m *ImportFormat) String() string { return proto.CompactTextString(m) } -func (*ImportFormat) ProtoMessage() {} -func (*ImportFormat) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{24} -} -func (m *ImportFormat) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ImportFormat.Unmarshal(m, b) -} -func (m *ImportFormat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ImportFormat.Marshal(b, m, deterministic) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Wif *SingleBytes `protobuf:"bytes,1,opt,name=wif,proto3" json:"wif,omitempty"` + Oldpass string `protobuf:"bytes,2,opt,name=oldpass,proto3" json:"oldpass,omitempty"` + Newpass string `protobuf:"bytes,3,opt,name=newpass,proto3" json:"newpass,omitempty"` + Keystore *SingleBytes `protobuf:"bytes,4,opt,name=keystore,proto3" json:"keystore,omitempty"` } -func (dst *ImportFormat) XXX_Merge(src proto.Message) { - xxx_messageInfo_ImportFormat.Merge(dst, src) + +func (x *ImportFormat) Reset() { + *x = ImportFormat{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ImportFormat) XXX_Size() int { - return xxx_messageInfo_ImportFormat.Size(m) + +func (x *ImportFormat) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ImportFormat) XXX_DiscardUnknown() { - xxx_messageInfo_ImportFormat.DiscardUnknown(m) + +func (*ImportFormat) ProtoMessage() {} + +func (x *ImportFormat) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ImportFormat proto.InternalMessageInfo +// Deprecated: Use ImportFormat.ProtoReflect.Descriptor instead. +func (*ImportFormat) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{24} +} -func (m *ImportFormat) GetWif() *SingleBytes { - if m != nil { - return m.Wif +func (x *ImportFormat) GetWif() *SingleBytes { + if x != nil { + return x.Wif } return nil } -func (m *ImportFormat) GetOldpass() string { - if m != nil { - return m.Oldpass +func (x *ImportFormat) GetOldpass() string { + if x != nil { + return x.Oldpass } return "" } -func (m *ImportFormat) GetNewpass() string { - if m != nil { - return m.Newpass +func (x *ImportFormat) GetNewpass() string { + if x != nil { + return x.Newpass } return "" } -func (m *ImportFormat) GetKeystore() *SingleBytes { - if m != nil { - return m.Keystore +func (x *ImportFormat) GetKeystore() *SingleBytes { + if x != nil { + return x.Keystore } return nil } type Staking struct { - Amount []byte `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` - When uint64 `protobuf:"varint,2,opt,name=when" json:"when,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Staking) Reset() { *m = Staking{} } -func (m *Staking) String() string { return proto.CompactTextString(m) } -func (*Staking) ProtoMessage() {} -func (*Staking) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{25} -} -func (m *Staking) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Staking.Unmarshal(m, b) + Amount []byte `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` + When uint64 `protobuf:"varint,2,opt,name=when,proto3" json:"when,omitempty"` } -func (m *Staking) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Staking.Marshal(b, m, deterministic) -} -func (dst *Staking) XXX_Merge(src proto.Message) { - xxx_messageInfo_Staking.Merge(dst, src) + +func (x *Staking) Reset() { + *x = Staking{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Staking) XXX_Size() int { - return xxx_messageInfo_Staking.Size(m) + +func (x *Staking) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Staking) XXX_DiscardUnknown() { - xxx_messageInfo_Staking.DiscardUnknown(m) + +func (*Staking) ProtoMessage() {} + +func (x *Staking) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Staking proto.InternalMessageInfo +// Deprecated: Use Staking.ProtoReflect.Descriptor instead. +func (*Staking) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{25} +} -func (m *Staking) GetAmount() []byte { - if m != nil { - return m.Amount +func (x *Staking) GetAmount() []byte { + if x != nil { + return x.Amount } return nil } -func (m *Staking) GetWhen() uint64 { - if m != nil { - return m.When +func (x *Staking) GetWhen() uint64 { + if x != nil { + return x.When } return 0 } type Vote struct { - Candidate []byte `protobuf:"bytes,1,opt,name=candidate,proto3" json:"candidate,omitempty"` - Amount []byte `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Vote) Reset() { *m = Vote{} } -func (m *Vote) String() string { return proto.CompactTextString(m) } -func (*Vote) ProtoMessage() {} -func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{26} -} -func (m *Vote) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Vote.Unmarshal(m, b) + Candidate []byte `protobuf:"bytes,1,opt,name=candidate,proto3" json:"candidate,omitempty"` + Amount []byte `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` } -func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Vote.Marshal(b, m, deterministic) -} -func (dst *Vote) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vote.Merge(dst, src) + +func (x *Vote) Reset() { + *x = Vote{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Vote) XXX_Size() int { - return xxx_messageInfo_Vote.Size(m) + +func (x *Vote) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Vote) XXX_DiscardUnknown() { - xxx_messageInfo_Vote.DiscardUnknown(m) + +func (*Vote) ProtoMessage() {} + +func (x *Vote) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Vote proto.InternalMessageInfo +// Deprecated: Use Vote.ProtoReflect.Descriptor instead. +func (*Vote) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{26} +} -func (m *Vote) GetCandidate() []byte { - if m != nil { - return m.Candidate +func (x *Vote) GetCandidate() []byte { + if x != nil { + return x.Candidate } return nil } -func (m *Vote) GetAmount() []byte { - if m != nil { - return m.Amount +func (x *Vote) GetAmount() []byte { + if x != nil { + return x.Amount } return nil } type VoteParams struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Count uint32 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *VoteParams) Reset() { *m = VoteParams{} } -func (m *VoteParams) String() string { return proto.CompactTextString(m) } -func (*VoteParams) ProtoMessage() {} -func (*VoteParams) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{27} -} -func (m *VoteParams) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VoteParams.Unmarshal(m, b) + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` } -func (m *VoteParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VoteParams.Marshal(b, m, deterministic) -} -func (dst *VoteParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_VoteParams.Merge(dst, src) + +func (x *VoteParams) Reset() { + *x = VoteParams{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *VoteParams) XXX_Size() int { - return xxx_messageInfo_VoteParams.Size(m) + +func (x *VoteParams) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *VoteParams) XXX_DiscardUnknown() { - xxx_messageInfo_VoteParams.DiscardUnknown(m) + +func (*VoteParams) ProtoMessage() {} + +func (x *VoteParams) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_VoteParams proto.InternalMessageInfo +// Deprecated: Use VoteParams.ProtoReflect.Descriptor instead. +func (*VoteParams) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{27} +} -func (m *VoteParams) GetId() string { - if m != nil { - return m.Id +func (x *VoteParams) GetId() string { + if x != nil { + return x.Id } return "" } -func (m *VoteParams) GetCount() uint32 { - if m != nil { - return m.Count +func (x *VoteParams) GetCount() uint32 { + if x != nil { + return x.Count } return 0 } type AccountVoteInfo struct { - Staking *Staking `protobuf:"bytes,1,opt,name=staking" json:"staking,omitempty"` - Voting []*VoteInfo `protobuf:"bytes,2,rep,name=voting" json:"voting,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *AccountVoteInfo) Reset() { *m = AccountVoteInfo{} } -func (m *AccountVoteInfo) String() string { return proto.CompactTextString(m) } -func (*AccountVoteInfo) ProtoMessage() {} -func (*AccountVoteInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{28} -} -func (m *AccountVoteInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AccountVoteInfo.Unmarshal(m, b) + Staking *Staking `protobuf:"bytes,1,opt,name=staking,proto3" json:"staking,omitempty"` + Voting []*VoteInfo `protobuf:"bytes,2,rep,name=voting,proto3" json:"voting,omitempty"` } -func (m *AccountVoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AccountVoteInfo.Marshal(b, m, deterministic) -} -func (dst *AccountVoteInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_AccountVoteInfo.Merge(dst, src) + +func (x *AccountVoteInfo) Reset() { + *x = AccountVoteInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *AccountVoteInfo) XXX_Size() int { - return xxx_messageInfo_AccountVoteInfo.Size(m) + +func (x *AccountVoteInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *AccountVoteInfo) XXX_DiscardUnknown() { - xxx_messageInfo_AccountVoteInfo.DiscardUnknown(m) + +func (*AccountVoteInfo) ProtoMessage() {} + +func (x *AccountVoteInfo) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_AccountVoteInfo proto.InternalMessageInfo +// Deprecated: Use AccountVoteInfo.ProtoReflect.Descriptor instead. +func (*AccountVoteInfo) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{28} +} -func (m *AccountVoteInfo) GetStaking() *Staking { - if m != nil { - return m.Staking +func (x *AccountVoteInfo) GetStaking() *Staking { + if x != nil { + return x.Staking } return nil } -func (m *AccountVoteInfo) GetVoting() []*VoteInfo { - if m != nil { - return m.Voting +func (x *AccountVoteInfo) GetVoting() []*VoteInfo { + if x != nil { + return x.Voting } return nil } type VoteInfo struct { - Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` - Candidates []string `protobuf:"bytes,2,rep,name=candidates" json:"candidates,omitempty"` - Amount string `protobuf:"bytes,3,opt,name=amount" json:"amount,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *VoteInfo) Reset() { *m = VoteInfo{} } -func (m *VoteInfo) String() string { return proto.CompactTextString(m) } -func (*VoteInfo) ProtoMessage() {} -func (*VoteInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{29} -} -func (m *VoteInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VoteInfo.Unmarshal(m, b) + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Candidates []string `protobuf:"bytes,2,rep,name=candidates,proto3" json:"candidates,omitempty"` + Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` } -func (m *VoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VoteInfo.Marshal(b, m, deterministic) -} -func (dst *VoteInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_VoteInfo.Merge(dst, src) + +func (x *VoteInfo) Reset() { + *x = VoteInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *VoteInfo) XXX_Size() int { - return xxx_messageInfo_VoteInfo.Size(m) + +func (x *VoteInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *VoteInfo) XXX_DiscardUnknown() { - xxx_messageInfo_VoteInfo.DiscardUnknown(m) + +func (*VoteInfo) ProtoMessage() {} + +func (x *VoteInfo) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_VoteInfo proto.InternalMessageInfo +// Deprecated: Use VoteInfo.ProtoReflect.Descriptor instead. +func (*VoteInfo) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{29} +} -func (m *VoteInfo) GetId() string { - if m != nil { - return m.Id +func (x *VoteInfo) GetId() string { + if x != nil { + return x.Id } return "" } -func (m *VoteInfo) GetCandidates() []string { - if m != nil { - return m.Candidates +func (x *VoteInfo) GetCandidates() []string { + if x != nil { + return x.Candidates } return nil } -func (m *VoteInfo) GetAmount() string { - if m != nil { - return m.Amount +func (x *VoteInfo) GetAmount() string { + if x != nil { + return x.Amount } return "" } type VoteList struct { - Votes []*Vote `protobuf:"bytes,1,rep,name=votes" json:"votes,omitempty"` - Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *VoteList) Reset() { *m = VoteList{} } -func (m *VoteList) String() string { return proto.CompactTextString(m) } -func (*VoteList) ProtoMessage() {} -func (*VoteList) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{30} -} -func (m *VoteList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VoteList.Unmarshal(m, b) + Votes []*Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes,omitempty"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` } -func (m *VoteList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VoteList.Marshal(b, m, deterministic) -} -func (dst *VoteList) XXX_Merge(src proto.Message) { - xxx_messageInfo_VoteList.Merge(dst, src) + +func (x *VoteList) Reset() { + *x = VoteList{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *VoteList) XXX_Size() int { - return xxx_messageInfo_VoteList.Size(m) + +func (x *VoteList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *VoteList) XXX_DiscardUnknown() { - xxx_messageInfo_VoteList.DiscardUnknown(m) + +func (*VoteList) ProtoMessage() {} + +func (x *VoteList) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_VoteList proto.InternalMessageInfo +// Deprecated: Use VoteList.ProtoReflect.Descriptor instead. +func (*VoteList) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{30} +} -func (m *VoteList) GetVotes() []*Vote { - if m != nil { - return m.Votes +func (x *VoteList) GetVotes() []*Vote { + if x != nil { + return x.Votes } return nil } -func (m *VoteList) GetId() string { - if m != nil { - return m.Id +func (x *VoteList) GetId() string { + if x != nil { + return x.Id } return "" } type NodeReq struct { - Timeout []byte `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` - Component []byte `protobuf:"bytes,2,opt,name=component,proto3" json:"component,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *NodeReq) Reset() { *m = NodeReq{} } -func (m *NodeReq) String() string { return proto.CompactTextString(m) } -func (*NodeReq) ProtoMessage() {} -func (*NodeReq) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{31} -} -func (m *NodeReq) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NodeReq.Unmarshal(m, b) + Timeout []byte `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` + Component []byte `protobuf:"bytes,2,opt,name=component,proto3" json:"component,omitempty"` } -func (m *NodeReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NodeReq.Marshal(b, m, deterministic) -} -func (dst *NodeReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeReq.Merge(dst, src) + +func (x *NodeReq) Reset() { + *x = NodeReq{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NodeReq) XXX_Size() int { - return xxx_messageInfo_NodeReq.Size(m) + +func (x *NodeReq) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NodeReq) XXX_DiscardUnknown() { - xxx_messageInfo_NodeReq.DiscardUnknown(m) + +func (*NodeReq) ProtoMessage() {} + +func (x *NodeReq) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_NodeReq proto.InternalMessageInfo +// Deprecated: Use NodeReq.ProtoReflect.Descriptor instead. +func (*NodeReq) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{31} +} -func (m *NodeReq) GetTimeout() []byte { - if m != nil { - return m.Timeout +func (x *NodeReq) GetTimeout() []byte { + if x != nil { + return x.Timeout } return nil } -func (m *NodeReq) GetComponent() []byte { - if m != nil { - return m.Component +func (x *NodeReq) GetComponent() []byte { + if x != nil { + return x.Component } return nil } type Name struct { - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - BlockNo uint64 `protobuf:"varint,2,opt,name=blockNo" json:"blockNo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Name) Reset() { *m = Name{} } -func (m *Name) String() string { return proto.CompactTextString(m) } -func (*Name) ProtoMessage() {} -func (*Name) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{32} -} -func (m *Name) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Name.Unmarshal(m, b) + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + BlockNo uint64 `protobuf:"varint,2,opt,name=blockNo,proto3" json:"blockNo,omitempty"` } -func (m *Name) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Name.Marshal(b, m, deterministic) -} -func (dst *Name) XXX_Merge(src proto.Message) { - xxx_messageInfo_Name.Merge(dst, src) + +func (x *Name) Reset() { + *x = Name{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Name) XXX_Size() int { - return xxx_messageInfo_Name.Size(m) + +func (x *Name) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Name) XXX_DiscardUnknown() { - xxx_messageInfo_Name.DiscardUnknown(m) + +func (*Name) ProtoMessage() {} + +func (x *Name) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Name proto.InternalMessageInfo +// Deprecated: Use Name.ProtoReflect.Descriptor instead. +func (*Name) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{32} +} -func (m *Name) GetName() string { - if m != nil { - return m.Name +func (x *Name) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *Name) GetBlockNo() uint64 { - if m != nil { - return m.BlockNo +func (x *Name) GetBlockNo() uint64 { + if x != nil { + return x.BlockNo } return 0 } type NameInfo struct { - Name *Name `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Owner []byte `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - Destination []byte `protobuf:"bytes,3,opt,name=destination,proto3" json:"destination,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *NameInfo) Reset() { *m = NameInfo{} } -func (m *NameInfo) String() string { return proto.CompactTextString(m) } -func (*NameInfo) ProtoMessage() {} -func (*NameInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{33} -} -func (m *NameInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NameInfo.Unmarshal(m, b) + Name *Name `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Owner []byte `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` + Destination []byte `protobuf:"bytes,3,opt,name=destination,proto3" json:"destination,omitempty"` } -func (m *NameInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NameInfo.Marshal(b, m, deterministic) -} -func (dst *NameInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_NameInfo.Merge(dst, src) + +func (x *NameInfo) Reset() { + *x = NameInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NameInfo) XXX_Size() int { - return xxx_messageInfo_NameInfo.Size(m) + +func (x *NameInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NameInfo) XXX_DiscardUnknown() { - xxx_messageInfo_NameInfo.DiscardUnknown(m) + +func (*NameInfo) ProtoMessage() {} + +func (x *NameInfo) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_NameInfo proto.InternalMessageInfo +// Deprecated: Use NameInfo.ProtoReflect.Descriptor instead. +func (*NameInfo) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{33} +} -func (m *NameInfo) GetName() *Name { - if m != nil { - return m.Name +func (x *NameInfo) GetName() *Name { + if x != nil { + return x.Name } return nil } -func (m *NameInfo) GetOwner() []byte { - if m != nil { - return m.Owner +func (x *NameInfo) GetOwner() []byte { + if x != nil { + return x.Owner } return nil } -func (m *NameInfo) GetDestination() []byte { - if m != nil { - return m.Destination +func (x *NameInfo) GetDestination() []byte { + if x != nil { + return x.Destination } return nil } type PeersParams struct { - NoHidden bool `protobuf:"varint,1,opt,name=noHidden" json:"noHidden,omitempty"` - ShowSelf bool `protobuf:"varint,2,opt,name=showSelf" json:"showSelf,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *PeersParams) Reset() { *m = PeersParams{} } -func (m *PeersParams) String() string { return proto.CompactTextString(m) } -func (*PeersParams) ProtoMessage() {} -func (*PeersParams) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{34} -} -func (m *PeersParams) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PeersParams.Unmarshal(m, b) + NoHidden bool `protobuf:"varint,1,opt,name=noHidden,proto3" json:"noHidden,omitempty"` + ShowSelf bool `protobuf:"varint,2,opt,name=showSelf,proto3" json:"showSelf,omitempty"` } -func (m *PeersParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PeersParams.Marshal(b, m, deterministic) -} -func (dst *PeersParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeersParams.Merge(dst, src) + +func (x *PeersParams) Reset() { + *x = PeersParams{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PeersParams) XXX_Size() int { - return xxx_messageInfo_PeersParams.Size(m) + +func (x *PeersParams) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PeersParams) XXX_DiscardUnknown() { - xxx_messageInfo_PeersParams.DiscardUnknown(m) + +func (*PeersParams) ProtoMessage() {} + +func (x *PeersParams) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PeersParams proto.InternalMessageInfo +// Deprecated: Use PeersParams.ProtoReflect.Descriptor instead. +func (*PeersParams) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{34} +} -func (m *PeersParams) GetNoHidden() bool { - if m != nil { - return m.NoHidden +func (x *PeersParams) GetNoHidden() bool { + if x != nil { + return x.NoHidden } return false } -func (m *PeersParams) GetShowSelf() bool { - if m != nil { - return m.ShowSelf +func (x *PeersParams) GetShowSelf() bool { + if x != nil { + return x.ShowSelf } return false } type KeyParams struct { - Key []string `protobuf:"bytes,1,rep,name=key" json:"key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *KeyParams) Reset() { *m = KeyParams{} } -func (m *KeyParams) String() string { return proto.CompactTextString(m) } -func (*KeyParams) ProtoMessage() {} -func (*KeyParams) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{35} -} -func (m *KeyParams) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KeyParams.Unmarshal(m, b) + Key []string `protobuf:"bytes,1,rep,name=key,proto3" json:"key,omitempty"` } -func (m *KeyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KeyParams.Marshal(b, m, deterministic) -} -func (dst *KeyParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_KeyParams.Merge(dst, src) + +func (x *KeyParams) Reset() { + *x = KeyParams{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *KeyParams) XXX_Size() int { - return xxx_messageInfo_KeyParams.Size(m) + +func (x *KeyParams) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *KeyParams) XXX_DiscardUnknown() { - xxx_messageInfo_KeyParams.DiscardUnknown(m) + +func (*KeyParams) ProtoMessage() {} + +func (x *KeyParams) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_KeyParams proto.InternalMessageInfo +// Deprecated: Use KeyParams.ProtoReflect.Descriptor instead. +func (*KeyParams) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{35} +} -func (m *KeyParams) GetKey() []string { - if m != nil { - return m.Key +func (x *KeyParams) GetKey() []string { + if x != nil { + return x.Key } return nil } type ServerInfo struct { - Status map[string]string `protobuf:"bytes,1,rep,name=status" json:"status,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Config map[string]*ConfigItem `protobuf:"bytes,2,rep,name=config" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ServerInfo) Reset() { *m = ServerInfo{} } -func (m *ServerInfo) String() string { return proto.CompactTextString(m) } -func (*ServerInfo) ProtoMessage() {} -func (*ServerInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{36} -} -func (m *ServerInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ServerInfo.Unmarshal(m, b) + Status map[string]string `protobuf:"bytes,1,rep,name=status,proto3" json:"status,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Config map[string]*ConfigItem `protobuf:"bytes,2,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *ServerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ServerInfo.Marshal(b, m, deterministic) -} -func (dst *ServerInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServerInfo.Merge(dst, src) + +func (x *ServerInfo) Reset() { + *x = ServerInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ServerInfo) XXX_Size() int { - return xxx_messageInfo_ServerInfo.Size(m) + +func (x *ServerInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ServerInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ServerInfo.DiscardUnknown(m) + +func (*ServerInfo) ProtoMessage() {} + +func (x *ServerInfo) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ServerInfo proto.InternalMessageInfo +// Deprecated: Use ServerInfo.ProtoReflect.Descriptor instead. +func (*ServerInfo) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{36} +} -func (m *ServerInfo) GetStatus() map[string]string { - if m != nil { - return m.Status +func (x *ServerInfo) GetStatus() map[string]string { + if x != nil { + return x.Status } return nil } -func (m *ServerInfo) GetConfig() map[string]*ConfigItem { - if m != nil { - return m.Config +func (x *ServerInfo) GetConfig() map[string]*ConfigItem { + if x != nil { + return x.Config } return nil } type ConfigItem struct { - Props map[string]string `protobuf:"bytes,2,rep,name=props" json:"props,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ConfigItem) Reset() { *m = ConfigItem{} } -func (m *ConfigItem) String() string { return proto.CompactTextString(m) } -func (*ConfigItem) ProtoMessage() {} -func (*ConfigItem) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{37} -} -func (m *ConfigItem) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigItem.Unmarshal(m, b) + Props map[string]string `protobuf:"bytes,2,rep,name=props,proto3" json:"props,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *ConfigItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigItem.Marshal(b, m, deterministic) -} -func (dst *ConfigItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigItem.Merge(dst, src) + +func (x *ConfigItem) Reset() { + *x = ConfigItem{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ConfigItem) XXX_Size() int { - return xxx_messageInfo_ConfigItem.Size(m) + +func (x *ConfigItem) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ConfigItem) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigItem.DiscardUnknown(m) + +func (*ConfigItem) ProtoMessage() {} + +func (x *ConfigItem) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ConfigItem proto.InternalMessageInfo +// Deprecated: Use ConfigItem.ProtoReflect.Descriptor instead. +func (*ConfigItem) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{37} +} -func (m *ConfigItem) GetProps() map[string]string { - if m != nil { - return m.Props +func (x *ConfigItem) GetProps() map[string]string { + if x != nil { + return x.Props } return nil } type EventList struct { - Events []*Event `protobuf:"bytes,1,rep,name=events" json:"events,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *EventList) Reset() { *m = EventList{} } -func (m *EventList) String() string { return proto.CompactTextString(m) } -func (*EventList) ProtoMessage() {} -func (*EventList) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{38} -} -func (m *EventList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EventList.Unmarshal(m, b) + Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` } -func (m *EventList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EventList.Marshal(b, m, deterministic) -} -func (dst *EventList) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventList.Merge(dst, src) + +func (x *EventList) Reset() { + *x = EventList{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *EventList) XXX_Size() int { - return xxx_messageInfo_EventList.Size(m) + +func (x *EventList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EventList) XXX_DiscardUnknown() { - xxx_messageInfo_EventList.DiscardUnknown(m) + +func (*EventList) ProtoMessage() {} + +func (x *EventList) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_EventList proto.InternalMessageInfo +// Deprecated: Use EventList.ProtoReflect.Descriptor instead. +func (*EventList) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{38} +} -func (m *EventList) GetEvents() []*Event { - if m != nil { - return m.Events +func (x *EventList) GetEvents() []*Event { + if x != nil { + return x.Events } return nil } // info and bps is json string type ConsensusInfo struct { - Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` - Info string `protobuf:"bytes,2,opt,name=info" json:"info,omitempty"` - Bps []string `protobuf:"bytes,3,rep,name=bps" json:"bps,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ConsensusInfo) Reset() { *m = ConsensusInfo{} } -func (m *ConsensusInfo) String() string { return proto.CompactTextString(m) } -func (*ConsensusInfo) ProtoMessage() {} -func (*ConsensusInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{39} -} -func (m *ConsensusInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConsensusInfo.Unmarshal(m, b) + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Info string `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + Bps []string `protobuf:"bytes,3,rep,name=bps,proto3" json:"bps,omitempty"` } -func (m *ConsensusInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConsensusInfo.Marshal(b, m, deterministic) -} -func (dst *ConsensusInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusInfo.Merge(dst, src) + +func (x *ConsensusInfo) Reset() { + *x = ConsensusInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ConsensusInfo) XXX_Size() int { - return xxx_messageInfo_ConsensusInfo.Size(m) + +func (x *ConsensusInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ConsensusInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusInfo.DiscardUnknown(m) + +func (*ConsensusInfo) ProtoMessage() {} + +func (x *ConsensusInfo) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ConsensusInfo proto.InternalMessageInfo +// Deprecated: Use ConsensusInfo.ProtoReflect.Descriptor instead. +func (*ConsensusInfo) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{39} +} -func (m *ConsensusInfo) GetType() string { - if m != nil { - return m.Type +func (x *ConsensusInfo) GetType() string { + if x != nil { + return x.Type } return "" } -func (m *ConsensusInfo) GetInfo() string { - if m != nil { - return m.Info +func (x *ConsensusInfo) GetInfo() string { + if x != nil { + return x.Info } return "" } -func (m *ConsensusInfo) GetBps() []string { - if m != nil { - return m.Bps +func (x *ConsensusInfo) GetBps() []string { + if x != nil { + return x.Bps } return nil } type EnterpriseConfigKey struct { - Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` } -func (m *EnterpriseConfigKey) Reset() { *m = EnterpriseConfigKey{} } -func (m *EnterpriseConfigKey) String() string { return proto.CompactTextString(m) } -func (*EnterpriseConfigKey) ProtoMessage() {} -func (*EnterpriseConfigKey) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{40} +func (x *EnterpriseConfigKey) Reset() { + *x = EnterpriseConfigKey{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *EnterpriseConfigKey) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnterpriseConfigKey.Unmarshal(m, b) + +func (x *EnterpriseConfigKey) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *EnterpriseConfigKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnterpriseConfigKey.Marshal(b, m, deterministic) -} -func (dst *EnterpriseConfigKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnterpriseConfigKey.Merge(dst, src) -} -func (m *EnterpriseConfigKey) XXX_Size() int { - return xxx_messageInfo_EnterpriseConfigKey.Size(m) -} -func (m *EnterpriseConfigKey) XXX_DiscardUnknown() { - xxx_messageInfo_EnterpriseConfigKey.DiscardUnknown(m) -} - -var xxx_messageInfo_EnterpriseConfigKey proto.InternalMessageInfo - -func (m *EnterpriseConfigKey) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -type EnterpriseConfig struct { - Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` - On bool `protobuf:"varint,2,opt,name=on" json:"on,omitempty"` - Values []string `protobuf:"bytes,3,rep,name=values" json:"values,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + +func (*EnterpriseConfigKey) ProtoMessage() {} + +func (x *EnterpriseConfigKey) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *EnterpriseConfig) Reset() { *m = EnterpriseConfig{} } -func (m *EnterpriseConfig) String() string { return proto.CompactTextString(m) } -func (*EnterpriseConfig) ProtoMessage() {} -func (*EnterpriseConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_rpc_8d86ee9ecec344df, []int{41} -} -func (m *EnterpriseConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EnterpriseConfig.Unmarshal(m, b) -} -func (m *EnterpriseConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EnterpriseConfig.Marshal(b, m, deterministic) -} -func (dst *EnterpriseConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_EnterpriseConfig.Merge(dst, src) -} -func (m *EnterpriseConfig) XXX_Size() int { - return xxx_messageInfo_EnterpriseConfig.Size(m) -} -func (m *EnterpriseConfig) XXX_DiscardUnknown() { - xxx_messageInfo_EnterpriseConfig.DiscardUnknown(m) +// Deprecated: Use EnterpriseConfigKey.ProtoReflect.Descriptor instead. +func (*EnterpriseConfigKey) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{40} } -var xxx_messageInfo_EnterpriseConfig proto.InternalMessageInfo - -func (m *EnterpriseConfig) GetKey() string { - if m != nil { - return m.Key +func (x *EnterpriseConfigKey) GetKey() string { + if x != nil { + return x.Key } return "" } -func (m *EnterpriseConfig) GetOn() bool { - if m != nil { - return m.On - } - return false -} - -func (m *EnterpriseConfig) GetValues() []string { - if m != nil { - return m.Values - } - return nil -} - -func init() { - proto.RegisterType((*BlockchainStatus)(nil), "types.BlockchainStatus") - proto.RegisterType((*ChainId)(nil), "types.ChainId") - proto.RegisterType((*ChainInfo)(nil), "types.ChainInfo") - proto.RegisterType((*ChainStats)(nil), "types.ChainStats") - proto.RegisterType((*Input)(nil), "types.Input") - proto.RegisterType((*Output)(nil), "types.Output") - proto.RegisterType((*Empty)(nil), "types.Empty") - proto.RegisterType((*SingleBytes)(nil), "types.SingleBytes") - proto.RegisterType((*SingleString)(nil), "types.SingleString") - proto.RegisterType((*AccountAddress)(nil), "types.AccountAddress") - proto.RegisterType((*AccountAndRoot)(nil), "types.AccountAndRoot") - proto.RegisterType((*Peer)(nil), "types.Peer") - proto.RegisterType((*PeerList)(nil), "types.PeerList") - proto.RegisterType((*ListParams)(nil), "types.ListParams") - proto.RegisterType((*PageParams)(nil), "types.PageParams") - proto.RegisterType((*BlockBodyPaged)(nil), "types.BlockBodyPaged") - proto.RegisterType((*BlockBodyParams)(nil), "types.BlockBodyParams") - proto.RegisterType((*BlockHeaderList)(nil), "types.BlockHeaderList") - proto.RegisterType((*BlockMetadata)(nil), "types.BlockMetadata") - proto.RegisterType((*BlockMetadataList)(nil), "types.BlockMetadataList") - proto.RegisterType((*CommitResult)(nil), "types.CommitResult") - proto.RegisterType((*CommitResultList)(nil), "types.CommitResultList") - proto.RegisterType((*VerifyResult)(nil), "types.VerifyResult") - proto.RegisterType((*Personal)(nil), "types.Personal") - proto.RegisterType((*ImportFormat)(nil), "types.ImportFormat") - proto.RegisterType((*Staking)(nil), "types.Staking") - proto.RegisterType((*Vote)(nil), "types.Vote") - proto.RegisterType((*VoteParams)(nil), "types.VoteParams") - proto.RegisterType((*AccountVoteInfo)(nil), "types.AccountVoteInfo") - proto.RegisterType((*VoteInfo)(nil), "types.VoteInfo") - proto.RegisterType((*VoteList)(nil), "types.VoteList") - proto.RegisterType((*NodeReq)(nil), "types.NodeReq") - proto.RegisterType((*Name)(nil), "types.Name") - proto.RegisterType((*NameInfo)(nil), "types.NameInfo") - proto.RegisterType((*PeersParams)(nil), "types.PeersParams") - proto.RegisterType((*KeyParams)(nil), "types.KeyParams") - proto.RegisterType((*ServerInfo)(nil), "types.ServerInfo") - proto.RegisterMapType((map[string]*ConfigItem)(nil), "types.ServerInfo.ConfigEntry") - proto.RegisterMapType((map[string]string)(nil), "types.ServerInfo.StatusEntry") - proto.RegisterType((*ConfigItem)(nil), "types.ConfigItem") - proto.RegisterMapType((map[string]string)(nil), "types.ConfigItem.PropsEntry") - proto.RegisterType((*EventList)(nil), "types.EventList") - proto.RegisterType((*ConsensusInfo)(nil), "types.ConsensusInfo") - proto.RegisterType((*EnterpriseConfigKey)(nil), "types.EnterpriseConfigKey") - proto.RegisterType((*EnterpriseConfig)(nil), "types.EnterpriseConfig") - proto.RegisterEnum("types.CommitStatus", CommitStatus_name, CommitStatus_value) - proto.RegisterEnum("types.VerifyStatus", VerifyStatus_name, VerifyStatus_value) -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for AergoRPCService service - -type AergoRPCServiceClient interface { - // Returns the current state of this node - NodeState(ctx context.Context, in *NodeReq, opts ...grpc.CallOption) (*SingleBytes, error) - // Returns node metrics according to request - Metric(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*Metrics, error) - // Returns current blockchain status (best block's height and hash) - Blockchain(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BlockchainStatus, error) - // Returns current blockchain's basic information - GetChainInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ChainInfo, error) - // Returns current chain statistics - ChainStat(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ChainStats, error) - // Returns list of Blocks without body according to request - ListBlockHeaders(ctx context.Context, in *ListParams, opts ...grpc.CallOption) (*BlockHeaderList, error) - // Returns list of block metadata (hash, header, and number of transactions) according to request - ListBlockMetadata(ctx context.Context, in *ListParams, opts ...grpc.CallOption) (*BlockMetadataList, error) - // Returns a stream of new blocks as they get added to the blockchain - ListBlockStream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (AergoRPCService_ListBlockStreamClient, error) - // Returns a stream of new block's metadata as they get added to the blockchain - ListBlockMetadataStream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (AergoRPCService_ListBlockMetadataStreamClient, error) - // Return a single block incl. header and body, queried by hash or number - GetBlock(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Block, error) - // Return a single block's metdata (hash, header, and number of transactions), queried by hash or number - GetBlockMetadata(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*BlockMetadata, error) - // Return a single block's body, queried by hash or number and list parameters - GetBlockBody(ctx context.Context, in *BlockBodyParams, opts ...grpc.CallOption) (*BlockBodyPaged, error) - // Return a single transaction, queried by transaction hash - GetTX(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Tx, error) - // Return information about transaction in block, queried by transaction hash - GetBlockTX(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*TxInBlock, error) - // Return transaction receipt, queried by transaction hash - GetReceipt(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Receipt, error) - // Return ABI stored at contract address - GetABI(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*ABI, error) - // Sign and send a transaction from an unlocked account - SendTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*CommitResult, error) - // Sign transaction with unlocked account - SignTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*Tx, error) - // Verify validity of transaction - VerifyTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*VerifyResult, error) - // Commit a signed transaction - CommitTX(ctx context.Context, in *TxList, opts ...grpc.CallOption) (*CommitResultList, error) - // Return state of account - GetState(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*State, error) - // Return state of account, including merkle proof - GetStateAndProof(ctx context.Context, in *AccountAndRoot, opts ...grpc.CallOption) (*AccountProof, error) - // Create a new account in this node - CreateAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) - // Return list of accounts in this node - GetAccounts(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*AccountList, error) - // Lock account in this node - LockAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) - // Unlock account in this node - UnlockAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) - // Import account to this node - ImportAccount(ctx context.Context, in *ImportFormat, opts ...grpc.CallOption) (*Account, error) - // Export account stored in this node as wif format - ExportAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*SingleBytes, error) - // Export account stored in this node as keystore format - ExportAccountKeystore(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*SingleBytes, error) - // Query a contract method - QueryContract(ctx context.Context, in *Query, opts ...grpc.CallOption) (*SingleBytes, error) - // Query contract state - QueryContractState(ctx context.Context, in *StateQuery, opts ...grpc.CallOption) (*StateQueryProof, error) - // Return list of peers of this node and their state - GetPeers(ctx context.Context, in *PeersParams, opts ...grpc.CallOption) (*PeerList, error) - // Return result of vote - GetVotes(ctx context.Context, in *VoteParams, opts ...grpc.CallOption) (*VoteList, error) - // Return staking, voting info for account - GetAccountVotes(ctx context.Context, in *AccountAddress, opts ...grpc.CallOption) (*AccountVoteInfo, error) - // Return staking information - GetStaking(ctx context.Context, in *AccountAddress, opts ...grpc.CallOption) (*Staking, error) - // Return name information - GetNameInfo(ctx context.Context, in *Name, opts ...grpc.CallOption) (*NameInfo, error) - // Returns a stream of event as they get added to the blockchain - ListEventStream(ctx context.Context, in *FilterInfo, opts ...grpc.CallOption) (AergoRPCService_ListEventStreamClient, error) - // Returns list of event - ListEvents(ctx context.Context, in *FilterInfo, opts ...grpc.CallOption) (*EventList, error) - // Returns configs and statuses of server - GetServerInfo(ctx context.Context, in *KeyParams, opts ...grpc.CallOption) (*ServerInfo, error) - // Returns status of consensus and bps - GetConsensusInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ConsensusInfo, error) - // Returns enterprise config - GetEnterpriseConfig(ctx context.Context, in *EnterpriseConfigKey, opts ...grpc.CallOption) (*EnterpriseConfig, error) - // Return a status of changeCluster enterprise tx, queried by requestID - GetConfChangeProgress(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*ConfChangeProgress, error) -} - -type aergoRPCServiceClient struct { - cc *grpc.ClientConn -} - -func NewAergoRPCServiceClient(cc *grpc.ClientConn) AergoRPCServiceClient { - return &aergoRPCServiceClient{cc} -} - -func (c *aergoRPCServiceClient) NodeState(ctx context.Context, in *NodeReq, opts ...grpc.CallOption) (*SingleBytes, error) { - out := new(SingleBytes) - err := grpc.Invoke(ctx, "/types.AergoRPCService/NodeState", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) Metric(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*Metrics, error) { - out := new(Metrics) - err := grpc.Invoke(ctx, "/types.AergoRPCService/Metric", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) Blockchain(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BlockchainStatus, error) { - out := new(BlockchainStatus) - err := grpc.Invoke(ctx, "/types.AergoRPCService/Blockchain", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetChainInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ChainInfo, error) { - out := new(ChainInfo) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetChainInfo", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) ChainStat(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ChainStats, error) { - out := new(ChainStats) - err := grpc.Invoke(ctx, "/types.AergoRPCService/ChainStat", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) ListBlockHeaders(ctx context.Context, in *ListParams, opts ...grpc.CallOption) (*BlockHeaderList, error) { - out := new(BlockHeaderList) - err := grpc.Invoke(ctx, "/types.AergoRPCService/ListBlockHeaders", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) ListBlockMetadata(ctx context.Context, in *ListParams, opts ...grpc.CallOption) (*BlockMetadataList, error) { - out := new(BlockMetadataList) - err := grpc.Invoke(ctx, "/types.AergoRPCService/ListBlockMetadata", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) ListBlockStream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (AergoRPCService_ListBlockStreamClient, error) { - stream, err := grpc.NewClientStream(ctx, &_AergoRPCService_serviceDesc.Streams[0], c.cc, "/types.AergoRPCService/ListBlockStream", opts...) - if err != nil { - return nil, err - } - x := &aergoRPCServiceListBlockStreamClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type AergoRPCService_ListBlockStreamClient interface { - Recv() (*Block, error) - grpc.ClientStream -} - -type aergoRPCServiceListBlockStreamClient struct { - grpc.ClientStream -} - -func (x *aergoRPCServiceListBlockStreamClient) Recv() (*Block, error) { - m := new(Block) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *aergoRPCServiceClient) ListBlockMetadataStream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (AergoRPCService_ListBlockMetadataStreamClient, error) { - stream, err := grpc.NewClientStream(ctx, &_AergoRPCService_serviceDesc.Streams[1], c.cc, "/types.AergoRPCService/ListBlockMetadataStream", opts...) - if err != nil { - return nil, err - } - x := &aergoRPCServiceListBlockMetadataStreamClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type AergoRPCService_ListBlockMetadataStreamClient interface { - Recv() (*BlockMetadata, error) - grpc.ClientStream -} - -type aergoRPCServiceListBlockMetadataStreamClient struct { - grpc.ClientStream -} - -func (x *aergoRPCServiceListBlockMetadataStreamClient) Recv() (*BlockMetadata, error) { - m := new(BlockMetadata) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *aergoRPCServiceClient) GetBlock(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Block, error) { - out := new(Block) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetBlock", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetBlockMetadata(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*BlockMetadata, error) { - out := new(BlockMetadata) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetBlockMetadata", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetBlockBody(ctx context.Context, in *BlockBodyParams, opts ...grpc.CallOption) (*BlockBodyPaged, error) { - out := new(BlockBodyPaged) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetBlockBody", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetTX(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Tx, error) { - out := new(Tx) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetTX", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetBlockTX(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*TxInBlock, error) { - out := new(TxInBlock) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetBlockTX", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetReceipt(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Receipt, error) { - out := new(Receipt) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetReceipt", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetABI(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*ABI, error) { - out := new(ABI) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetABI", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) SendTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*CommitResult, error) { - out := new(CommitResult) - err := grpc.Invoke(ctx, "/types.AergoRPCService/SendTX", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) SignTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*Tx, error) { - out := new(Tx) - err := grpc.Invoke(ctx, "/types.AergoRPCService/SignTX", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) VerifyTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*VerifyResult, error) { - out := new(VerifyResult) - err := grpc.Invoke(ctx, "/types.AergoRPCService/VerifyTX", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) CommitTX(ctx context.Context, in *TxList, opts ...grpc.CallOption) (*CommitResultList, error) { - out := new(CommitResultList) - err := grpc.Invoke(ctx, "/types.AergoRPCService/CommitTX", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetState(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*State, error) { - out := new(State) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetState", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetStateAndProof(ctx context.Context, in *AccountAndRoot, opts ...grpc.CallOption) (*AccountProof, error) { - out := new(AccountProof) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetStateAndProof", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) CreateAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) { - out := new(Account) - err := grpc.Invoke(ctx, "/types.AergoRPCService/CreateAccount", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetAccounts(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*AccountList, error) { - out := new(AccountList) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetAccounts", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) LockAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) { - out := new(Account) - err := grpc.Invoke(ctx, "/types.AergoRPCService/LockAccount", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) UnlockAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) { - out := new(Account) - err := grpc.Invoke(ctx, "/types.AergoRPCService/UnlockAccount", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) ImportAccount(ctx context.Context, in *ImportFormat, opts ...grpc.CallOption) (*Account, error) { - out := new(Account) - err := grpc.Invoke(ctx, "/types.AergoRPCService/ImportAccount", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) ExportAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*SingleBytes, error) { - out := new(SingleBytes) - err := grpc.Invoke(ctx, "/types.AergoRPCService/ExportAccount", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) ExportAccountKeystore(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*SingleBytes, error) { - out := new(SingleBytes) - err := grpc.Invoke(ctx, "/types.AergoRPCService/ExportAccountKeystore", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) QueryContract(ctx context.Context, in *Query, opts ...grpc.CallOption) (*SingleBytes, error) { - out := new(SingleBytes) - err := grpc.Invoke(ctx, "/types.AergoRPCService/QueryContract", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) QueryContractState(ctx context.Context, in *StateQuery, opts ...grpc.CallOption) (*StateQueryProof, error) { - out := new(StateQueryProof) - err := grpc.Invoke(ctx, "/types.AergoRPCService/QueryContractState", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetPeers(ctx context.Context, in *PeersParams, opts ...grpc.CallOption) (*PeerList, error) { - out := new(PeerList) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetPeers", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetVotes(ctx context.Context, in *VoteParams, opts ...grpc.CallOption) (*VoteList, error) { - out := new(VoteList) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetVotes", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetAccountVotes(ctx context.Context, in *AccountAddress, opts ...grpc.CallOption) (*AccountVoteInfo, error) { - out := new(AccountVoteInfo) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetAccountVotes", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetStaking(ctx context.Context, in *AccountAddress, opts ...grpc.CallOption) (*Staking, error) { - out := new(Staking) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetStaking", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetNameInfo(ctx context.Context, in *Name, opts ...grpc.CallOption) (*NameInfo, error) { - out := new(NameInfo) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetNameInfo", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) ListEventStream(ctx context.Context, in *FilterInfo, opts ...grpc.CallOption) (AergoRPCService_ListEventStreamClient, error) { - stream, err := grpc.NewClientStream(ctx, &_AergoRPCService_serviceDesc.Streams[2], c.cc, "/types.AergoRPCService/ListEventStream", opts...) - if err != nil { - return nil, err - } - x := &aergoRPCServiceListEventStreamClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type AergoRPCService_ListEventStreamClient interface { - Recv() (*Event, error) - grpc.ClientStream -} - -type aergoRPCServiceListEventStreamClient struct { - grpc.ClientStream -} - -func (x *aergoRPCServiceListEventStreamClient) Recv() (*Event, error) { - m := new(Event) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *aergoRPCServiceClient) ListEvents(ctx context.Context, in *FilterInfo, opts ...grpc.CallOption) (*EventList, error) { - out := new(EventList) - err := grpc.Invoke(ctx, "/types.AergoRPCService/ListEvents", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetServerInfo(ctx context.Context, in *KeyParams, opts ...grpc.CallOption) (*ServerInfo, error) { - out := new(ServerInfo) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetServerInfo", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetConsensusInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ConsensusInfo, error) { - out := new(ConsensusInfo) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetConsensusInfo", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetEnterpriseConfig(ctx context.Context, in *EnterpriseConfigKey, opts ...grpc.CallOption) (*EnterpriseConfig, error) { - out := new(EnterpriseConfig) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetEnterpriseConfig", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *aergoRPCServiceClient) GetConfChangeProgress(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*ConfChangeProgress, error) { - out := new(ConfChangeProgress) - err := grpc.Invoke(ctx, "/types.AergoRPCService/GetConfChangeProgress", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for AergoRPCService service - -type AergoRPCServiceServer interface { - // Returns the current state of this node - NodeState(context.Context, *NodeReq) (*SingleBytes, error) - // Returns node metrics according to request - Metric(context.Context, *MetricsRequest) (*Metrics, error) - // Returns current blockchain status (best block's height and hash) - Blockchain(context.Context, *Empty) (*BlockchainStatus, error) - // Returns current blockchain's basic information - GetChainInfo(context.Context, *Empty) (*ChainInfo, error) - // Returns current chain statistics - ChainStat(context.Context, *Empty) (*ChainStats, error) - // Returns list of Blocks without body according to request - ListBlockHeaders(context.Context, *ListParams) (*BlockHeaderList, error) - // Returns list of block metadata (hash, header, and number of transactions) according to request - ListBlockMetadata(context.Context, *ListParams) (*BlockMetadataList, error) - // Returns a stream of new blocks as they get added to the blockchain - ListBlockStream(*Empty, AergoRPCService_ListBlockStreamServer) error - // Returns a stream of new block's metadata as they get added to the blockchain - ListBlockMetadataStream(*Empty, AergoRPCService_ListBlockMetadataStreamServer) error - // Return a single block incl. header and body, queried by hash or number - GetBlock(context.Context, *SingleBytes) (*Block, error) - // Return a single block's metdata (hash, header, and number of transactions), queried by hash or number - GetBlockMetadata(context.Context, *SingleBytes) (*BlockMetadata, error) - // Return a single block's body, queried by hash or number and list parameters - GetBlockBody(context.Context, *BlockBodyParams) (*BlockBodyPaged, error) - // Return a single transaction, queried by transaction hash - GetTX(context.Context, *SingleBytes) (*Tx, error) - // Return information about transaction in block, queried by transaction hash - GetBlockTX(context.Context, *SingleBytes) (*TxInBlock, error) - // Return transaction receipt, queried by transaction hash - GetReceipt(context.Context, *SingleBytes) (*Receipt, error) - // Return ABI stored at contract address - GetABI(context.Context, *SingleBytes) (*ABI, error) - // Sign and send a transaction from an unlocked account - SendTX(context.Context, *Tx) (*CommitResult, error) - // Sign transaction with unlocked account - SignTX(context.Context, *Tx) (*Tx, error) - // Verify validity of transaction - VerifyTX(context.Context, *Tx) (*VerifyResult, error) - // Commit a signed transaction - CommitTX(context.Context, *TxList) (*CommitResultList, error) - // Return state of account - GetState(context.Context, *SingleBytes) (*State, error) - // Return state of account, including merkle proof - GetStateAndProof(context.Context, *AccountAndRoot) (*AccountProof, error) - // Create a new account in this node - CreateAccount(context.Context, *Personal) (*Account, error) - // Return list of accounts in this node - GetAccounts(context.Context, *Empty) (*AccountList, error) - // Lock account in this node - LockAccount(context.Context, *Personal) (*Account, error) - // Unlock account in this node - UnlockAccount(context.Context, *Personal) (*Account, error) - // Import account to this node - ImportAccount(context.Context, *ImportFormat) (*Account, error) - // Export account stored in this node as wif format - ExportAccount(context.Context, *Personal) (*SingleBytes, error) - // Export account stored in this node as keystore format - ExportAccountKeystore(context.Context, *Personal) (*SingleBytes, error) - // Query a contract method - QueryContract(context.Context, *Query) (*SingleBytes, error) - // Query contract state - QueryContractState(context.Context, *StateQuery) (*StateQueryProof, error) - // Return list of peers of this node and their state - GetPeers(context.Context, *PeersParams) (*PeerList, error) - // Return result of vote - GetVotes(context.Context, *VoteParams) (*VoteList, error) - // Return staking, voting info for account - GetAccountVotes(context.Context, *AccountAddress) (*AccountVoteInfo, error) - // Return staking information - GetStaking(context.Context, *AccountAddress) (*Staking, error) - // Return name information - GetNameInfo(context.Context, *Name) (*NameInfo, error) - // Returns a stream of event as they get added to the blockchain - ListEventStream(*FilterInfo, AergoRPCService_ListEventStreamServer) error - // Returns list of event - ListEvents(context.Context, *FilterInfo) (*EventList, error) - // Returns configs and statuses of server - GetServerInfo(context.Context, *KeyParams) (*ServerInfo, error) - // Returns status of consensus and bps - GetConsensusInfo(context.Context, *Empty) (*ConsensusInfo, error) - // Returns enterprise config - GetEnterpriseConfig(context.Context, *EnterpriseConfigKey) (*EnterpriseConfig, error) - // Return a status of changeCluster enterprise tx, queried by requestID - GetConfChangeProgress(context.Context, *SingleBytes) (*ConfChangeProgress, error) -} - -func RegisterAergoRPCServiceServer(s *grpc.Server, srv AergoRPCServiceServer) { - s.RegisterService(&_AergoRPCService_serviceDesc, srv) -} - -func _AergoRPCService_NodeState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NodeReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).NodeState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/NodeState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).NodeState(ctx, req.(*NodeReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_Metric_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MetricsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).Metric(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/Metric", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).Metric(ctx, req.(*MetricsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_Blockchain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).Blockchain(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/Blockchain", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).Blockchain(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_GetChainInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetChainInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetChainInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetChainInfo(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_ChainStat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).ChainStat(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/ChainStat", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).ChainStat(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_ListBlockHeaders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).ListBlockHeaders(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/ListBlockHeaders", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).ListBlockHeaders(ctx, req.(*ListParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_ListBlockMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).ListBlockMetadata(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/ListBlockMetadata", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).ListBlockMetadata(ctx, req.(*ListParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_ListBlockStream_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(Empty) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(AergoRPCServiceServer).ListBlockStream(m, &aergoRPCServiceListBlockStreamServer{stream}) -} - -type AergoRPCService_ListBlockStreamServer interface { - Send(*Block) error - grpc.ServerStream -} - -type aergoRPCServiceListBlockStreamServer struct { - grpc.ServerStream -} - -func (x *aergoRPCServiceListBlockStreamServer) Send(m *Block) error { - return x.ServerStream.SendMsg(m) -} - -func _AergoRPCService_ListBlockMetadataStream_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(Empty) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(AergoRPCServiceServer).ListBlockMetadataStream(m, &aergoRPCServiceListBlockMetadataStreamServer{stream}) -} - -type AergoRPCService_ListBlockMetadataStreamServer interface { - Send(*BlockMetadata) error - grpc.ServerStream -} - -type aergoRPCServiceListBlockMetadataStreamServer struct { - grpc.ServerStream -} - -func (x *aergoRPCServiceListBlockMetadataStreamServer) Send(m *BlockMetadata) error { - return x.ServerStream.SendMsg(m) -} - -func _AergoRPCService_GetBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SingleBytes) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetBlock(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetBlock", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetBlock(ctx, req.(*SingleBytes)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_GetBlockMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SingleBytes) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetBlockMetadata(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetBlockMetadata", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetBlockMetadata(ctx, req.(*SingleBytes)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_GetBlockBody_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BlockBodyParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetBlockBody(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetBlockBody", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetBlockBody(ctx, req.(*BlockBodyParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_GetTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SingleBytes) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetTX(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetTX", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetTX(ctx, req.(*SingleBytes)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_GetBlockTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SingleBytes) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetBlockTX(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetBlockTX", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetBlockTX(ctx, req.(*SingleBytes)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_GetReceipt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SingleBytes) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetReceipt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetReceipt", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetReceipt(ctx, req.(*SingleBytes)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_GetABI_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SingleBytes) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetABI(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetABI", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetABI(ctx, req.(*SingleBytes)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_SendTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Tx) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).SendTX(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/SendTX", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).SendTX(ctx, req.(*Tx)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_SignTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Tx) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).SignTX(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/SignTX", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).SignTX(ctx, req.(*Tx)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_VerifyTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Tx) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).VerifyTX(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/VerifyTX", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).VerifyTX(ctx, req.(*Tx)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_CommitTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TxList) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).CommitTX(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/CommitTX", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).CommitTX(ctx, req.(*TxList)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_GetState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SingleBytes) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetState(ctx, req.(*SingleBytes)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_GetStateAndProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AccountAndRoot) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetStateAndProof(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetStateAndProof", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetStateAndProof(ctx, req.(*AccountAndRoot)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_CreateAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Personal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).CreateAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/CreateAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).CreateAccount(ctx, req.(*Personal)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_GetAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetAccounts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetAccounts", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetAccounts(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_LockAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Personal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).LockAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/LockAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).LockAccount(ctx, req.(*Personal)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_UnlockAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Personal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).UnlockAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/UnlockAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).UnlockAccount(ctx, req.(*Personal)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_ImportAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ImportFormat) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).ImportAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/ImportAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).ImportAccount(ctx, req.(*ImportFormat)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_ExportAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Personal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).ExportAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/ExportAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).ExportAccount(ctx, req.(*Personal)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_ExportAccountKeystore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Personal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).ExportAccountKeystore(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/ExportAccountKeystore", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).ExportAccountKeystore(ctx, req.(*Personal)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_QueryContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Query) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).QueryContract(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/QueryContract", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).QueryContract(ctx, req.(*Query)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_QueryContractState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StateQuery) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).QueryContractState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/QueryContractState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).QueryContractState(ctx, req.(*StateQuery)) - } - return interceptor(ctx, in, info, handler) -} +type EnterpriseConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func _AergoRPCService_GetPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PeersParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetPeers(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetPeers", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetPeers(ctx, req.(*PeersParams)) - } - return interceptor(ctx, in, info, handler) + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + On bool `protobuf:"varint,2,opt,name=on,proto3" json:"on,omitempty"` + Values []string `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"` } -func _AergoRPCService_GetVotes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(VoteParams) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetVotes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetVotes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetVotes(ctx, req.(*VoteParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _AergoRPCService_GetAccountVotes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AccountAddress) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetAccountVotes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetAccountVotes", +func (x *EnterpriseConfig) Reset() { + *x = EnterpriseConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetAccountVotes(ctx, req.(*AccountAddress)) - } - return interceptor(ctx, in, info, handler) } -func _AergoRPCService_GetStaking_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AccountAddress) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetStaking(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetStaking", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetStaking(ctx, req.(*AccountAddress)) - } - return interceptor(ctx, in, info, handler) +func (x *EnterpriseConfig) String() string { + return protoimpl.X.MessageStringOf(x) } -func _AergoRPCService_GetNameInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Name) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetNameInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetNameInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetNameInfo(ctx, req.(*Name)) - } - return interceptor(ctx, in, info, handler) -} +func (*EnterpriseConfig) ProtoMessage() {} -func _AergoRPCService_ListEventStream_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(FilterInfo) - if err := stream.RecvMsg(m); err != nil { - return err +func (x *EnterpriseConfig) ProtoReflect() protoreflect.Message { + mi := &file_rpc_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return srv.(AergoRPCServiceServer).ListEventStream(m, &aergoRPCServiceListEventStreamServer{stream}) -} - -type AergoRPCService_ListEventStreamServer interface { - Send(*Event) error - grpc.ServerStream -} - -type aergoRPCServiceListEventStreamServer struct { - grpc.ServerStream + return mi.MessageOf(x) } -func (x *aergoRPCServiceListEventStreamServer) Send(m *Event) error { - return x.ServerStream.SendMsg(m) -} - -func _AergoRPCService_ListEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FilterInfo) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).ListEvents(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/ListEvents", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).ListEvents(ctx, req.(*FilterInfo)) - } - return interceptor(ctx, in, info, handler) +// Deprecated: Use EnterpriseConfig.ProtoReflect.Descriptor instead. +func (*EnterpriseConfig) Descriptor() ([]byte, []int) { + return file_rpc_proto_rawDescGZIP(), []int{41} } -func _AergoRPCService_GetServerInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(KeyParams) - if err := dec(in); err != nil { - return nil, err +func (x *EnterpriseConfig) GetKey() string { + if x != nil { + return x.Key } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetServerInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetServerInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetServerInfo(ctx, req.(*KeyParams)) - } - return interceptor(ctx, in, info, handler) + return "" } -func _AergoRPCService_GetConsensusInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetConsensusInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetConsensusInfo", +func (x *EnterpriseConfig) GetOn() bool { + if x != nil { + return x.On } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetConsensusInfo(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) + return false } -func _AergoRPCService_GetEnterpriseConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EnterpriseConfigKey) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetEnterpriseConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetEnterpriseConfig", +func (x *EnterpriseConfig) GetValues() []string { + if x != nil { + return x.Values } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetEnterpriseConfig(ctx, req.(*EnterpriseConfigKey)) - } - return interceptor(ctx, in, info, handler) + return nil } -func _AergoRPCService_GetConfChangeProgress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SingleBytes) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AergoRPCServiceServer).GetConfChangeProgress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/types.AergoRPCService/GetConfChangeProgress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AergoRPCServiceServer).GetConfChangeProgress(ctx, req.(*SingleBytes)) - } - return interceptor(ctx, in, info, handler) -} +var File_rpc_proto protoreflect.FileDescriptor + +var file_rpc_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x1a, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x09, 0x70, 0x32, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x6d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x61, 0x65, 0x72, 0x67, 0x6f, 0x5f, + 0x72, 0x61, 0x66, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe0, 0x01, 0x0a, 0x10, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x26, 0x0a, 0x0f, 0x62, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x62, 0x65, 0x73, 0x74, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x65, 0x73, 0x74, 0x5f, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x62, 0x65, + 0x73, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x2b, 0x0a, 0x12, 0x62, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x62, 0x65, 0x73, + 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2f, 0x0a, 0x0a, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x09, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x89, 0x01, + 0x0a, 0x07, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x67, + 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x61, 0x67, 0x69, 0x63, 0x12, + 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x6e, + 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6d, 0x61, 0x69, 0x6e, 0x6e, 0x65, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xdf, 0x02, 0x0a, 0x09, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x49, 0x64, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x70, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x70, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x73, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x22, 0x0a, + 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, + 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x08, 0x67, 0x61, 0x73, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x76, 0x6f, 0x74, 0x69, + 0x6e, 0x67, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, + 0x67, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x76, + 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x22, 0x24, 0x0a, 0x0a, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x22, 0x63, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x66, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x07, + 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, 0x0a, 0x0b, 0x53, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x24, 0x0a, 0x0c, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x26, 0x0a, 0x0e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5e, 0x0a, 0x0e, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6e, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x52, 0x6f, 0x6f, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, + 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, + 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0xdd, 0x02, 0x0a, 0x04, 0x50, + 0x65, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x65, 0x65, + 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x33, 0x0a, 0x09, 0x62, 0x65, 0x73, 0x74, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x77, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x52, 0x09, 0x62, 0x65, 0x73, + 0x74, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x68, 0x69, + 0x64, 0x64, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x68, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x68, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6c, 0x66, 0x70, 0x65, 0x65, 0x72, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x65, 0x6c, 0x66, 0x70, 0x65, 0x65, 0x72, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0c, 0x63, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, + 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x0c, 0x61, 0x63, + 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x2d, 0x0a, 0x08, 0x50, 0x65, + 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x65, + 0x65, 0x72, 0x52, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x22, 0x76, 0x0a, 0x0a, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x61, 0x73, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x73, + 0x63, 0x22, 0x38, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x78, 0x0a, 0x0e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x67, 0x65, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, + 0x24, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x52, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x60, 0x0a, 0x0f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, + 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x68, 0x61, 0x73, 0x68, + 0x6f, 0x72, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, + 0x68, 0x61, 0x73, 0x68, 0x6f, 0x72, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x06, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x06, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x22, 0x37, 0x0a, 0x0f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x06, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, + 0x22, 0x7d, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x2a, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x78, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x74, 0x78, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, + 0x41, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x22, 0x65, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x29, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x41, 0x0a, 0x10, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2d, 0x0a, + 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x54, 0x0a, 0x0c, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x19, 0x0a, 0x02, + 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x54, 0x78, 0x52, 0x02, 0x74, 0x78, 0x12, 0x29, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x22, 0x54, 0x0a, 0x08, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x12, 0x1e, + 0x0a, 0x0a, 0x70, 0x61, 0x73, 0x73, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x73, 0x73, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x12, 0x28, + 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x98, 0x01, 0x0a, 0x0c, 0x49, 0x6d, 0x70, + 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x24, 0x0a, 0x03, 0x77, 0x69, 0x66, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, + 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x03, 0x77, 0x69, 0x66, 0x12, + 0x18, 0x0a, 0x07, 0x6f, 0x6c, 0x64, 0x70, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6f, 0x6c, 0x64, 0x70, 0x61, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x77, + 0x70, 0x61, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x70, + 0x61, 0x73, 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x22, 0x35, 0x0a, 0x07, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x77, 0x68, 0x65, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x77, 0x68, 0x65, 0x6e, 0x22, 0x3c, 0x0a, 0x04, 0x56, 0x6f, + 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x32, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x64, 0x0a, 0x0f, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x28, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x52, 0x07, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x0a, 0x06, 0x76, 0x6f, 0x74, + 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x76, 0x6f, 0x74, 0x69, + 0x6e, 0x67, 0x22, 0x52, 0x0a, 0x08, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0a, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3d, 0x0a, 0x08, 0x56, 0x6f, 0x74, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x21, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x05, + 0x76, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x41, 0x0a, 0x07, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, + 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, + 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x22, 0x34, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x6f, 0x22, 0x63, + 0x0a, 0x08, 0x4e, 0x61, 0x6d, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, + 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x0b, 0x50, 0x65, 0x65, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x6f, 0x48, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x6f, 0x48, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x1a, + 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x53, 0x65, 0x6c, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x73, 0x68, 0x6f, 0x77, 0x53, 0x65, 0x6c, 0x66, 0x22, 0x1d, 0x0a, 0x09, 0x4b, 0x65, + 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x83, 0x02, 0x0a, 0x0a, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x35, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x35, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x4c, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x7a, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x32, 0x0a, + 0x05, 0x70, 0x72, 0x6f, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x2e, + 0x50, 0x72, 0x6f, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x70, + 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x31, 0x0a, 0x09, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x49, + 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x70, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x62, 0x70, 0x73, 0x22, 0x27, 0x0a, 0x13, 0x45, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4b, 0x65, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x22, 0x4c, 0x0a, 0x10, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x2a, 0xd2, 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x58, 0x5f, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, + 0x54, 0x58, 0x5f, 0x4e, 0x4f, 0x4e, 0x43, 0x45, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x4f, 0x57, + 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x58, 0x5f, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, + 0x5f, 0x45, 0x58, 0x49, 0x53, 0x54, 0x53, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x58, 0x5f, + 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x03, 0x12, 0x13, + 0x0a, 0x0f, 0x54, 0x58, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x53, 0x49, 0x47, + 0x4e, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x58, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, + 0x44, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x10, 0x05, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x58, + 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x42, 0x41, + 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x58, 0x5f, 0x48, 0x41, + 0x53, 0x5f, 0x53, 0x41, 0x4d, 0x45, 0x5f, 0x4e, 0x4f, 0x4e, 0x43, 0x45, 0x10, 0x07, 0x12, 0x15, + 0x0a, 0x11, 0x54, 0x58, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x10, 0x09, 0x2a, 0x66, 0x0a, 0x0c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x5f, + 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1c, 0x56, + 0x45, 0x52, 0x49, 0x46, 0x59, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x49, 0x47, + 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x10, 0x01, 0x12, 0x1e, 0x0a, + 0x1a, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x02, 0x32, 0x9b, 0x12, + 0x0a, 0x0f, 0x41, 0x65, 0x72, 0x67, 0x6f, 0x52, 0x50, 0x43, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x31, 0x0a, 0x09, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x12, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x15, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x12, 0x30, + 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0c, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x10, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, + 0x12, 0x2e, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x12, 0x0c, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x11, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x22, 0x00, + 0x12, 0x3f, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x12, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x16, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x22, + 0x00, 0x12, 0x42, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x18, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4c, + 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x00, 0x30, 0x01, 0x12, 0x41, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x12, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x14, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x00, 0x30, 0x01, 0x12, 0x2e, 0x0a, 0x08, 0x47, + 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x0c, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x10, 0x47, + 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x1a, 0x14, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0c, 0x47, + 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x16, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x1a, 0x15, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x67, 0x65, 0x64, 0x22, 0x00, 0x12, 0x28, 0x0a, 0x05, + 0x47, 0x65, 0x74, 0x54, 0x58, 0x12, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x69, + 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x09, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x54, 0x78, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x54, 0x58, 0x12, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x10, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x54, 0x78, 0x49, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x0a, + 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x12, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x0e, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x22, 0x00, + 0x12, 0x2a, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x42, 0x49, 0x12, 0x12, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x0a, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x42, 0x49, 0x22, 0x00, 0x12, 0x2a, 0x0a, 0x06, + 0x53, 0x65, 0x6e, 0x64, 0x54, 0x58, 0x12, 0x09, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, + 0x78, 0x1a, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x20, 0x0a, 0x06, 0x53, 0x69, 0x67, 0x6e, + 0x54, 0x58, 0x12, 0x09, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, 0x78, 0x1a, 0x09, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, 0x78, 0x22, 0x00, 0x12, 0x2c, 0x0a, 0x08, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x54, 0x58, 0x12, 0x09, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, + 0x78, 0x1a, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x34, 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x54, 0x58, 0x12, 0x0d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x54, 0x78, 0x4c, + 0x69, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x2e, + 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x0c, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0x00, 0x12, 0x40, + 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x12, 0x15, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x41, 0x6e, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x00, + 0x12, 0x32, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x0f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, + 0x61, 0x6c, 0x1a, 0x0e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x12, 0x0c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x1a, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x1a, 0x0e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x00, 0x12, 0x32, 0x0a, 0x0d, 0x55, 0x6e, 0x6c, + 0x6f, 0x63, 0x6b, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0f, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x1a, 0x0e, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x00, 0x12, 0x36, 0x0a, + 0x0d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x13, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, + 0x6d, 0x61, 0x74, 0x1a, 0x0e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x0d, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x1a, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x00, 0x12, 0x3e, 0x0a, + 0x15, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, + 0x79, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x0f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x1a, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x00, 0x12, 0x33, 0x0a, + 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x0c, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x1a, 0x12, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x22, 0x00, 0x12, 0x41, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x1a, 0x16, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x22, 0x00, 0x12, 0x31, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, + 0x73, 0x12, 0x12, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x73, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x0f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x65, + 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x56, + 0x6f, 0x74, 0x65, 0x73, 0x12, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x6f, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x0f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x56, 0x6f, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0f, 0x47, 0x65, + 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x15, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x1a, 0x16, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x35, + 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x15, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x1a, 0x0e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, + 0x69, 0x6e, 0x67, 0x22, 0x00, 0x12, 0x2d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x61, 0x6d, + 0x65, 0x1a, 0x0f, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x0c, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x00, 0x30, 0x01, 0x12, 0x33, 0x0a, 0x0a, + 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x11, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x10, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, + 0x00, 0x12, 0x36, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x10, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4b, 0x65, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x11, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x10, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0c, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x14, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, + 0x6f, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x4b, 0x65, 0x79, 0x1a, 0x17, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, + 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, + 0x00, 0x12, 0x48, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x19, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x00, 0x42, 0x08, 0x5a, 0x06, 0x2f, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpc_proto_rawDescOnce sync.Once + file_rpc_proto_rawDescData = file_rpc_proto_rawDesc +) -var _AergoRPCService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "types.AergoRPCService", - HandlerType: (*AergoRPCServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "NodeState", - Handler: _AergoRPCService_NodeState_Handler, - }, - { - MethodName: "Metric", - Handler: _AergoRPCService_Metric_Handler, - }, - { - MethodName: "Blockchain", - Handler: _AergoRPCService_Blockchain_Handler, - }, - { - MethodName: "GetChainInfo", - Handler: _AergoRPCService_GetChainInfo_Handler, - }, - { - MethodName: "ChainStat", - Handler: _AergoRPCService_ChainStat_Handler, - }, - { - MethodName: "ListBlockHeaders", - Handler: _AergoRPCService_ListBlockHeaders_Handler, - }, - { - MethodName: "ListBlockMetadata", - Handler: _AergoRPCService_ListBlockMetadata_Handler, - }, - { - MethodName: "GetBlock", - Handler: _AergoRPCService_GetBlock_Handler, - }, - { - MethodName: "GetBlockMetadata", - Handler: _AergoRPCService_GetBlockMetadata_Handler, - }, - { - MethodName: "GetBlockBody", - Handler: _AergoRPCService_GetBlockBody_Handler, - }, - { - MethodName: "GetTX", - Handler: _AergoRPCService_GetTX_Handler, - }, - { - MethodName: "GetBlockTX", - Handler: _AergoRPCService_GetBlockTX_Handler, - }, - { - MethodName: "GetReceipt", - Handler: _AergoRPCService_GetReceipt_Handler, - }, - { - MethodName: "GetABI", - Handler: _AergoRPCService_GetABI_Handler, - }, - { - MethodName: "SendTX", - Handler: _AergoRPCService_SendTX_Handler, - }, - { - MethodName: "SignTX", - Handler: _AergoRPCService_SignTX_Handler, - }, - { - MethodName: "VerifyTX", - Handler: _AergoRPCService_VerifyTX_Handler, - }, - { - MethodName: "CommitTX", - Handler: _AergoRPCService_CommitTX_Handler, - }, - { - MethodName: "GetState", - Handler: _AergoRPCService_GetState_Handler, - }, - { - MethodName: "GetStateAndProof", - Handler: _AergoRPCService_GetStateAndProof_Handler, - }, - { - MethodName: "CreateAccount", - Handler: _AergoRPCService_CreateAccount_Handler, - }, - { - MethodName: "GetAccounts", - Handler: _AergoRPCService_GetAccounts_Handler, - }, - { - MethodName: "LockAccount", - Handler: _AergoRPCService_LockAccount_Handler, - }, - { - MethodName: "UnlockAccount", - Handler: _AergoRPCService_UnlockAccount_Handler, - }, - { - MethodName: "ImportAccount", - Handler: _AergoRPCService_ImportAccount_Handler, - }, - { - MethodName: "ExportAccount", - Handler: _AergoRPCService_ExportAccount_Handler, - }, - { - MethodName: "ExportAccountKeystore", - Handler: _AergoRPCService_ExportAccountKeystore_Handler, - }, - { - MethodName: "QueryContract", - Handler: _AergoRPCService_QueryContract_Handler, - }, - { - MethodName: "QueryContractState", - Handler: _AergoRPCService_QueryContractState_Handler, - }, - { - MethodName: "GetPeers", - Handler: _AergoRPCService_GetPeers_Handler, - }, - { - MethodName: "GetVotes", - Handler: _AergoRPCService_GetVotes_Handler, - }, - { - MethodName: "GetAccountVotes", - Handler: _AergoRPCService_GetAccountVotes_Handler, - }, - { - MethodName: "GetStaking", - Handler: _AergoRPCService_GetStaking_Handler, - }, - { - MethodName: "GetNameInfo", - Handler: _AergoRPCService_GetNameInfo_Handler, - }, - { - MethodName: "ListEvents", - Handler: _AergoRPCService_ListEvents_Handler, - }, - { - MethodName: "GetServerInfo", - Handler: _AergoRPCService_GetServerInfo_Handler, - }, - { - MethodName: "GetConsensusInfo", - Handler: _AergoRPCService_GetConsensusInfo_Handler, - }, - { - MethodName: "GetEnterpriseConfig", - Handler: _AergoRPCService_GetEnterpriseConfig_Handler, - }, - { - MethodName: "GetConfChangeProgress", - Handler: _AergoRPCService_GetConfChangeProgress_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "ListBlockStream", - Handler: _AergoRPCService_ListBlockStream_Handler, - ServerStreams: true, - }, - { - StreamName: "ListBlockMetadataStream", - Handler: _AergoRPCService_ListBlockMetadataStream_Handler, - ServerStreams: true, - }, - { - StreamName: "ListEventStream", - Handler: _AergoRPCService_ListEventStream_Handler, - ServerStreams: true, +func file_rpc_proto_rawDescGZIP() []byte { + file_rpc_proto_rawDescOnce.Do(func() { + file_rpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_proto_rawDescData) + }) + return file_rpc_proto_rawDescData +} + +var file_rpc_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 45) +var file_rpc_proto_goTypes = []interface{}{ + (CommitStatus)(0), // 0: types.CommitStatus + (VerifyStatus)(0), // 1: types.VerifyStatus + (*BlockchainStatus)(nil), // 2: types.BlockchainStatus + (*ChainId)(nil), // 3: types.ChainId + (*ChainInfo)(nil), // 4: types.ChainInfo + (*ChainStats)(nil), // 5: types.ChainStats + (*Input)(nil), // 6: types.Input + (*Output)(nil), // 7: types.Output + (*Empty)(nil), // 8: types.Empty + (*SingleBytes)(nil), // 9: types.SingleBytes + (*SingleString)(nil), // 10: types.SingleString + (*AccountAddress)(nil), // 11: types.AccountAddress + (*AccountAndRoot)(nil), // 12: types.AccountAndRoot + (*Peer)(nil), // 13: types.Peer + (*PeerList)(nil), // 14: types.PeerList + (*ListParams)(nil), // 15: types.ListParams + (*PageParams)(nil), // 16: types.PageParams + (*BlockBodyPaged)(nil), // 17: types.BlockBodyPaged + (*BlockBodyParams)(nil), // 18: types.BlockBodyParams + (*BlockHeaderList)(nil), // 19: types.BlockHeaderList + (*BlockMetadata)(nil), // 20: types.BlockMetadata + (*BlockMetadataList)(nil), // 21: types.BlockMetadataList + (*CommitResult)(nil), // 22: types.CommitResult + (*CommitResultList)(nil), // 23: types.CommitResultList + (*VerifyResult)(nil), // 24: types.VerifyResult + (*Personal)(nil), // 25: types.Personal + (*ImportFormat)(nil), // 26: types.ImportFormat + (*Staking)(nil), // 27: types.Staking + (*Vote)(nil), // 28: types.Vote + (*VoteParams)(nil), // 29: types.VoteParams + (*AccountVoteInfo)(nil), // 30: types.AccountVoteInfo + (*VoteInfo)(nil), // 31: types.VoteInfo + (*VoteList)(nil), // 32: types.VoteList + (*NodeReq)(nil), // 33: types.NodeReq + (*Name)(nil), // 34: types.Name + (*NameInfo)(nil), // 35: types.NameInfo + (*PeersParams)(nil), // 36: types.PeersParams + (*KeyParams)(nil), // 37: types.KeyParams + (*ServerInfo)(nil), // 38: types.ServerInfo + (*ConfigItem)(nil), // 39: types.ConfigItem + (*EventList)(nil), // 40: types.EventList + (*ConsensusInfo)(nil), // 41: types.ConsensusInfo + (*EnterpriseConfigKey)(nil), // 42: types.EnterpriseConfigKey + (*EnterpriseConfig)(nil), // 43: types.EnterpriseConfig + nil, // 44: types.ServerInfo.StatusEntry + nil, // 45: types.ServerInfo.ConfigEntry + nil, // 46: types.ConfigItem.PropsEntry + (*PeerAddress)(nil), // 47: types.PeerAddress + (*NewBlockNotice)(nil), // 48: types.NewBlockNotice + (*AgentCertificate)(nil), // 49: types.AgentCertificate + (PeerRole)(0), // 50: types.PeerRole + (*BlockBody)(nil), // 51: types.BlockBody + (*Block)(nil), // 52: types.Block + (*BlockHeader)(nil), // 53: types.BlockHeader + (*Tx)(nil), // 54: types.Tx + (*Account)(nil), // 55: types.Account + (*Event)(nil), // 56: types.Event + (*MetricsRequest)(nil), // 57: types.MetricsRequest + (*TxList)(nil), // 58: types.TxList + (*Query)(nil), // 59: types.Query + (*StateQuery)(nil), // 60: types.StateQuery + (*FilterInfo)(nil), // 61: types.FilterInfo + (*Metrics)(nil), // 62: types.Metrics + (*TxInBlock)(nil), // 63: types.TxInBlock + (*Receipt)(nil), // 64: types.Receipt + (*ABI)(nil), // 65: types.ABI + (*State)(nil), // 66: types.State + (*AccountProof)(nil), // 67: types.AccountProof + (*AccountList)(nil), // 68: types.AccountList + (*StateQueryProof)(nil), // 69: types.StateQueryProof + (*ConfChangeProgress)(nil), // 70: types.ConfChangeProgress +} +var file_rpc_proto_depIdxs = []int32{ + 4, // 0: types.BlockchainStatus.chain_info:type_name -> types.ChainInfo + 3, // 1: types.ChainInfo.id:type_name -> types.ChainId + 47, // 2: types.Peer.address:type_name -> types.PeerAddress + 48, // 3: types.Peer.bestblock:type_name -> types.NewBlockNotice + 49, // 4: types.Peer.certificates:type_name -> types.AgentCertificate + 50, // 5: types.Peer.acceptedRole:type_name -> types.PeerRole + 13, // 6: types.PeerList.peers:type_name -> types.Peer + 51, // 7: types.BlockBodyPaged.body:type_name -> types.BlockBody + 16, // 8: types.BlockBodyParams.paging:type_name -> types.PageParams + 52, // 9: types.BlockHeaderList.blocks:type_name -> types.Block + 53, // 10: types.BlockMetadata.header:type_name -> types.BlockHeader + 20, // 11: types.BlockMetadataList.blocks:type_name -> types.BlockMetadata + 0, // 12: types.CommitResult.error:type_name -> types.CommitStatus + 22, // 13: types.CommitResultList.results:type_name -> types.CommitResult + 54, // 14: types.VerifyResult.tx:type_name -> types.Tx + 1, // 15: types.VerifyResult.error:type_name -> types.VerifyStatus + 55, // 16: types.Personal.account:type_name -> types.Account + 9, // 17: types.ImportFormat.wif:type_name -> types.SingleBytes + 9, // 18: types.ImportFormat.keystore:type_name -> types.SingleBytes + 27, // 19: types.AccountVoteInfo.staking:type_name -> types.Staking + 31, // 20: types.AccountVoteInfo.voting:type_name -> types.VoteInfo + 28, // 21: types.VoteList.votes:type_name -> types.Vote + 34, // 22: types.NameInfo.name:type_name -> types.Name + 44, // 23: types.ServerInfo.status:type_name -> types.ServerInfo.StatusEntry + 45, // 24: types.ServerInfo.config:type_name -> types.ServerInfo.ConfigEntry + 46, // 25: types.ConfigItem.props:type_name -> types.ConfigItem.PropsEntry + 56, // 26: types.EventList.events:type_name -> types.Event + 39, // 27: types.ServerInfo.ConfigEntry.value:type_name -> types.ConfigItem + 33, // 28: types.AergoRPCService.NodeState:input_type -> types.NodeReq + 57, // 29: types.AergoRPCService.Metric:input_type -> types.MetricsRequest + 8, // 30: types.AergoRPCService.Blockchain:input_type -> types.Empty + 8, // 31: types.AergoRPCService.GetChainInfo:input_type -> types.Empty + 8, // 32: types.AergoRPCService.ChainStat:input_type -> types.Empty + 15, // 33: types.AergoRPCService.ListBlockHeaders:input_type -> types.ListParams + 15, // 34: types.AergoRPCService.ListBlockMetadata:input_type -> types.ListParams + 8, // 35: types.AergoRPCService.ListBlockStream:input_type -> types.Empty + 8, // 36: types.AergoRPCService.ListBlockMetadataStream:input_type -> types.Empty + 9, // 37: types.AergoRPCService.GetBlock:input_type -> types.SingleBytes + 9, // 38: types.AergoRPCService.GetBlockMetadata:input_type -> types.SingleBytes + 18, // 39: types.AergoRPCService.GetBlockBody:input_type -> types.BlockBodyParams + 9, // 40: types.AergoRPCService.GetTX:input_type -> types.SingleBytes + 9, // 41: types.AergoRPCService.GetBlockTX:input_type -> types.SingleBytes + 9, // 42: types.AergoRPCService.GetReceipt:input_type -> types.SingleBytes + 9, // 43: types.AergoRPCService.GetABI:input_type -> types.SingleBytes + 54, // 44: types.AergoRPCService.SendTX:input_type -> types.Tx + 54, // 45: types.AergoRPCService.SignTX:input_type -> types.Tx + 54, // 46: types.AergoRPCService.VerifyTX:input_type -> types.Tx + 58, // 47: types.AergoRPCService.CommitTX:input_type -> types.TxList + 9, // 48: types.AergoRPCService.GetState:input_type -> types.SingleBytes + 12, // 49: types.AergoRPCService.GetStateAndProof:input_type -> types.AccountAndRoot + 25, // 50: types.AergoRPCService.CreateAccount:input_type -> types.Personal + 8, // 51: types.AergoRPCService.GetAccounts:input_type -> types.Empty + 25, // 52: types.AergoRPCService.LockAccount:input_type -> types.Personal + 25, // 53: types.AergoRPCService.UnlockAccount:input_type -> types.Personal + 26, // 54: types.AergoRPCService.ImportAccount:input_type -> types.ImportFormat + 25, // 55: types.AergoRPCService.ExportAccount:input_type -> types.Personal + 25, // 56: types.AergoRPCService.ExportAccountKeystore:input_type -> types.Personal + 59, // 57: types.AergoRPCService.QueryContract:input_type -> types.Query + 60, // 58: types.AergoRPCService.QueryContractState:input_type -> types.StateQuery + 36, // 59: types.AergoRPCService.GetPeers:input_type -> types.PeersParams + 29, // 60: types.AergoRPCService.GetVotes:input_type -> types.VoteParams + 11, // 61: types.AergoRPCService.GetAccountVotes:input_type -> types.AccountAddress + 11, // 62: types.AergoRPCService.GetStaking:input_type -> types.AccountAddress + 34, // 63: types.AergoRPCService.GetNameInfo:input_type -> types.Name + 61, // 64: types.AergoRPCService.ListEventStream:input_type -> types.FilterInfo + 61, // 65: types.AergoRPCService.ListEvents:input_type -> types.FilterInfo + 37, // 66: types.AergoRPCService.GetServerInfo:input_type -> types.KeyParams + 8, // 67: types.AergoRPCService.GetConsensusInfo:input_type -> types.Empty + 42, // 68: types.AergoRPCService.GetEnterpriseConfig:input_type -> types.EnterpriseConfigKey + 9, // 69: types.AergoRPCService.GetConfChangeProgress:input_type -> types.SingleBytes + 9, // 70: types.AergoRPCService.NodeState:output_type -> types.SingleBytes + 62, // 71: types.AergoRPCService.Metric:output_type -> types.Metrics + 2, // 72: types.AergoRPCService.Blockchain:output_type -> types.BlockchainStatus + 4, // 73: types.AergoRPCService.GetChainInfo:output_type -> types.ChainInfo + 5, // 74: types.AergoRPCService.ChainStat:output_type -> types.ChainStats + 19, // 75: types.AergoRPCService.ListBlockHeaders:output_type -> types.BlockHeaderList + 21, // 76: types.AergoRPCService.ListBlockMetadata:output_type -> types.BlockMetadataList + 52, // 77: types.AergoRPCService.ListBlockStream:output_type -> types.Block + 20, // 78: types.AergoRPCService.ListBlockMetadataStream:output_type -> types.BlockMetadata + 52, // 79: types.AergoRPCService.GetBlock:output_type -> types.Block + 20, // 80: types.AergoRPCService.GetBlockMetadata:output_type -> types.BlockMetadata + 17, // 81: types.AergoRPCService.GetBlockBody:output_type -> types.BlockBodyPaged + 54, // 82: types.AergoRPCService.GetTX:output_type -> types.Tx + 63, // 83: types.AergoRPCService.GetBlockTX:output_type -> types.TxInBlock + 64, // 84: types.AergoRPCService.GetReceipt:output_type -> types.Receipt + 65, // 85: types.AergoRPCService.GetABI:output_type -> types.ABI + 22, // 86: types.AergoRPCService.SendTX:output_type -> types.CommitResult + 54, // 87: types.AergoRPCService.SignTX:output_type -> types.Tx + 24, // 88: types.AergoRPCService.VerifyTX:output_type -> types.VerifyResult + 23, // 89: types.AergoRPCService.CommitTX:output_type -> types.CommitResultList + 66, // 90: types.AergoRPCService.GetState:output_type -> types.State + 67, // 91: types.AergoRPCService.GetStateAndProof:output_type -> types.AccountProof + 55, // 92: types.AergoRPCService.CreateAccount:output_type -> types.Account + 68, // 93: types.AergoRPCService.GetAccounts:output_type -> types.AccountList + 55, // 94: types.AergoRPCService.LockAccount:output_type -> types.Account + 55, // 95: types.AergoRPCService.UnlockAccount:output_type -> types.Account + 55, // 96: types.AergoRPCService.ImportAccount:output_type -> types.Account + 9, // 97: types.AergoRPCService.ExportAccount:output_type -> types.SingleBytes + 9, // 98: types.AergoRPCService.ExportAccountKeystore:output_type -> types.SingleBytes + 9, // 99: types.AergoRPCService.QueryContract:output_type -> types.SingleBytes + 69, // 100: types.AergoRPCService.QueryContractState:output_type -> types.StateQueryProof + 14, // 101: types.AergoRPCService.GetPeers:output_type -> types.PeerList + 32, // 102: types.AergoRPCService.GetVotes:output_type -> types.VoteList + 30, // 103: types.AergoRPCService.GetAccountVotes:output_type -> types.AccountVoteInfo + 27, // 104: types.AergoRPCService.GetStaking:output_type -> types.Staking + 35, // 105: types.AergoRPCService.GetNameInfo:output_type -> types.NameInfo + 56, // 106: types.AergoRPCService.ListEventStream:output_type -> types.Event + 40, // 107: types.AergoRPCService.ListEvents:output_type -> types.EventList + 38, // 108: types.AergoRPCService.GetServerInfo:output_type -> types.ServerInfo + 41, // 109: types.AergoRPCService.GetConsensusInfo:output_type -> types.ConsensusInfo + 43, // 110: types.AergoRPCService.GetEnterpriseConfig:output_type -> types.EnterpriseConfig + 70, // 111: types.AergoRPCService.GetConfChangeProgress:output_type -> types.ConfChangeProgress + 70, // [70:112] is the sub-list for method output_type + 28, // [28:70] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name +} + +func init() { file_rpc_proto_init() } +func file_rpc_proto_init() { + if File_rpc_proto != nil { + return + } + file_blockchain_proto_init() + file_account_proto_init() + file_node_proto_init() + file_p2p_proto_init() + file_metric_proto_init() + file_aergo_raft_proto_init() + if !protoimpl.UnsafeEnabled { + file_rpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockchainStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChainId); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChainInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChainStats); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Input); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Output); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SingleBytes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SingleString); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountAddress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountAndRoot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Peer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PageParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockBodyPaged); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockBodyParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockHeaderList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockMetadataList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommitResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommitResultList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Personal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImportFormat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Staking); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Vote); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VoteParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountVoteInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VoteInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VoteList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Name); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NameInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeersParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServerInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConsensusInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnterpriseConfigKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EnterpriseConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpc_proto_rawDesc, + NumEnums: 2, + NumMessages: 45, + NumExtensions: 0, + NumServices: 1, }, - }, - Metadata: "rpc.proto", -} - -func init() { proto.RegisterFile("rpc.proto", fileDescriptor_rpc_8d86ee9ecec344df) } - -var fileDescriptor_rpc_8d86ee9ecec344df = []byte{ - // 2612 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x59, 0xdd, 0x73, 0x1b, 0xb7, - 0x11, 0x27, 0x29, 0x51, 0x22, 0x97, 0xa4, 0x44, 0xc1, 0xb2, 0xad, 0xb0, 0x89, 0xa3, 0xa2, 0x6e, - 0xa2, 0xb8, 0x89, 0x1a, 0xd3, 0x49, 0x9a, 0x7e, 0x25, 0xa5, 0x18, 0xda, 0xe2, 0x58, 0xa6, 0x54, - 0x90, 0x71, 0x95, 0x97, 0xb2, 0xa7, 0x3b, 0x90, 0xbc, 0x11, 0x79, 0x77, 0xb9, 0x03, 0xf5, 0x91, - 0x99, 0x3e, 0xf5, 0xa9, 0xff, 0x41, 0x67, 0xfa, 0x5f, 0xf5, 0xbd, 0xd3, 0xfe, 0x29, 0x1d, 0x2c, - 0x80, 0xfb, 0xa0, 0xce, 0x9d, 0xba, 0x6f, 0xb7, 0x8b, 0xdf, 0x7e, 0x01, 0x8b, 0xc5, 0x02, 0x07, - 0xd5, 0x30, 0xb0, 0x0f, 0x83, 0xd0, 0x17, 0x3e, 0x29, 0x8b, 0xdb, 0x80, 0x47, 0xad, 0xe6, 0xc5, - 0xdc, 0xb7, 0x2f, 0xed, 0x99, 0xe5, 0x7a, 0x6a, 0xa0, 0xd5, 0xb0, 0x6c, 0xdb, 0x5f, 0x7a, 0x42, - 0x93, 0xe0, 0xf9, 0x0e, 0xd7, 0xdf, 0xd5, 0xa0, 0x1d, 0xe8, 0xcf, 0xfa, 0x82, 0x8b, 0xd0, 0xb5, - 0x0d, 0x28, 0xb4, 0x26, 0x5a, 0x80, 0xfe, 0xbb, 0x08, 0xcd, 0xa3, 0x58, 0xe9, 0x50, 0x58, 0x62, - 0x19, 0x91, 0x0f, 0x60, 0xfb, 0x82, 0x47, 0x62, 0x8c, 0xd6, 0xc6, 0x33, 0x2b, 0x9a, 0xed, 0x15, - 0xf7, 0x8b, 0x07, 0x75, 0xd6, 0x90, 0x6c, 0x84, 0x1f, 0x5b, 0xd1, 0x8c, 0xbc, 0x0f, 0x35, 0xc4, - 0xcd, 0xb8, 0x3b, 0x9d, 0x89, 0xbd, 0xd2, 0x7e, 0xf1, 0x60, 0x9d, 0x81, 0x64, 0x1d, 0x23, 0x87, - 0xfc, 0x14, 0xb6, 0x6c, 0xdf, 0x8b, 0xb8, 0x17, 0x2d, 0xa3, 0xb1, 0xeb, 0x4d, 0xfc, 0xbd, 0xb5, - 0xfd, 0xe2, 0x41, 0x95, 0x35, 0x62, 0x6e, 0xdf, 0x9b, 0xf8, 0xe4, 0x67, 0x40, 0x50, 0x0f, 0xfa, - 0x30, 0x76, 0x1d, 0x65, 0x72, 0x1d, 0x4d, 0xa2, 0x27, 0x5d, 0x39, 0xd0, 0x77, 0xd0, 0xe8, 0xcf, - 0x01, 0x34, 0x4e, 0xea, 0x2b, 0xef, 0x17, 0x0f, 0x6a, 0xed, 0xe6, 0x21, 0xce, 0xcf, 0xa1, 0xc2, - 0x79, 0x13, 0x9f, 0x55, 0x6d, 0xf3, 0x49, 0xff, 0x5a, 0x84, 0x4d, 0xad, 0x80, 0xec, 0x42, 0x79, - 0x61, 0x4d, 0x5d, 0x1b, 0xe3, 0xa9, 0x32, 0x45, 0x90, 0x07, 0xb0, 0x11, 0x2c, 0x2f, 0xe6, 0xae, - 0x8d, 0x21, 0x54, 0x98, 0xa6, 0xc8, 0x1e, 0x6c, 0x2e, 0x2c, 0xd7, 0xf3, 0xb8, 0x40, 0xbf, 0x2b, - 0xcc, 0x90, 0xe4, 0x5d, 0xa8, 0xc6, 0x21, 0xa0, 0xa3, 0x55, 0x96, 0x30, 0xa4, 0xdc, 0x15, 0x0f, - 0x23, 0xd7, 0xf7, 0xd0, 0xbf, 0x32, 0x33, 0x24, 0xfd, 0x57, 0x09, 0xaa, 0xb1, 0x93, 0xe4, 0x11, - 0x94, 0x5c, 0x07, 0x5d, 0xa9, 0xb5, 0xb7, 0x32, 0x21, 0x38, 0xac, 0xe4, 0x3a, 0xa4, 0x05, 0x95, - 0x8b, 0x60, 0xb0, 0x5c, 0x5c, 0xf0, 0x10, 0x3d, 0x6b, 0xb0, 0x98, 0x26, 0x14, 0xea, 0x0b, 0xeb, - 0x06, 0x57, 0x28, 0x72, 0x7f, 0xe0, 0xe8, 0xe0, 0x3a, 0xcb, 0xf0, 0xa4, 0x97, 0x0b, 0xeb, 0x46, - 0xf8, 0x97, 0xdc, 0x8b, 0xf4, 0x74, 0x26, 0x0c, 0xf2, 0x01, 0x6c, 0x45, 0xc2, 0xba, 0x74, 0xbd, - 0xe9, 0xc2, 0xf5, 0xdc, 0xc5, 0x72, 0x81, 0xce, 0xd6, 0xd9, 0x0a, 0x57, 0x5a, 0x12, 0xbe, 0xb0, - 0xe6, 0x9a, 0xbd, 0xb7, 0x81, 0xa8, 0x0c, 0x4f, 0x7a, 0x3a, 0xb5, 0xa2, 0x20, 0x74, 0x6d, 0xbe, - 0xb7, 0x89, 0xe3, 0x31, 0x2d, 0xbd, 0xf0, 0xac, 0x05, 0x57, 0x83, 0x15, 0xe5, 0x45, 0xcc, 0x20, - 0x4f, 0xa0, 0x89, 0x9a, 0xae, 0x7c, 0xe1, 0x7a, 0xd3, 0xc0, 0xbf, 0xe6, 0xe1, 0x5e, 0x15, 0x41, - 0x77, 0xf8, 0xd2, 0x13, 0x45, 0x86, 0xfc, 0xda, 0x0a, 0x9d, 0x3d, 0x50, 0x9e, 0xa4, 0x79, 0xf4, - 0x31, 0x40, 0xd7, 0xa4, 0x72, 0x24, 0x57, 0x36, 0xe4, 0x81, 0x1f, 0x0a, 0xbd, 0xe0, 0x9a, 0xa2, - 0x36, 0x94, 0xfb, 0x5e, 0xb0, 0x14, 0x84, 0xc0, 0x7a, 0x2a, 0xbf, 0xf1, 0x5b, 0x2e, 0x9f, 0xe5, - 0x38, 0x21, 0x8f, 0xa2, 0xbd, 0xd2, 0xfe, 0xda, 0x41, 0x9d, 0x19, 0x52, 0xa6, 0xcf, 0x95, 0x35, - 0x5f, 0xaa, 0xd9, 0xae, 0x33, 0x45, 0x48, 0x23, 0x91, 0x1d, 0xba, 0x81, 0xd0, 0x73, 0xac, 0x29, - 0x3a, 0x81, 0x8d, 0xd3, 0xa5, 0x90, 0x56, 0x76, 0xa1, 0xec, 0x7a, 0x0e, 0xbf, 0x41, 0x33, 0x0d, - 0xa6, 0x88, 0xac, 0x9d, 0xe2, 0xff, 0x6f, 0x67, 0x13, 0xca, 0xbd, 0x45, 0x20, 0x6e, 0xe9, 0x4f, - 0xa0, 0x36, 0x74, 0xbd, 0xe9, 0x9c, 0x1f, 0xdd, 0x0a, 0x9e, 0xd2, 0x52, 0x4c, 0x69, 0xa1, 0x8f, - 0xa1, 0xae, 0x40, 0x43, 0x11, 0xca, 0xa5, 0xcb, 0xa0, 0xaa, 0x06, 0xf5, 0x01, 0x6c, 0x75, 0x54, - 0x65, 0xe9, 0xac, 0xfa, 0x94, 0xd1, 0xf6, 0xc7, 0x04, 0xe7, 0x39, 0xcc, 0xf7, 0x85, 0x8c, 0x4a, - 0x73, 0x34, 0xd2, 0x90, 0x72, 0xae, 0x25, 0x42, 0x07, 0x8b, 0xdf, 0xe4, 0x11, 0x40, 0xd7, 0x5f, - 0x04, 0xd2, 0x02, 0x77, 0xf4, 0x2e, 0x4b, 0x71, 0xe8, 0x3f, 0x4b, 0xb0, 0x7e, 0xc6, 0x79, 0x48, - 0x3e, 0x4e, 0x26, 0x4b, 0x6d, 0x18, 0xa2, 0x37, 0x8c, 0x1c, 0xd5, 0x3e, 0x26, 0x13, 0xf8, 0x0c, - 0xaa, 0xb2, 0x6e, 0xe0, 0x56, 0x40, 0x7b, 0xb5, 0xf6, 0x7d, 0x8d, 0x1f, 0xf0, 0x6b, 0xac, 0x60, - 0x03, 0x5f, 0xb8, 0x36, 0x67, 0x09, 0x4e, 0x46, 0x18, 0x09, 0x4b, 0xa8, 0x59, 0x2f, 0x33, 0x45, - 0xc8, 0x59, 0x9f, 0xb9, 0x8e, 0xc3, 0x3d, 0x9c, 0xf5, 0x0a, 0xd3, 0x94, 0x4c, 0xeb, 0xb9, 0x15, - 0xcd, 0xba, 0x33, 0x6e, 0x5f, 0xe2, 0xce, 0x59, 0x63, 0x09, 0x43, 0x6e, 0x88, 0x88, 0xcf, 0x27, - 0x01, 0xe7, 0x21, 0x6e, 0x98, 0x0a, 0x8b, 0xe9, 0x74, 0x79, 0xd8, 0xc4, 0x39, 0x37, 0x24, 0xf9, - 0x35, 0xd4, 0x6d, 0x1e, 0x0a, 0x77, 0xe2, 0xda, 0x96, 0xe0, 0xd1, 0x5e, 0x65, 0x7f, 0xed, 0xa0, - 0xd6, 0x7e, 0xa8, 0x3d, 0xef, 0x4c, 0xb9, 0x27, 0xba, 0xc9, 0x38, 0xcb, 0x80, 0xc9, 0x33, 0xa8, - 0x5b, 0xb6, 0xcd, 0x03, 0xc1, 0x1d, 0xe6, 0xcf, 0x39, 0xee, 0xa2, 0xad, 0xf6, 0x76, 0x6a, 0x9a, - 0x24, 0x9b, 0x65, 0x40, 0xf4, 0x13, 0xa8, 0xc8, 0x91, 0x13, 0x37, 0x12, 0xe4, 0xc7, 0x50, 0x96, - 0xfe, 0xc9, 0x09, 0x96, 0x66, 0x6b, 0x69, 0x49, 0x35, 0x42, 0xaf, 0x00, 0x24, 0xf4, 0xcc, 0x0a, - 0xad, 0x45, 0x94, 0xbb, 0x79, 0xe4, 0x74, 0xa5, 0x8f, 0x03, 0x4d, 0x49, 0x6c, 0x5c, 0xa7, 0x1a, - 0x0c, 0xbf, 0x25, 0xd6, 0x9f, 0x4c, 0x22, 0xae, 0x12, 0xba, 0xc1, 0x34, 0x45, 0x9a, 0xb0, 0x66, - 0x45, 0x36, 0x4e, 0x6a, 0x85, 0xc9, 0x4f, 0xfa, 0x25, 0xc0, 0x99, 0x35, 0xe5, 0xda, 0x6e, 0x22, - 0x57, 0xcc, 0xc8, 0x19, 0x1b, 0xa5, 0xc4, 0x06, 0xbd, 0x81, 0x2d, 0x5c, 0xee, 0x23, 0xdf, 0xb9, - 0x95, 0x2a, 0xf0, 0x0c, 0xc0, 0xca, 0x62, 0x36, 0x23, 0x12, 0x29, 0x9d, 0xa5, 0x5c, 0x9d, 0x69, - 0xbf, 0x1f, 0xc3, 0xfa, 0x85, 0xef, 0xdc, 0xa2, 0xd7, 0xc9, 0xe1, 0x13, 0x9b, 0x61, 0x38, 0x4a, - 0xff, 0x04, 0xdb, 0x29, 0xcb, 0xe8, 0x38, 0x85, 0xba, 0x9c, 0x24, 0x3f, 0xf4, 0x54, 0x51, 0x57, - 0x13, 0x97, 0xe1, 0x91, 0x8f, 0x60, 0x23, 0xb0, 0xa6, 0xb2, 0xd0, 0xaa, 0xbc, 0xdd, 0x31, 0xcb, - 0x10, 0xc7, 0xcf, 0x34, 0x80, 0xfe, 0x42, 0x5b, 0x38, 0xe6, 0x96, 0xa3, 0xd7, 0xf0, 0x31, 0x6c, - 0xa8, 0xfa, 0xaf, 0x17, 0xb1, 0x9e, 0x76, 0x8e, 0xe9, 0x31, 0xfa, 0x67, 0x68, 0x20, 0xe3, 0x15, - 0x17, 0x96, 0x63, 0x09, 0x2b, 0x77, 0x25, 0x9f, 0xc8, 0x95, 0x94, 0x8a, 0xb5, 0x23, 0x24, 0xad, - 0x4a, 0x99, 0x64, 0x1a, 0x21, 0x53, 0x5a, 0xdc, 0xa8, 0x4d, 0xaf, 0x36, 0x8f, 0x21, 0xe3, 0xf9, - 0x5b, 0xc7, 0x1d, 0xa2, 0xd6, 0xa4, 0x03, 0x3b, 0x19, 0xf3, 0xe8, 0xf9, 0xc7, 0x2b, 0x9e, 0xef, - 0xa6, 0xcd, 0x19, 0x64, 0x1c, 0x01, 0x87, 0x7a, 0xd7, 0x5f, 0x2c, 0x5c, 0xc1, 0x78, 0xb4, 0x9c, - 0xe7, 0xd7, 0xf1, 0x8f, 0xa0, 0xcc, 0xc3, 0xd0, 0x57, 0xfe, 0x6f, 0xb5, 0xef, 0x99, 0x13, 0x16, - 0xe5, 0x54, 0xab, 0xc3, 0x14, 0x42, 0xae, 0xbe, 0xc3, 0x85, 0xe5, 0xce, 0x75, 0x83, 0xa2, 0x29, - 0xda, 0x81, 0x66, 0xda, 0x0c, 0x3a, 0xfa, 0x09, 0x6c, 0x86, 0x48, 0x19, 0x4f, 0xb3, 0x8a, 0x15, - 0x92, 0x19, 0x0c, 0x1d, 0x41, 0xfd, 0x35, 0x0f, 0xdd, 0xc9, 0xad, 0xf6, 0xf4, 0x1d, 0x28, 0x89, - 0x1b, 0x5d, 0xc3, 0xaa, 0x5a, 0x72, 0x74, 0xc3, 0x4a, 0xe2, 0xe6, 0x4d, 0x0e, 0x2b, 0xf1, 0x8c, - 0xc3, 0x74, 0x24, 0xf7, 0x6d, 0x18, 0xf9, 0x9e, 0x35, 0x97, 0x35, 0x34, 0xb0, 0xa2, 0x28, 0x98, - 0x85, 0x56, 0x64, 0xca, 0x78, 0x8a, 0x43, 0x0e, 0x60, 0x53, 0x77, 0x89, 0x7a, 0x25, 0x4d, 0xaf, - 0xa1, 0x0b, 0x33, 0x33, 0xc3, 0xf4, 0x6f, 0x45, 0xa8, 0xf7, 0x17, 0xf2, 0x84, 0x7c, 0xee, 0x87, - 0x0b, 0x4b, 0xa6, 0xd3, 0xda, 0xb5, 0x3b, 0x59, 0xa9, 0xb8, 0xa9, 0x33, 0x86, 0xc9, 0x61, 0xb9, - 0xfa, 0xfe, 0xdc, 0x91, 0x16, 0xd1, 0x40, 0x95, 0x19, 0x52, 0x8e, 0x78, 0xfc, 0x1a, 0x47, 0xd4, - 0xc4, 0x1a, 0x92, 0x1c, 0x42, 0xe5, 0x92, 0xdf, 0x46, 0xc2, 0x0f, 0xb9, 0xde, 0x47, 0x79, 0xea, - 0x63, 0x0c, 0xfd, 0x1c, 0x36, 0x87, 0xba, 0xd9, 0x78, 0x00, 0x1b, 0xd6, 0x22, 0x75, 0xc0, 0x68, - 0x4a, 0xe6, 0xc0, 0xf5, 0x8c, 0x7b, 0xba, 0xf0, 0xe0, 0x37, 0xfd, 0x0d, 0xac, 0xbf, 0xf6, 0x05, - 0x36, 0x21, 0xb6, 0xe5, 0x39, 0xae, 0x23, 0xeb, 0xbb, 0x12, 0x4b, 0x18, 0x29, 0x8d, 0xa5, 0xb4, - 0x46, 0xda, 0x06, 0x90, 0xd2, 0x7a, 0xf7, 0x6e, 0xc5, 0xed, 0x5a, 0x15, 0xdb, 0xb3, 0x5d, 0x28, - 0x27, 0xb3, 0xda, 0x60, 0x8a, 0xa0, 0x0e, 0x6c, 0xeb, 0x79, 0x95, 0xa2, 0xd8, 0xe7, 0x1d, 0xc0, - 0xa6, 0x69, 0x9e, 0xb2, 0xcd, 0x9e, 0x8e, 0x88, 0x99, 0x61, 0xf2, 0x21, 0x6c, 0xa8, 0x6e, 0x06, - 0x3b, 0x8f, 0x5a, 0x5c, 0xbd, 0x8d, 0x2a, 0xa6, 0x87, 0x29, 0x83, 0x4a, 0xac, 0x7e, 0xd5, 0xaf, - 0x47, 0x00, 0x71, 0x68, 0xaa, 0x85, 0xa9, 0xb2, 0x14, 0x27, 0x15, 0xad, 0x4e, 0x76, 0x1d, 0xed, - 0x6f, 0x95, 0x4e, 0x73, 0x16, 0x5c, 0xf9, 0x52, 0x3c, 0x7b, 0x16, 0xc8, 0x71, 0xa6, 0x46, 0xb4, - 0xd9, 0x92, 0x31, 0x4b, 0x3b, 0xb0, 0x39, 0xf0, 0x1d, 0xce, 0xf8, 0xf7, 0x58, 0x0e, 0xdc, 0x05, - 0xf7, 0x97, 0x71, 0x0f, 0xa0, 0x49, 0xd5, 0x38, 0x2f, 0x02, 0xdf, 0xe3, 0xf1, 0x64, 0x27, 0x0c, - 0xfa, 0x19, 0xac, 0x0f, 0xac, 0x05, 0x97, 0x2b, 0x29, 0x3b, 0x44, 0x1d, 0x13, 0x7e, 0x4b, 0x9d, - 0x17, 0xea, 0xdc, 0xd6, 0x0b, 0x6c, 0x48, 0x6a, 0x43, 0x45, 0x4a, 0xe1, 0x5c, 0xbc, 0x9f, 0x92, - 0x4c, 0xdc, 0x96, 0xc3, 0x5a, 0xcd, 0x2e, 0x94, 0xfd, 0x6b, 0x4f, 0x17, 0xb5, 0x3a, 0x53, 0x04, - 0xd9, 0x87, 0x9a, 0xc3, 0x23, 0xe1, 0x7a, 0x96, 0x90, 0xc7, 0xb2, 0x6a, 0xbb, 0xd2, 0x2c, 0xda, - 0x83, 0x9a, 0x3c, 0x08, 0x23, 0x9d, 0x0b, 0x2d, 0xa8, 0x78, 0xfe, 0xb1, 0xea, 0x0b, 0x8a, 0xea, - 0x7c, 0x37, 0x34, 0x9e, 0xfd, 0x33, 0xff, 0x7a, 0xc8, 0xe7, 0x13, 0x7d, 0xa1, 0x88, 0x69, 0xfa, - 0x1e, 0x54, 0x5f, 0x72, 0x73, 0x1c, 0x34, 0x61, 0xed, 0x92, 0xdf, 0xe2, 0x14, 0x57, 0x99, 0xfc, - 0xa4, 0x7f, 0x29, 0x01, 0x0c, 0x79, 0x78, 0xc5, 0x43, 0x8c, 0xe6, 0x73, 0xd8, 0x88, 0x70, 0xdb, - 0xeb, 0x65, 0x78, 0xcf, 0xe4, 0x4d, 0x0c, 0x39, 0x54, 0x65, 0xa1, 0xe7, 0x89, 0xf0, 0x96, 0x69, - 0xb0, 0x14, 0xb3, 0x7d, 0x6f, 0xe2, 0x9a, 0x2c, 0xca, 0x11, 0xeb, 0xe2, 0xb8, 0x16, 0x53, 0xe0, - 0xd6, 0x2f, 0xa1, 0x96, 0xd2, 0x96, 0x78, 0x57, 0xd4, 0xde, 0x25, 0x2d, 0x60, 0x29, 0xd5, 0x2a, - 0xfe, 0xaa, 0xf4, 0x65, 0xb1, 0x75, 0x02, 0xb5, 0x94, 0xc6, 0x1c, 0xd1, 0x0f, 0xd3, 0xa2, 0xc9, - 0xa1, 0xa6, 0x84, 0xfa, 0x82, 0x2f, 0x52, 0xda, 0xe8, 0x0f, 0xb2, 0x29, 0x34, 0x03, 0xa4, 0x0d, - 0xe5, 0x20, 0xf4, 0x83, 0x48, 0x07, 0xf3, 0xee, 0x1d, 0xd1, 0xc3, 0x33, 0x39, 0xac, 0x62, 0x51, - 0xd0, 0x96, 0xec, 0x17, 0x62, 0xe6, 0xdb, 0x44, 0x42, 0x9f, 0x42, 0xb5, 0x77, 0xc5, 0x3d, 0x61, - 0x4e, 0x53, 0x2e, 0x89, 0xd5, 0xd3, 0x14, 0x11, 0x4c, 0x8f, 0xd1, 0x3e, 0x34, 0xba, 0x99, 0xfb, - 0x2c, 0x81, 0x75, 0x89, 0x33, 0xe9, 0x2b, 0xbf, 0x25, 0x0f, 0x2f, 0xac, 0xca, 0x20, 0x7e, 0x4b, - 0xbf, 0x2e, 0x02, 0x59, 0x19, 0x71, 0xfd, 0x2f, 0x82, 0x88, 0x7e, 0x08, 0xf7, 0x7a, 0x9e, 0xe0, - 0x61, 0x10, 0xba, 0x11, 0x57, 0x11, 0xbe, 0xe4, 0x39, 0x01, 0xd0, 0x13, 0x68, 0xae, 0x02, 0x73, - 0xc2, 0xdc, 0x82, 0x92, 0xef, 0xe9, 0x1c, 0x2c, 0xf9, 0x9e, 0xdc, 0xf9, 0x18, 0xa9, 0xb1, 0xa9, - 0xa9, 0x27, 0xff, 0x28, 0x9a, 0xe3, 0x54, 0xbf, 0x00, 0x54, 0xa1, 0x3c, 0x3a, 0x1f, 0x9f, 0xbe, - 0x6c, 0x16, 0xc8, 0x2e, 0x34, 0x47, 0xe7, 0xe3, 0xc1, 0xe9, 0xa0, 0xdb, 0x1b, 0x8f, 0x4e, 0x4f, - 0xc7, 0x27, 0xa7, 0x7f, 0x68, 0x16, 0xc9, 0x7d, 0xd8, 0x19, 0x9d, 0x8f, 0x3b, 0x27, 0xac, 0xd7, - 0xf9, 0xe6, 0xbb, 0x71, 0xef, 0xbc, 0x3f, 0x1c, 0x0d, 0x9b, 0x25, 0x72, 0x0f, 0xb6, 0x47, 0xe7, - 0xe3, 0xfe, 0xe0, 0x75, 0xe7, 0xa4, 0xff, 0xcd, 0xf8, 0xb8, 0x33, 0x3c, 0x6e, 0xae, 0xad, 0x30, - 0x87, 0xfd, 0x17, 0x83, 0xe6, 0xba, 0x56, 0x60, 0x98, 0xcf, 0x4f, 0xd9, 0xab, 0xce, 0xa8, 0x59, - 0x26, 0x3f, 0x82, 0x87, 0xc8, 0x1e, 0x7e, 0xfb, 0xfc, 0x79, 0xbf, 0xdb, 0xef, 0x0d, 0x46, 0xe3, - 0xa3, 0xce, 0x49, 0x67, 0xd0, 0xed, 0x35, 0x37, 0xb4, 0xcc, 0x71, 0x67, 0x38, 0x1e, 0x76, 0x5e, - 0xf5, 0x94, 0x4f, 0xcd, 0xcd, 0x58, 0xd5, 0xa8, 0xc7, 0x06, 0x9d, 0x93, 0x71, 0x8f, 0xb1, 0x53, - 0xd6, 0xac, 0x3e, 0x99, 0x98, 0x83, 0x57, 0xc7, 0xb4, 0x0b, 0xcd, 0xd7, 0x3d, 0xd6, 0x7f, 0xfe, - 0xdd, 0x78, 0x38, 0xea, 0x8c, 0xbe, 0x1d, 0xaa, 0xf0, 0xf6, 0xe1, 0xdd, 0x2c, 0x57, 0xfa, 0x37, - 0x1e, 0x9c, 0x8e, 0xc6, 0xaf, 0x3a, 0xa3, 0xee, 0x71, 0xb3, 0x48, 0x1e, 0x41, 0x2b, 0x8b, 0xc8, - 0x84, 0x57, 0x6a, 0xff, 0x9d, 0xc0, 0x76, 0x87, 0x87, 0x53, 0x9f, 0x9d, 0x75, 0xe5, 0x0e, 0x93, - 0xb7, 0xda, 0xa7, 0x50, 0x95, 0xb5, 0x70, 0x88, 0x37, 0x08, 0x53, 0xed, 0x75, 0x75, 0x6c, 0xe5, - 0x1c, 0x74, 0xb4, 0x40, 0x9e, 0xc2, 0xc6, 0x2b, 0x7c, 0xa5, 0x21, 0xe6, 0xa6, 0xa2, 0xc8, 0x88, - 0xf1, 0xef, 0x97, 0x3c, 0x12, 0xad, 0xad, 0x2c, 0x9b, 0x16, 0xc8, 0xe7, 0x00, 0xc9, 0xdb, 0x0d, - 0x89, 0x93, 0x53, 0xde, 0x05, 0x5b, 0x0f, 0xd3, 0xed, 0x53, 0xea, 0x71, 0x87, 0x16, 0xc8, 0xa7, - 0x50, 0x7f, 0xc1, 0x45, 0xf2, 0x0c, 0x91, 0x15, 0xbc, 0xf3, 0x96, 0x42, 0x0b, 0xe4, 0x50, 0xbf, - 0x5a, 0x48, 0x15, 0x2b, 0xf0, 0x9d, 0x34, 0x1c, 0x2f, 0xdd, 0xb4, 0x40, 0xbe, 0x86, 0xa6, 0xdc, - 0x3f, 0xa9, 0x4e, 0x31, 0x22, 0x06, 0x98, 0xdc, 0x1f, 0x5a, 0x0f, 0xee, 0x76, 0x94, 0x72, 0x94, - 0x16, 0xc8, 0x11, 0xec, 0xc4, 0x0a, 0xe2, 0x26, 0x35, 0x47, 0xc3, 0x5e, 0x5e, 0x93, 0xa8, 0x75, - 0x3c, 0x85, 0xed, 0x58, 0xc7, 0x50, 0x84, 0xdc, 0x5a, 0xac, 0xb8, 0x9e, 0xe9, 0x8d, 0x69, 0xe1, - 0xd3, 0x22, 0xe9, 0xc0, 0xc3, 0x3b, 0x66, 0x73, 0x45, 0x73, 0x9b, 0x53, 0x54, 0x71, 0x08, 0x95, - 0x17, 0x5c, 0x69, 0x20, 0x39, 0x0b, 0xbd, 0x6a, 0x94, 0x7c, 0x05, 0x4d, 0x83, 0x4f, 0xba, 0xf1, - 0x1c, 0xb9, 0x37, 0x58, 0x24, 0x5f, 0xe3, 0x62, 0xc6, 0x17, 0x0d, 0xf2, 0x60, 0xf5, 0x36, 0xa2, - 0x67, 0xea, 0xfe, 0x5d, 0xfe, 0x94, 0x3b, 0xb4, 0x40, 0x0e, 0xa0, 0xfc, 0x82, 0x8b, 0xd1, 0x79, - 0xae, 0xd5, 0xa4, 0x41, 0xa5, 0x05, 0xf2, 0x19, 0x80, 0x31, 0xf5, 0x06, 0x78, 0x33, 0x86, 0xf7, - 0x3d, 0x13, 0x60, 0x1b, 0xa5, 0x18, 0xb7, 0xb9, 0x1b, 0x88, 0x5c, 0x29, 0x93, 0xd8, 0x1a, 0x43, - 0x0b, 0xf2, 0xea, 0xf1, 0x82, 0x8b, 0xce, 0x51, 0x3f, 0x17, 0x0f, 0xa6, 0x7d, 0x3d, 0xea, 0x2b, - 0xec, 0x90, 0x7b, 0xce, 0xe8, 0x9c, 0x24, 0xce, 0xb6, 0xf2, 0x5a, 0x72, 0x2a, 0x37, 0xfb, 0xc6, - 0xd0, 0x9d, 0x7a, 0x59, 0x6c, 0x26, 0xc6, 0x8f, 0xa1, 0xa2, 0x8a, 0x46, 0xbe, 0xbe, 0x74, 0x27, - 0x8f, 0x33, 0x52, 0x51, 0x16, 0x46, 0xe7, 0xa4, 0x11, 0xa3, 0x65, 0x0a, 0xc5, 0xfb, 0x6f, 0xf5, - 0xfa, 0x80, 0xbb, 0x49, 0xa6, 0x88, 0xaa, 0x0d, 0xff, 0x2d, 0x45, 0x10, 0x41, 0x0b, 0xe4, 0x77, - 0x98, 0x22, 0x48, 0x75, 0x3c, 0xe7, 0x2c, 0xf4, 0xfd, 0x49, 0x5c, 0x23, 0xb2, 0x8f, 0x2f, 0xb1, - 0x9f, 0x9a, 0x8d, 0x58, 0x5c, 0x83, 0x46, 0x37, 0xe4, 0x52, 0x5e, 0x3f, 0xc5, 0x24, 0xaf, 0x02, - 0xea, 0x0e, 0xd1, 0x5a, 0xb9, 0x12, 0xe0, 0xf6, 0xa9, 0xc9, 0x35, 0x50, 0x74, 0xb4, 0x92, 0xff, - 0x24, 0x0b, 0xd7, 0x81, 0x7d, 0x0a, 0xb5, 0x13, 0xdf, 0xbe, 0x7c, 0x0b, 0x23, 0x6d, 0x68, 0x7c, - 0xeb, 0xcd, 0xdf, 0x4e, 0xe6, 0x0b, 0x68, 0xa8, 0x3b, 0x8a, 0x91, 0x31, 0x41, 0xa7, 0x6f, 0x2e, - 0xf9, 0x72, 0xbd, 0x9b, 0xb4, 0xdc, 0x1d, 0x5b, 0xf9, 0x85, 0xf9, 0x2b, 0xb8, 0x9f, 0x91, 0x7b, - 0xa9, 0xaf, 0x24, 0xff, 0xab, 0xfc, 0x33, 0x68, 0xfc, 0x7e, 0xc9, 0xc3, 0xdb, 0xae, 0xef, 0x89, - 0xd0, 0xb2, 0x93, 0x02, 0x8a, 0xdc, 0x37, 0x08, 0x75, 0x80, 0x64, 0x84, 0x54, 0xb6, 0xec, 0xa4, - 0x33, 0x43, 0x89, 0x3f, 0xb8, 0xc3, 0x32, 0x8b, 0xfe, 0x14, 0xd3, 0x0c, 0x9b, 0x56, 0x92, 0x7e, - 0x2c, 0xd3, 0x2d, 0x6c, 0x2b, 0xfd, 0x32, 0x14, 0x2f, 0xa0, 0x14, 0x79, 0x8d, 0xed, 0xfd, 0x4e, - 0xaa, 0xe5, 0x5f, 0x91, 0x30, 0xb7, 0x04, 0x2c, 0xd4, 0xdb, 0x49, 0x96, 0x28, 0xc1, 0xd5, 0xd4, - 0x54, 0x4f, 0x72, 0xb1, 0xa3, 0x2b, 0x97, 0x23, 0x75, 0x8c, 0xa9, 0xfc, 0xc6, 0x2b, 0xd0, 0x1b, - 0xc4, 0x57, 0xae, 0x4c, 0xb4, 0x40, 0x3e, 0xc1, 0x04, 0x8d, 0x3b, 0xff, 0x74, 0xaf, 0x1f, 0x7b, - 0x6a, 0x46, 0x71, 0xf9, 0xf1, 0x38, 0xc0, 0xd6, 0x4d, 0xd7, 0x74, 0x13, 0xe2, 0x73, 0x77, 0x2e, - 0x54, 0x5f, 0xdc, 0xca, 0x74, 0x78, 0x58, 0xd0, 0x9f, 0xa9, 0x27, 0x2f, 0x64, 0x44, 0x79, 0x22, - 0xcd, 0xb4, 0x88, 0x9e, 0x96, 0x2f, 0xa0, 0x21, 0x43, 0x4a, 0x3a, 0x79, 0x03, 0x8a, 0x9b, 0xff, - 0xf8, 0xe0, 0x4c, 0x40, 0xb4, 0x40, 0xbe, 0xc4, 0xad, 0x9e, 0xed, 0x26, 0xf3, 0x4f, 0x9e, 0x0c, - 0x86, 0x16, 0xc8, 0x09, 0xdc, 0x7b, 0xc1, 0xc5, 0x9d, 0x9e, 0xb0, 0x65, 0x84, 0xef, 0x76, 0x95, - 0x71, 0x89, 0x5a, 0x1d, 0xa3, 0x05, 0x72, 0x0c, 0xf7, 0x95, 0x1f, 0x93, 0xee, 0xcc, 0xf2, 0xa6, - 0xfc, 0x2c, 0xf4, 0xa7, 0xf8, 0xb0, 0x9a, 0x57, 0xaf, 0xde, 0x49, 0x75, 0xe4, 0x59, 0x38, 0x2d, - 0x5c, 0x6c, 0xe0, 0x7f, 0xa6, 0x67, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x7d, 0x4d, 0x37, - 0xcd, 0x1a, 0x00, 0x00, + GoTypes: file_rpc_proto_goTypes, + DependencyIndexes: file_rpc_proto_depIdxs, + EnumInfos: file_rpc_proto_enumTypes, + MessageInfos: file_rpc_proto_msgTypes, + }.Build() + File_rpc_proto = out.File + file_rpc_proto_rawDesc = nil + file_rpc_proto_goTypes = nil + file_rpc_proto_depIdxs = nil } diff --git a/types/rpc_grpc.pb.go b/types/rpc_grpc.pb.go new file mode 100644 index 000000000..bf583d44a --- /dev/null +++ b/types/rpc_grpc.pb.go @@ -0,0 +1,1792 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.15.8 +// source: rpc.proto + +package types + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AergoRPCService_NodeState_FullMethodName = "/types.AergoRPCService/NodeState" + AergoRPCService_Metric_FullMethodName = "/types.AergoRPCService/Metric" + AergoRPCService_Blockchain_FullMethodName = "/types.AergoRPCService/Blockchain" + AergoRPCService_GetChainInfo_FullMethodName = "/types.AergoRPCService/GetChainInfo" + AergoRPCService_ChainStat_FullMethodName = "/types.AergoRPCService/ChainStat" + AergoRPCService_ListBlockHeaders_FullMethodName = "/types.AergoRPCService/ListBlockHeaders" + AergoRPCService_ListBlockMetadata_FullMethodName = "/types.AergoRPCService/ListBlockMetadata" + AergoRPCService_ListBlockStream_FullMethodName = "/types.AergoRPCService/ListBlockStream" + AergoRPCService_ListBlockMetadataStream_FullMethodName = "/types.AergoRPCService/ListBlockMetadataStream" + AergoRPCService_GetBlock_FullMethodName = "/types.AergoRPCService/GetBlock" + AergoRPCService_GetBlockMetadata_FullMethodName = "/types.AergoRPCService/GetBlockMetadata" + AergoRPCService_GetBlockBody_FullMethodName = "/types.AergoRPCService/GetBlockBody" + AergoRPCService_GetTX_FullMethodName = "/types.AergoRPCService/GetTX" + AergoRPCService_GetBlockTX_FullMethodName = "/types.AergoRPCService/GetBlockTX" + AergoRPCService_GetReceipt_FullMethodName = "/types.AergoRPCService/GetReceipt" + AergoRPCService_GetABI_FullMethodName = "/types.AergoRPCService/GetABI" + AergoRPCService_SendTX_FullMethodName = "/types.AergoRPCService/SendTX" + AergoRPCService_SignTX_FullMethodName = "/types.AergoRPCService/SignTX" + AergoRPCService_VerifyTX_FullMethodName = "/types.AergoRPCService/VerifyTX" + AergoRPCService_CommitTX_FullMethodName = "/types.AergoRPCService/CommitTX" + AergoRPCService_GetState_FullMethodName = "/types.AergoRPCService/GetState" + AergoRPCService_GetStateAndProof_FullMethodName = "/types.AergoRPCService/GetStateAndProof" + AergoRPCService_CreateAccount_FullMethodName = "/types.AergoRPCService/CreateAccount" + AergoRPCService_GetAccounts_FullMethodName = "/types.AergoRPCService/GetAccounts" + AergoRPCService_LockAccount_FullMethodName = "/types.AergoRPCService/LockAccount" + AergoRPCService_UnlockAccount_FullMethodName = "/types.AergoRPCService/UnlockAccount" + AergoRPCService_ImportAccount_FullMethodName = "/types.AergoRPCService/ImportAccount" + AergoRPCService_ExportAccount_FullMethodName = "/types.AergoRPCService/ExportAccount" + AergoRPCService_ExportAccountKeystore_FullMethodName = "/types.AergoRPCService/ExportAccountKeystore" + AergoRPCService_QueryContract_FullMethodName = "/types.AergoRPCService/QueryContract" + AergoRPCService_QueryContractState_FullMethodName = "/types.AergoRPCService/QueryContractState" + AergoRPCService_GetPeers_FullMethodName = "/types.AergoRPCService/GetPeers" + AergoRPCService_GetVotes_FullMethodName = "/types.AergoRPCService/GetVotes" + AergoRPCService_GetAccountVotes_FullMethodName = "/types.AergoRPCService/GetAccountVotes" + AergoRPCService_GetStaking_FullMethodName = "/types.AergoRPCService/GetStaking" + AergoRPCService_GetNameInfo_FullMethodName = "/types.AergoRPCService/GetNameInfo" + AergoRPCService_ListEventStream_FullMethodName = "/types.AergoRPCService/ListEventStream" + AergoRPCService_ListEvents_FullMethodName = "/types.AergoRPCService/ListEvents" + AergoRPCService_GetServerInfo_FullMethodName = "/types.AergoRPCService/GetServerInfo" + AergoRPCService_GetConsensusInfo_FullMethodName = "/types.AergoRPCService/GetConsensusInfo" + AergoRPCService_GetEnterpriseConfig_FullMethodName = "/types.AergoRPCService/GetEnterpriseConfig" + AergoRPCService_GetConfChangeProgress_FullMethodName = "/types.AergoRPCService/GetConfChangeProgress" +) + +// AergoRPCServiceClient is the client API for AergoRPCService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AergoRPCServiceClient interface { + // Returns the current state of this node + NodeState(ctx context.Context, in *NodeReq, opts ...grpc.CallOption) (*SingleBytes, error) + // Returns node metrics according to request + Metric(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*Metrics, error) + // Returns current blockchain status (best block's height and hash) + Blockchain(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BlockchainStatus, error) + // Returns current blockchain's basic information + GetChainInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ChainInfo, error) + // Returns current chain statistics + ChainStat(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ChainStats, error) + // Returns list of Blocks without body according to request + ListBlockHeaders(ctx context.Context, in *ListParams, opts ...grpc.CallOption) (*BlockHeaderList, error) + // Returns list of block metadata (hash, header, and number of transactions) according to request + ListBlockMetadata(ctx context.Context, in *ListParams, opts ...grpc.CallOption) (*BlockMetadataList, error) + // Returns a stream of new blocks as they get added to the blockchain + ListBlockStream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (AergoRPCService_ListBlockStreamClient, error) + // Returns a stream of new block's metadata as they get added to the blockchain + ListBlockMetadataStream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (AergoRPCService_ListBlockMetadataStreamClient, error) + // Return a single block incl. header and body, queried by hash or number + GetBlock(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Block, error) + // Return a single block's metdata (hash, header, and number of transactions), queried by hash or number + GetBlockMetadata(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*BlockMetadata, error) + // Return a single block's body, queried by hash or number and list parameters + GetBlockBody(ctx context.Context, in *BlockBodyParams, opts ...grpc.CallOption) (*BlockBodyPaged, error) + // Return a single transaction, queried by transaction hash + GetTX(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Tx, error) + // Return information about transaction in block, queried by transaction hash + GetBlockTX(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*TxInBlock, error) + // Return transaction receipt, queried by transaction hash + GetReceipt(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Receipt, error) + // Return ABI stored at contract address + GetABI(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*ABI, error) + // Sign and send a transaction from an unlocked account + SendTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*CommitResult, error) + // Sign transaction with unlocked account + SignTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*Tx, error) + // Verify validity of transaction + VerifyTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*VerifyResult, error) + // Commit a signed transaction + CommitTX(ctx context.Context, in *TxList, opts ...grpc.CallOption) (*CommitResultList, error) + // Return state of account + GetState(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*State, error) + // Return state of account, including merkle proof + GetStateAndProof(ctx context.Context, in *AccountAndRoot, opts ...grpc.CallOption) (*AccountProof, error) + // Create a new account in this node + CreateAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) + // Return list of accounts in this node + GetAccounts(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*AccountList, error) + // Lock account in this node + LockAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) + // Unlock account in this node + UnlockAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) + // Import account to this node + ImportAccount(ctx context.Context, in *ImportFormat, opts ...grpc.CallOption) (*Account, error) + // Export account stored in this node as wif format + ExportAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*SingleBytes, error) + // Export account stored in this node as keystore format + ExportAccountKeystore(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*SingleBytes, error) + // Query a contract method + QueryContract(ctx context.Context, in *Query, opts ...grpc.CallOption) (*SingleBytes, error) + // Query contract state + QueryContractState(ctx context.Context, in *StateQuery, opts ...grpc.CallOption) (*StateQueryProof, error) + // Return list of peers of this node and their state + GetPeers(ctx context.Context, in *PeersParams, opts ...grpc.CallOption) (*PeerList, error) + // Return result of vote + GetVotes(ctx context.Context, in *VoteParams, opts ...grpc.CallOption) (*VoteList, error) + // Return staking, voting info for account + GetAccountVotes(ctx context.Context, in *AccountAddress, opts ...grpc.CallOption) (*AccountVoteInfo, error) + // Return staking information + GetStaking(ctx context.Context, in *AccountAddress, opts ...grpc.CallOption) (*Staking, error) + // Return name information + GetNameInfo(ctx context.Context, in *Name, opts ...grpc.CallOption) (*NameInfo, error) + // Returns a stream of event as they get added to the blockchain + ListEventStream(ctx context.Context, in *FilterInfo, opts ...grpc.CallOption) (AergoRPCService_ListEventStreamClient, error) + // Returns list of event + ListEvents(ctx context.Context, in *FilterInfo, opts ...grpc.CallOption) (*EventList, error) + // Returns configs and statuses of server + GetServerInfo(ctx context.Context, in *KeyParams, opts ...grpc.CallOption) (*ServerInfo, error) + // Returns status of consensus and bps + GetConsensusInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ConsensusInfo, error) + // Returns enterprise config + GetEnterpriseConfig(ctx context.Context, in *EnterpriseConfigKey, opts ...grpc.CallOption) (*EnterpriseConfig, error) + // Return a status of changeCluster enterprise tx, queried by requestID + GetConfChangeProgress(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*ConfChangeProgress, error) +} + +type aergoRPCServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAergoRPCServiceClient(cc grpc.ClientConnInterface) AergoRPCServiceClient { + return &aergoRPCServiceClient{cc} +} + +func (c *aergoRPCServiceClient) NodeState(ctx context.Context, in *NodeReq, opts ...grpc.CallOption) (*SingleBytes, error) { + out := new(SingleBytes) + err := c.cc.Invoke(ctx, AergoRPCService_NodeState_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) Metric(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*Metrics, error) { + out := new(Metrics) + err := c.cc.Invoke(ctx, AergoRPCService_Metric_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) Blockchain(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BlockchainStatus, error) { + out := new(BlockchainStatus) + err := c.cc.Invoke(ctx, AergoRPCService_Blockchain_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetChainInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ChainInfo, error) { + out := new(ChainInfo) + err := c.cc.Invoke(ctx, AergoRPCService_GetChainInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) ChainStat(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ChainStats, error) { + out := new(ChainStats) + err := c.cc.Invoke(ctx, AergoRPCService_ChainStat_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) ListBlockHeaders(ctx context.Context, in *ListParams, opts ...grpc.CallOption) (*BlockHeaderList, error) { + out := new(BlockHeaderList) + err := c.cc.Invoke(ctx, AergoRPCService_ListBlockHeaders_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) ListBlockMetadata(ctx context.Context, in *ListParams, opts ...grpc.CallOption) (*BlockMetadataList, error) { + out := new(BlockMetadataList) + err := c.cc.Invoke(ctx, AergoRPCService_ListBlockMetadata_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) ListBlockStream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (AergoRPCService_ListBlockStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &AergoRPCService_ServiceDesc.Streams[0], AergoRPCService_ListBlockStream_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &aergoRPCServiceListBlockStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type AergoRPCService_ListBlockStreamClient interface { + Recv() (*Block, error) + grpc.ClientStream +} + +type aergoRPCServiceListBlockStreamClient struct { + grpc.ClientStream +} + +func (x *aergoRPCServiceListBlockStreamClient) Recv() (*Block, error) { + m := new(Block) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *aergoRPCServiceClient) ListBlockMetadataStream(ctx context.Context, in *Empty, opts ...grpc.CallOption) (AergoRPCService_ListBlockMetadataStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &AergoRPCService_ServiceDesc.Streams[1], AergoRPCService_ListBlockMetadataStream_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &aergoRPCServiceListBlockMetadataStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type AergoRPCService_ListBlockMetadataStreamClient interface { + Recv() (*BlockMetadata, error) + grpc.ClientStream +} + +type aergoRPCServiceListBlockMetadataStreamClient struct { + grpc.ClientStream +} + +func (x *aergoRPCServiceListBlockMetadataStreamClient) Recv() (*BlockMetadata, error) { + m := new(BlockMetadata) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *aergoRPCServiceClient) GetBlock(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Block, error) { + out := new(Block) + err := c.cc.Invoke(ctx, AergoRPCService_GetBlock_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetBlockMetadata(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*BlockMetadata, error) { + out := new(BlockMetadata) + err := c.cc.Invoke(ctx, AergoRPCService_GetBlockMetadata_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetBlockBody(ctx context.Context, in *BlockBodyParams, opts ...grpc.CallOption) (*BlockBodyPaged, error) { + out := new(BlockBodyPaged) + err := c.cc.Invoke(ctx, AergoRPCService_GetBlockBody_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetTX(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Tx, error) { + out := new(Tx) + err := c.cc.Invoke(ctx, AergoRPCService_GetTX_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetBlockTX(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*TxInBlock, error) { + out := new(TxInBlock) + err := c.cc.Invoke(ctx, AergoRPCService_GetBlockTX_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetReceipt(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*Receipt, error) { + out := new(Receipt) + err := c.cc.Invoke(ctx, AergoRPCService_GetReceipt_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetABI(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*ABI, error) { + out := new(ABI) + err := c.cc.Invoke(ctx, AergoRPCService_GetABI_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) SendTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*CommitResult, error) { + out := new(CommitResult) + err := c.cc.Invoke(ctx, AergoRPCService_SendTX_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) SignTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*Tx, error) { + out := new(Tx) + err := c.cc.Invoke(ctx, AergoRPCService_SignTX_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) VerifyTX(ctx context.Context, in *Tx, opts ...grpc.CallOption) (*VerifyResult, error) { + out := new(VerifyResult) + err := c.cc.Invoke(ctx, AergoRPCService_VerifyTX_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) CommitTX(ctx context.Context, in *TxList, opts ...grpc.CallOption) (*CommitResultList, error) { + out := new(CommitResultList) + err := c.cc.Invoke(ctx, AergoRPCService_CommitTX_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetState(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*State, error) { + out := new(State) + err := c.cc.Invoke(ctx, AergoRPCService_GetState_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetStateAndProof(ctx context.Context, in *AccountAndRoot, opts ...grpc.CallOption) (*AccountProof, error) { + out := new(AccountProof) + err := c.cc.Invoke(ctx, AergoRPCService_GetStateAndProof_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) CreateAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) { + out := new(Account) + err := c.cc.Invoke(ctx, AergoRPCService_CreateAccount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetAccounts(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*AccountList, error) { + out := new(AccountList) + err := c.cc.Invoke(ctx, AergoRPCService_GetAccounts_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) LockAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) { + out := new(Account) + err := c.cc.Invoke(ctx, AergoRPCService_LockAccount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) UnlockAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*Account, error) { + out := new(Account) + err := c.cc.Invoke(ctx, AergoRPCService_UnlockAccount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) ImportAccount(ctx context.Context, in *ImportFormat, opts ...grpc.CallOption) (*Account, error) { + out := new(Account) + err := c.cc.Invoke(ctx, AergoRPCService_ImportAccount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) ExportAccount(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*SingleBytes, error) { + out := new(SingleBytes) + err := c.cc.Invoke(ctx, AergoRPCService_ExportAccount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) ExportAccountKeystore(ctx context.Context, in *Personal, opts ...grpc.CallOption) (*SingleBytes, error) { + out := new(SingleBytes) + err := c.cc.Invoke(ctx, AergoRPCService_ExportAccountKeystore_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) QueryContract(ctx context.Context, in *Query, opts ...grpc.CallOption) (*SingleBytes, error) { + out := new(SingleBytes) + err := c.cc.Invoke(ctx, AergoRPCService_QueryContract_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) QueryContractState(ctx context.Context, in *StateQuery, opts ...grpc.CallOption) (*StateQueryProof, error) { + out := new(StateQueryProof) + err := c.cc.Invoke(ctx, AergoRPCService_QueryContractState_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetPeers(ctx context.Context, in *PeersParams, opts ...grpc.CallOption) (*PeerList, error) { + out := new(PeerList) + err := c.cc.Invoke(ctx, AergoRPCService_GetPeers_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetVotes(ctx context.Context, in *VoteParams, opts ...grpc.CallOption) (*VoteList, error) { + out := new(VoteList) + err := c.cc.Invoke(ctx, AergoRPCService_GetVotes_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetAccountVotes(ctx context.Context, in *AccountAddress, opts ...grpc.CallOption) (*AccountVoteInfo, error) { + out := new(AccountVoteInfo) + err := c.cc.Invoke(ctx, AergoRPCService_GetAccountVotes_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetStaking(ctx context.Context, in *AccountAddress, opts ...grpc.CallOption) (*Staking, error) { + out := new(Staking) + err := c.cc.Invoke(ctx, AergoRPCService_GetStaking_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetNameInfo(ctx context.Context, in *Name, opts ...grpc.CallOption) (*NameInfo, error) { + out := new(NameInfo) + err := c.cc.Invoke(ctx, AergoRPCService_GetNameInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) ListEventStream(ctx context.Context, in *FilterInfo, opts ...grpc.CallOption) (AergoRPCService_ListEventStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &AergoRPCService_ServiceDesc.Streams[2], AergoRPCService_ListEventStream_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &aergoRPCServiceListEventStreamClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type AergoRPCService_ListEventStreamClient interface { + Recv() (*Event, error) + grpc.ClientStream +} + +type aergoRPCServiceListEventStreamClient struct { + grpc.ClientStream +} + +func (x *aergoRPCServiceListEventStreamClient) Recv() (*Event, error) { + m := new(Event) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *aergoRPCServiceClient) ListEvents(ctx context.Context, in *FilterInfo, opts ...grpc.CallOption) (*EventList, error) { + out := new(EventList) + err := c.cc.Invoke(ctx, AergoRPCService_ListEvents_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetServerInfo(ctx context.Context, in *KeyParams, opts ...grpc.CallOption) (*ServerInfo, error) { + out := new(ServerInfo) + err := c.cc.Invoke(ctx, AergoRPCService_GetServerInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetConsensusInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ConsensusInfo, error) { + out := new(ConsensusInfo) + err := c.cc.Invoke(ctx, AergoRPCService_GetConsensusInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetEnterpriseConfig(ctx context.Context, in *EnterpriseConfigKey, opts ...grpc.CallOption) (*EnterpriseConfig, error) { + out := new(EnterpriseConfig) + err := c.cc.Invoke(ctx, AergoRPCService_GetEnterpriseConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *aergoRPCServiceClient) GetConfChangeProgress(ctx context.Context, in *SingleBytes, opts ...grpc.CallOption) (*ConfChangeProgress, error) { + out := new(ConfChangeProgress) + err := c.cc.Invoke(ctx, AergoRPCService_GetConfChangeProgress_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AergoRPCServiceServer is the server API for AergoRPCService service. +// All implementations must embed UnimplementedAergoRPCServiceServer +// for forward compatibility +type AergoRPCServiceServer interface { + // Returns the current state of this node + NodeState(context.Context, *NodeReq) (*SingleBytes, error) + // Returns node metrics according to request + Metric(context.Context, *MetricsRequest) (*Metrics, error) + // Returns current blockchain status (best block's height and hash) + Blockchain(context.Context, *Empty) (*BlockchainStatus, error) + // Returns current blockchain's basic information + GetChainInfo(context.Context, *Empty) (*ChainInfo, error) + // Returns current chain statistics + ChainStat(context.Context, *Empty) (*ChainStats, error) + // Returns list of Blocks without body according to request + ListBlockHeaders(context.Context, *ListParams) (*BlockHeaderList, error) + // Returns list of block metadata (hash, header, and number of transactions) according to request + ListBlockMetadata(context.Context, *ListParams) (*BlockMetadataList, error) + // Returns a stream of new blocks as they get added to the blockchain + ListBlockStream(*Empty, AergoRPCService_ListBlockStreamServer) error + // Returns a stream of new block's metadata as they get added to the blockchain + ListBlockMetadataStream(*Empty, AergoRPCService_ListBlockMetadataStreamServer) error + // Return a single block incl. header and body, queried by hash or number + GetBlock(context.Context, *SingleBytes) (*Block, error) + // Return a single block's metdata (hash, header, and number of transactions), queried by hash or number + GetBlockMetadata(context.Context, *SingleBytes) (*BlockMetadata, error) + // Return a single block's body, queried by hash or number and list parameters + GetBlockBody(context.Context, *BlockBodyParams) (*BlockBodyPaged, error) + // Return a single transaction, queried by transaction hash + GetTX(context.Context, *SingleBytes) (*Tx, error) + // Return information about transaction in block, queried by transaction hash + GetBlockTX(context.Context, *SingleBytes) (*TxInBlock, error) + // Return transaction receipt, queried by transaction hash + GetReceipt(context.Context, *SingleBytes) (*Receipt, error) + // Return ABI stored at contract address + GetABI(context.Context, *SingleBytes) (*ABI, error) + // Sign and send a transaction from an unlocked account + SendTX(context.Context, *Tx) (*CommitResult, error) + // Sign transaction with unlocked account + SignTX(context.Context, *Tx) (*Tx, error) + // Verify validity of transaction + VerifyTX(context.Context, *Tx) (*VerifyResult, error) + // Commit a signed transaction + CommitTX(context.Context, *TxList) (*CommitResultList, error) + // Return state of account + GetState(context.Context, *SingleBytes) (*State, error) + // Return state of account, including merkle proof + GetStateAndProof(context.Context, *AccountAndRoot) (*AccountProof, error) + // Create a new account in this node + CreateAccount(context.Context, *Personal) (*Account, error) + // Return list of accounts in this node + GetAccounts(context.Context, *Empty) (*AccountList, error) + // Lock account in this node + LockAccount(context.Context, *Personal) (*Account, error) + // Unlock account in this node + UnlockAccount(context.Context, *Personal) (*Account, error) + // Import account to this node + ImportAccount(context.Context, *ImportFormat) (*Account, error) + // Export account stored in this node as wif format + ExportAccount(context.Context, *Personal) (*SingleBytes, error) + // Export account stored in this node as keystore format + ExportAccountKeystore(context.Context, *Personal) (*SingleBytes, error) + // Query a contract method + QueryContract(context.Context, *Query) (*SingleBytes, error) + // Query contract state + QueryContractState(context.Context, *StateQuery) (*StateQueryProof, error) + // Return list of peers of this node and their state + GetPeers(context.Context, *PeersParams) (*PeerList, error) + // Return result of vote + GetVotes(context.Context, *VoteParams) (*VoteList, error) + // Return staking, voting info for account + GetAccountVotes(context.Context, *AccountAddress) (*AccountVoteInfo, error) + // Return staking information + GetStaking(context.Context, *AccountAddress) (*Staking, error) + // Return name information + GetNameInfo(context.Context, *Name) (*NameInfo, error) + // Returns a stream of event as they get added to the blockchain + ListEventStream(*FilterInfo, AergoRPCService_ListEventStreamServer) error + // Returns list of event + ListEvents(context.Context, *FilterInfo) (*EventList, error) + // Returns configs and statuses of server + GetServerInfo(context.Context, *KeyParams) (*ServerInfo, error) + // Returns status of consensus and bps + GetConsensusInfo(context.Context, *Empty) (*ConsensusInfo, error) + // Returns enterprise config + GetEnterpriseConfig(context.Context, *EnterpriseConfigKey) (*EnterpriseConfig, error) + // Return a status of changeCluster enterprise tx, queried by requestID + GetConfChangeProgress(context.Context, *SingleBytes) (*ConfChangeProgress, error) + mustEmbedUnimplementedAergoRPCServiceServer() +} + +// UnimplementedAergoRPCServiceServer must be embedded to have forward compatible implementations. +type UnimplementedAergoRPCServiceServer struct { +} + +func (UnimplementedAergoRPCServiceServer) NodeState(context.Context, *NodeReq) (*SingleBytes, error) { + return nil, status.Errorf(codes.Unimplemented, "method NodeState not implemented") +} +func (UnimplementedAergoRPCServiceServer) Metric(context.Context, *MetricsRequest) (*Metrics, error) { + return nil, status.Errorf(codes.Unimplemented, "method Metric not implemented") +} +func (UnimplementedAergoRPCServiceServer) Blockchain(context.Context, *Empty) (*BlockchainStatus, error) { + return nil, status.Errorf(codes.Unimplemented, "method Blockchain not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetChainInfo(context.Context, *Empty) (*ChainInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChainInfo not implemented") +} +func (UnimplementedAergoRPCServiceServer) ChainStat(context.Context, *Empty) (*ChainStats, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChainStat not implemented") +} +func (UnimplementedAergoRPCServiceServer) ListBlockHeaders(context.Context, *ListParams) (*BlockHeaderList, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBlockHeaders not implemented") +} +func (UnimplementedAergoRPCServiceServer) ListBlockMetadata(context.Context, *ListParams) (*BlockMetadataList, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBlockMetadata not implemented") +} +func (UnimplementedAergoRPCServiceServer) ListBlockStream(*Empty, AergoRPCService_ListBlockStreamServer) error { + return status.Errorf(codes.Unimplemented, "method ListBlockStream not implemented") +} +func (UnimplementedAergoRPCServiceServer) ListBlockMetadataStream(*Empty, AergoRPCService_ListBlockMetadataStreamServer) error { + return status.Errorf(codes.Unimplemented, "method ListBlockMetadataStream not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetBlock(context.Context, *SingleBytes) (*Block, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlock not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetBlockMetadata(context.Context, *SingleBytes) (*BlockMetadata, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlockMetadata not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetBlockBody(context.Context, *BlockBodyParams) (*BlockBodyPaged, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlockBody not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetTX(context.Context, *SingleBytes) (*Tx, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTX not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetBlockTX(context.Context, *SingleBytes) (*TxInBlock, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlockTX not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetReceipt(context.Context, *SingleBytes) (*Receipt, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetReceipt not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetABI(context.Context, *SingleBytes) (*ABI, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetABI not implemented") +} +func (UnimplementedAergoRPCServiceServer) SendTX(context.Context, *Tx) (*CommitResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendTX not implemented") +} +func (UnimplementedAergoRPCServiceServer) SignTX(context.Context, *Tx) (*Tx, error) { + return nil, status.Errorf(codes.Unimplemented, "method SignTX not implemented") +} +func (UnimplementedAergoRPCServiceServer) VerifyTX(context.Context, *Tx) (*VerifyResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyTX not implemented") +} +func (UnimplementedAergoRPCServiceServer) CommitTX(context.Context, *TxList) (*CommitResultList, error) { + return nil, status.Errorf(codes.Unimplemented, "method CommitTX not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetState(context.Context, *SingleBytes) (*State, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetState not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetStateAndProof(context.Context, *AccountAndRoot) (*AccountProof, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetStateAndProof not implemented") +} +func (UnimplementedAergoRPCServiceServer) CreateAccount(context.Context, *Personal) (*Account, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateAccount not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetAccounts(context.Context, *Empty) (*AccountList, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAccounts not implemented") +} +func (UnimplementedAergoRPCServiceServer) LockAccount(context.Context, *Personal) (*Account, error) { + return nil, status.Errorf(codes.Unimplemented, "method LockAccount not implemented") +} +func (UnimplementedAergoRPCServiceServer) UnlockAccount(context.Context, *Personal) (*Account, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnlockAccount not implemented") +} +func (UnimplementedAergoRPCServiceServer) ImportAccount(context.Context, *ImportFormat) (*Account, error) { + return nil, status.Errorf(codes.Unimplemented, "method ImportAccount not implemented") +} +func (UnimplementedAergoRPCServiceServer) ExportAccount(context.Context, *Personal) (*SingleBytes, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExportAccount not implemented") +} +func (UnimplementedAergoRPCServiceServer) ExportAccountKeystore(context.Context, *Personal) (*SingleBytes, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExportAccountKeystore not implemented") +} +func (UnimplementedAergoRPCServiceServer) QueryContract(context.Context, *Query) (*SingleBytes, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryContract not implemented") +} +func (UnimplementedAergoRPCServiceServer) QueryContractState(context.Context, *StateQuery) (*StateQueryProof, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryContractState not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetPeers(context.Context, *PeersParams) (*PeerList, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPeers not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetVotes(context.Context, *VoteParams) (*VoteList, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetVotes not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetAccountVotes(context.Context, *AccountAddress) (*AccountVoteInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAccountVotes not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetStaking(context.Context, *AccountAddress) (*Staking, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetStaking not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetNameInfo(context.Context, *Name) (*NameInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNameInfo not implemented") +} +func (UnimplementedAergoRPCServiceServer) ListEventStream(*FilterInfo, AergoRPCService_ListEventStreamServer) error { + return status.Errorf(codes.Unimplemented, "method ListEventStream not implemented") +} +func (UnimplementedAergoRPCServiceServer) ListEvents(context.Context, *FilterInfo) (*EventList, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEvents not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetServerInfo(context.Context, *KeyParams) (*ServerInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetServerInfo not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetConsensusInfo(context.Context, *Empty) (*ConsensusInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConsensusInfo not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetEnterpriseConfig(context.Context, *EnterpriseConfigKey) (*EnterpriseConfig, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEnterpriseConfig not implemented") +} +func (UnimplementedAergoRPCServiceServer) GetConfChangeProgress(context.Context, *SingleBytes) (*ConfChangeProgress, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConfChangeProgress not implemented") +} +func (UnimplementedAergoRPCServiceServer) mustEmbedUnimplementedAergoRPCServiceServer() {} + +// UnsafeAergoRPCServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AergoRPCServiceServer will +// result in compilation errors. +type UnsafeAergoRPCServiceServer interface { + mustEmbedUnimplementedAergoRPCServiceServer() +} + +func RegisterAergoRPCServiceServer(s grpc.ServiceRegistrar, srv AergoRPCServiceServer) { + s.RegisterService(&AergoRPCService_ServiceDesc, srv) +} + +func _AergoRPCService_NodeState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NodeReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).NodeState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_NodeState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).NodeState(ctx, req.(*NodeReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_Metric_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MetricsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).Metric(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_Metric_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).Metric(ctx, req.(*MetricsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_Blockchain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).Blockchain(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_Blockchain_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).Blockchain(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetChainInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetChainInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetChainInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetChainInfo(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_ChainStat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).ChainStat(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_ChainStat_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).ChainStat(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_ListBlockHeaders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).ListBlockHeaders(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_ListBlockHeaders_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).ListBlockHeaders(ctx, req.(*ListParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_ListBlockMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).ListBlockMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_ListBlockMetadata_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).ListBlockMetadata(ctx, req.(*ListParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_ListBlockStream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Empty) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(AergoRPCServiceServer).ListBlockStream(m, &aergoRPCServiceListBlockStreamServer{stream}) +} + +type AergoRPCService_ListBlockStreamServer interface { + Send(*Block) error + grpc.ServerStream +} + +type aergoRPCServiceListBlockStreamServer struct { + grpc.ServerStream +} + +func (x *aergoRPCServiceListBlockStreamServer) Send(m *Block) error { + return x.ServerStream.SendMsg(m) +} + +func _AergoRPCService_ListBlockMetadataStream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Empty) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(AergoRPCServiceServer).ListBlockMetadataStream(m, &aergoRPCServiceListBlockMetadataStreamServer{stream}) +} + +type AergoRPCService_ListBlockMetadataStreamServer interface { + Send(*BlockMetadata) error + grpc.ServerStream +} + +type aergoRPCServiceListBlockMetadataStreamServer struct { + grpc.ServerStream +} + +func (x *aergoRPCServiceListBlockMetadataStreamServer) Send(m *BlockMetadata) error { + return x.ServerStream.SendMsg(m) +} + +func _AergoRPCService_GetBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SingleBytes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetBlock(ctx, req.(*SingleBytes)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetBlockMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SingleBytes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetBlockMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetBlockMetadata_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetBlockMetadata(ctx, req.(*SingleBytes)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetBlockBody_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockBodyParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetBlockBody(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetBlockBody_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetBlockBody(ctx, req.(*BlockBodyParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SingleBytes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetTX(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetTX_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetTX(ctx, req.(*SingleBytes)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetBlockTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SingleBytes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetBlockTX(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetBlockTX_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetBlockTX(ctx, req.(*SingleBytes)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetReceipt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SingleBytes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetReceipt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetReceipt_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetReceipt(ctx, req.(*SingleBytes)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetABI_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SingleBytes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetABI(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetABI_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetABI(ctx, req.(*SingleBytes)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_SendTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Tx) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).SendTX(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_SendTX_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).SendTX(ctx, req.(*Tx)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_SignTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Tx) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).SignTX(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_SignTX_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).SignTX(ctx, req.(*Tx)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_VerifyTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Tx) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).VerifyTX(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_VerifyTX_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).VerifyTX(ctx, req.(*Tx)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_CommitTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TxList) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).CommitTX(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_CommitTX_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).CommitTX(ctx, req.(*TxList)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SingleBytes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetState(ctx, req.(*SingleBytes)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetStateAndProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AccountAndRoot) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetStateAndProof(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetStateAndProof_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetStateAndProof(ctx, req.(*AccountAndRoot)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_CreateAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Personal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).CreateAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_CreateAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).CreateAccount(ctx, req.(*Personal)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetAccounts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetAccounts(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_LockAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Personal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).LockAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_LockAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).LockAccount(ctx, req.(*Personal)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_UnlockAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Personal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).UnlockAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_UnlockAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).UnlockAccount(ctx, req.(*Personal)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_ImportAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportFormat) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).ImportAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_ImportAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).ImportAccount(ctx, req.(*ImportFormat)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_ExportAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Personal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).ExportAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_ExportAccount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).ExportAccount(ctx, req.(*Personal)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_ExportAccountKeystore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Personal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).ExportAccountKeystore(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_ExportAccountKeystore_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).ExportAccountKeystore(ctx, req.(*Personal)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_QueryContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Query) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).QueryContract(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_QueryContract_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).QueryContract(ctx, req.(*Query)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_QueryContractState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StateQuery) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).QueryContractState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_QueryContractState_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).QueryContractState(ctx, req.(*StateQuery)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetPeers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PeersParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetPeers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetPeers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetPeers(ctx, req.(*PeersParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetVotes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VoteParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetVotes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetVotes_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetVotes(ctx, req.(*VoteParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetAccountVotes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AccountAddress) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetAccountVotes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetAccountVotes_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetAccountVotes(ctx, req.(*AccountAddress)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetStaking_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AccountAddress) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetStaking(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetStaking_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetStaking(ctx, req.(*AccountAddress)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetNameInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Name) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetNameInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetNameInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetNameInfo(ctx, req.(*Name)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_ListEventStream_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(FilterInfo) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(AergoRPCServiceServer).ListEventStream(m, &aergoRPCServiceListEventStreamServer{stream}) +} + +type AergoRPCService_ListEventStreamServer interface { + Send(*Event) error + grpc.ServerStream +} + +type aergoRPCServiceListEventStreamServer struct { + grpc.ServerStream +} + +func (x *aergoRPCServiceListEventStreamServer) Send(m *Event) error { + return x.ServerStream.SendMsg(m) +} + +func _AergoRPCService_ListEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FilterInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).ListEvents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_ListEvents_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).ListEvents(ctx, req.(*FilterInfo)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetServerInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KeyParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetServerInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetServerInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetServerInfo(ctx, req.(*KeyParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetConsensusInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetConsensusInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetConsensusInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetConsensusInfo(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetEnterpriseConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EnterpriseConfigKey) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetEnterpriseConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetEnterpriseConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetEnterpriseConfig(ctx, req.(*EnterpriseConfigKey)) + } + return interceptor(ctx, in, info, handler) +} + +func _AergoRPCService_GetConfChangeProgress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SingleBytes) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AergoRPCServiceServer).GetConfChangeProgress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AergoRPCService_GetConfChangeProgress_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AergoRPCServiceServer).GetConfChangeProgress(ctx, req.(*SingleBytes)) + } + return interceptor(ctx, in, info, handler) +} + +// AergoRPCService_ServiceDesc is the grpc.ServiceDesc for AergoRPCService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AergoRPCService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "types.AergoRPCService", + HandlerType: (*AergoRPCServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "NodeState", + Handler: _AergoRPCService_NodeState_Handler, + }, + { + MethodName: "Metric", + Handler: _AergoRPCService_Metric_Handler, + }, + { + MethodName: "Blockchain", + Handler: _AergoRPCService_Blockchain_Handler, + }, + { + MethodName: "GetChainInfo", + Handler: _AergoRPCService_GetChainInfo_Handler, + }, + { + MethodName: "ChainStat", + Handler: _AergoRPCService_ChainStat_Handler, + }, + { + MethodName: "ListBlockHeaders", + Handler: _AergoRPCService_ListBlockHeaders_Handler, + }, + { + MethodName: "ListBlockMetadata", + Handler: _AergoRPCService_ListBlockMetadata_Handler, + }, + { + MethodName: "GetBlock", + Handler: _AergoRPCService_GetBlock_Handler, + }, + { + MethodName: "GetBlockMetadata", + Handler: _AergoRPCService_GetBlockMetadata_Handler, + }, + { + MethodName: "GetBlockBody", + Handler: _AergoRPCService_GetBlockBody_Handler, + }, + { + MethodName: "GetTX", + Handler: _AergoRPCService_GetTX_Handler, + }, + { + MethodName: "GetBlockTX", + Handler: _AergoRPCService_GetBlockTX_Handler, + }, + { + MethodName: "GetReceipt", + Handler: _AergoRPCService_GetReceipt_Handler, + }, + { + MethodName: "GetABI", + Handler: _AergoRPCService_GetABI_Handler, + }, + { + MethodName: "SendTX", + Handler: _AergoRPCService_SendTX_Handler, + }, + { + MethodName: "SignTX", + Handler: _AergoRPCService_SignTX_Handler, + }, + { + MethodName: "VerifyTX", + Handler: _AergoRPCService_VerifyTX_Handler, + }, + { + MethodName: "CommitTX", + Handler: _AergoRPCService_CommitTX_Handler, + }, + { + MethodName: "GetState", + Handler: _AergoRPCService_GetState_Handler, + }, + { + MethodName: "GetStateAndProof", + Handler: _AergoRPCService_GetStateAndProof_Handler, + }, + { + MethodName: "CreateAccount", + Handler: _AergoRPCService_CreateAccount_Handler, + }, + { + MethodName: "GetAccounts", + Handler: _AergoRPCService_GetAccounts_Handler, + }, + { + MethodName: "LockAccount", + Handler: _AergoRPCService_LockAccount_Handler, + }, + { + MethodName: "UnlockAccount", + Handler: _AergoRPCService_UnlockAccount_Handler, + }, + { + MethodName: "ImportAccount", + Handler: _AergoRPCService_ImportAccount_Handler, + }, + { + MethodName: "ExportAccount", + Handler: _AergoRPCService_ExportAccount_Handler, + }, + { + MethodName: "ExportAccountKeystore", + Handler: _AergoRPCService_ExportAccountKeystore_Handler, + }, + { + MethodName: "QueryContract", + Handler: _AergoRPCService_QueryContract_Handler, + }, + { + MethodName: "QueryContractState", + Handler: _AergoRPCService_QueryContractState_Handler, + }, + { + MethodName: "GetPeers", + Handler: _AergoRPCService_GetPeers_Handler, + }, + { + MethodName: "GetVotes", + Handler: _AergoRPCService_GetVotes_Handler, + }, + { + MethodName: "GetAccountVotes", + Handler: _AergoRPCService_GetAccountVotes_Handler, + }, + { + MethodName: "GetStaking", + Handler: _AergoRPCService_GetStaking_Handler, + }, + { + MethodName: "GetNameInfo", + Handler: _AergoRPCService_GetNameInfo_Handler, + }, + { + MethodName: "ListEvents", + Handler: _AergoRPCService_ListEvents_Handler, + }, + { + MethodName: "GetServerInfo", + Handler: _AergoRPCService_GetServerInfo_Handler, + }, + { + MethodName: "GetConsensusInfo", + Handler: _AergoRPCService_GetConsensusInfo_Handler, + }, + { + MethodName: "GetEnterpriseConfig", + Handler: _AergoRPCService_GetEnterpriseConfig_Handler, + }, + { + MethodName: "GetConfChangeProgress", + Handler: _AergoRPCService_GetConfChangeProgress_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ListBlockStream", + Handler: _AergoRPCService_ListBlockStream_Handler, + ServerStreams: true, + }, + { + StreamName: "ListBlockMetadataStream", + Handler: _AergoRPCService_ListBlockMetadataStream_Handler, + ServerStreams: true, + }, + { + StreamName: "ListEventStream", + Handler: _AergoRPCService_ListEventStream_Handler, + ServerStreams: true, + }, + }, + Metadata: "rpc.proto", +}