Commit 119ee0e6 authored by vipwzw's avatar vipwzw Committed by 33cn

update 2019/01/26

parent bd945d91
...@@ -3,5 +3,5 @@ i=0 ...@@ -3,5 +3,5 @@ i=0
while IFS='' read -r line || [[ -n $line ]]; do while IFS='' read -r line || [[ -n $line ]]; do
[ -z "$line" ] && continue [ -z "$line" ] && continue
((i++)) ((i++))
../chain33-cli account balance -a "$line" -e ticket ../chain33-cli --rpc_laddr https://mainnode.bityuan.com:8801 account balance -a "$line" -e ticket
done <"$1" done <"$1"
...@@ -220,7 +220,7 @@ func (c *channelClient) GetBalance(in *types.ReqBalance) ([]*types.Account, erro ...@@ -220,7 +220,7 @@ func (c *channelClient) GetBalance(in *types.ReqBalance) ([]*types.Account, erro
} }
// GetAllExecBalance get balance of exec // GetAllExecBalance get balance of exec
func (c *channelClient) GetAllExecBalance(in *types.ReqAddr) (*types.AllExecBalance, error) { func (c *channelClient) GetAllExecBalance(in *types.ReqAllExecBalance) (*types.AllExecBalance, error) {
addr := in.Addr addr := in.Addr
err := address.CheckAddress(addr) err := address.CheckAddress(addr)
if err != nil { if err != nil {
...@@ -234,8 +234,11 @@ func (c *channelClient) GetAllExecBalance(in *types.ReqAddr) (*types.AllExecBala ...@@ -234,8 +234,11 @@ func (c *channelClient) GetAllExecBalance(in *types.ReqAddr) (*types.AllExecBala
for _, exec := range types.AllowUserExec { for _, exec := range types.AllowUserExec {
execer := types.ExecName(string(exec)) execer := types.ExecName(string(exec))
params := &types.ReqBalance{ params := &types.ReqBalance{
Addresses: addrs, Addresses: addrs,
Execer: execer, Execer: execer,
StateHash: in.StateHash,
AssetExec: in.AssetExec,
AssetSymbol: in.AssetSymbol,
} }
res, err := c.GetBalance(params) res, err := c.GetBalance(params)
if err != nil { if err != nil {
......
...@@ -254,7 +254,7 @@ func (g *Grpc) GetBalance(ctx context.Context, in *pb.ReqBalance) (*pb.Accounts, ...@@ -254,7 +254,7 @@ func (g *Grpc) GetBalance(ctx context.Context, in *pb.ReqBalance) (*pb.Accounts,
} }
// GetAllExecBalance get balance of exec // GetAllExecBalance get balance of exec
func (g *Grpc) GetAllExecBalance(ctx context.Context, in *pb.ReqAddr) (*pb.AllExecBalance, error) { func (g *Grpc) GetAllExecBalance(ctx context.Context, in *pb.ReqAllExecBalance) (*pb.AllExecBalance, error) {
return g.cli.GetAllExecBalance(in) return g.cli.GetAllExecBalance(in)
} }
......
...@@ -740,7 +740,7 @@ func (c *Chain33) GetBalance(in types.ReqBalance, result *interface{}) error { ...@@ -740,7 +740,7 @@ func (c *Chain33) GetBalance(in types.ReqBalance, result *interface{}) error {
} }
// GetAllExecBalance get all balance of exec // GetAllExecBalance get all balance of exec
func (c *Chain33) GetAllExecBalance(in types.ReqAddr, result *interface{}) error { func (c *Chain33) GetAllExecBalance(in types.ReqAllExecBalance, result *interface{}) error {
balance, err := c.cli.GetAllExecBalance(&in) balance, err := c.cli.GetAllExecBalance(&in)
if err != nil { if err != nil {
return err return err
......
...@@ -143,18 +143,15 @@ func balance(cmd *cobra.Command, args []string) { ...@@ -143,18 +143,15 @@ func balance(cmd *cobra.Command, args []string) {
return return
} }
} }
if execer == "" { if execer == "" && height == -1 {
req := types.ReqAddr{Addr: addr} req := types.ReqAllExecBalance{Addr: addr}
var res rpctypes.AllExecBalance var res rpctypes.AllExecBalance
ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.GetAllExecBalance", req, &res) ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.GetAllExecBalance", req, &res)
ctx.SetResultCb(parseGetAllBalanceRes) ctx.SetResultCb(parseGetAllBalanceRes)
ctx.Run() ctx.Run()
return return
} }
if ok := types.IsAllowExecName([]byte(execer), []byte(execer)); !ok {
fmt.Fprintln(os.Stderr, types.ErrExecNameNotAllow)
return
}
stateHash := "" stateHash := ""
if height >= 0 { if height >= 0 {
params := types.ReqBlocks{ params := types.ReqBlocks{
...@@ -173,6 +170,20 @@ func balance(cmd *cobra.Command, args []string) { ...@@ -173,6 +170,20 @@ func balance(cmd *cobra.Command, args []string) {
stateHash = h.StateHash stateHash = h.StateHash
} }
if execer == "" {
req := types.ReqAllExecBalance{Addr: addr, StateHash: stateHash}
var res rpctypes.AllExecBalance
ctx := jsonclient.NewRPCCtx(rpcLaddr, "Chain33.GetAllExecBalance", req, &res)
ctx.SetResultCb(parseGetAllBalanceRes)
ctx.Run()
return
}
if ok := types.IsAllowExecName([]byte(execer), []byte(execer)); !ok {
fmt.Fprintln(os.Stderr, types.ErrExecNameNotAllow)
return
}
var addrs []string var addrs []string
addrs = append(addrs, addr) addrs = append(addrs, addr)
params := types.ReqBalance{ params := types.ReqBalance{
......
package executor
import (
"testing"
rpctypes "github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util"
"github.com/33cn/chain33/util/testnode"
"github.com/stretchr/testify/assert"
)
func TestManageConfig(t *testing.T) {
cfg, sub := testnode.GetDefaultConfig()
mocker := testnode.NewWithConfig(cfg, sub, nil)
defer mocker.Close()
mocker.Listen()
err := mocker.SendHot()
assert.Nil(t, err)
//创建黑名单
// -o add -v BTY
create := &types.ModifyConfig{
Key: "token-blacklist",
Op: "add",
Value: "BTY",
Addr: "",
}
jsondata := types.MustPBToJSON(create)
/*
{
"execer": "manage",
"actionName": "Modify",
"payload": {
"key": "token-blacklist",
"value": "BTY",
"op": "add",
"addr": ""
}
}
*/
req := &rpctypes.CreateTxIn{
Execer: "manage",
ActionName: "Modify",
Payload: jsondata,
}
var txhex string
err = mocker.GetJSONC().Call("Chain33.CreateTransaction", req, &txhex)
assert.Nil(t, err)
hash, err := mocker.SendAndSign(mocker.GetHotKey(), txhex)
assert.Nil(t, err)
txinfo, err := mocker.WaitTx(hash)
assert.Nil(t, err)
assert.Equal(t, txinfo.Receipt.Ty, int32(2))
create = &types.ModifyConfig{
Key: "token-blacklist",
Op: "add",
Value: "YCC",
Addr: "",
}
jsondata = types.MustPBToJSON(create)
req = &rpctypes.CreateTxIn{
Execer: "manage",
ActionName: "Modify",
Payload: jsondata,
}
err = mocker.GetJSONC().Call("Chain33.CreateTransaction", req, &txhex)
assert.Nil(t, err)
hash, err = mocker.SendAndSign(mocker.GetHotKey(), txhex)
assert.Nil(t, err)
txinfo, err = mocker.WaitTx(hash)
assert.Nil(t, err)
assert.Equal(t, txinfo.Receipt.Ty, int32(2))
create = &types.ModifyConfig{
Key: "token-blacklist",
Op: "add",
Value: "TTT",
Addr: "",
}
jsondata = types.MustPBToJSON(create)
req = &rpctypes.CreateTxIn{
Execer: "manage",
ActionName: "Modify",
Payload: jsondata,
}
err = mocker.GetJSONC().Call("Chain33.CreateTransaction", req, &txhex)
assert.Nil(t, err)
hash, err = mocker.SendAndSign(mocker.GetHotKey(), txhex)
assert.Nil(t, err)
txinfo, err = mocker.WaitTx(hash)
assert.Nil(t, err)
assert.Equal(t, txinfo.Receipt.Ty, int32(2))
//做一个查询
/*
{
"execer": "manage",
"funcName": "GetConfigItem",
"payload": {
"data": "token-blacklist"
}
}
*/
queryreq := &types.ReqString{
Data: "token-blacklist",
}
query := &rpctypes.Query4Jrpc{
Execer: "manage",
FuncName: "GetConfigItem",
Payload: types.MustPBToJSON(queryreq),
}
var reply types.ReplyConfig
err = mocker.GetJSONC().Call("Chain33.Query", query, &reply)
assert.Nil(t, err)
assert.Equal(t, reply.Key, "token-blacklist")
assert.Equal(t, reply.Value, "[BTY YCC TTT]")
create = &types.ModifyConfig{
Key: "token-blacklist",
Op: "delete",
Value: "TTT",
Addr: "",
}
jsondata = types.MustPBToJSON(create)
req = &rpctypes.CreateTxIn{
Execer: "manage",
ActionName: "Modify",
Payload: jsondata,
}
err = mocker.GetJSONC().Call("Chain33.CreateTransaction", req, &txhex)
assert.Nil(t, err)
hash, err = mocker.SendAndSign(mocker.GetHotKey(), txhex)
assert.Nil(t, err)
txinfo, err = mocker.WaitTx(hash)
assert.Nil(t, err)
util.JSONPrint(t, txinfo)
assert.Equal(t, txinfo.Receipt.Ty, int32(2))
queryreq = &types.ReqString{
Data: "token-blacklist",
}
query = &rpctypes.Query4Jrpc{
Execer: "manage",
FuncName: "GetConfigItem",
Payload: types.MustPBToJSON(queryreq),
}
err = mocker.GetJSONC().Call("Chain33.Query", query, &reply)
assert.Nil(t, err)
assert.Equal(t, reply.Key, "token-blacklist")
assert.Equal(t, reply.Value, "[BTY YCC]")
}
func TestTokenFinisher(t *testing.T) {
cfg, sub := testnode.GetDefaultConfig()
mocker := testnode.NewWithConfig(cfg, sub, nil)
defer mocker.Close()
mocker.Listen()
err := mocker.SendHot()
assert.Nil(t, err)
//添加发币审核地址
create := &types.ModifyConfig{
Key: "token-finisher",
Op: "add",
Value: "1FCX9XJTZXvZteagTrefJEBPZMt8BFmdoi",
Addr: "",
}
jsondata := types.MustPBToJSON(create)
/*
{
"execer": "manage",
"actionName": "Modify",
"payload": {
"key": "token-finisher",
"value": "1FCX9XJTZXvZteagTrefJEBPZMt8BFmdoi",
"op": "add",
"addr": ""
}
}
*/
req := &rpctypes.CreateTxIn{
Execer: "manage",
ActionName: "Modify",
Payload: jsondata,
}
var txhex string
err = mocker.GetJSONC().Call("Chain33.CreateTransaction", req, &txhex)
assert.Nil(t, err)
hash, err := mocker.SendAndSign(mocker.GetHotKey(), txhex)
assert.Nil(t, err)
txinfo, err := mocker.WaitTx(hash)
assert.Nil(t, err)
assert.Equal(t, txinfo.Receipt.Ty, int32(2))
queryreq := &types.ReqString{
Data: "token-finisher",
}
query := &rpctypes.Query4Jrpc{
Execer: "manage",
FuncName: "GetConfigItem",
Payload: types.MustPBToJSON(queryreq),
}
var reply types.ReplyConfig
err = mocker.GetJSONC().Call("Chain33.Query", query, &reply)
assert.Nil(t, err)
assert.Equal(t, reply.Key, "token-finisher")
assert.Equal(t, reply.Value, "[1FCX9XJTZXvZteagTrefJEBPZMt8BFmdoi]")
}
...@@ -406,6 +406,79 @@ func (m *AllExecBalance) GetExecAccount() []*ExecAccount { ...@@ -406,6 +406,79 @@ func (m *AllExecBalance) GetExecAccount() []*ExecAccount {
return nil return nil
} }
type ReqAllExecBalance struct {
//地址列表
Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
//执行器名称
Execer string `protobuf:"bytes,2,opt,name=execer,proto3" json:"execer,omitempty"`
StateHash string `protobuf:"bytes,3,opt,name=stateHash,proto3" json:"stateHash,omitempty"`
AssetExec string `protobuf:"bytes,4,opt,name=asset_exec,json=assetExec,proto3" json:"asset_exec,omitempty"`
AssetSymbol string `protobuf:"bytes,5,opt,name=asset_symbol,json=assetSymbol,proto3" json:"asset_symbol,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ReqAllExecBalance) Reset() { *m = ReqAllExecBalance{} }
func (m *ReqAllExecBalance) String() string { return proto.CompactTextString(m) }
func (*ReqAllExecBalance) ProtoMessage() {}
func (*ReqAllExecBalance) Descriptor() ([]byte, []int) {
return fileDescriptor_8e28828dcb8d24f0, []int{7}
}
func (m *ReqAllExecBalance) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqAllExecBalance.Unmarshal(m, b)
}
func (m *ReqAllExecBalance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqAllExecBalance.Marshal(b, m, deterministic)
}
func (m *ReqAllExecBalance) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqAllExecBalance.Merge(m, src)
}
func (m *ReqAllExecBalance) XXX_Size() int {
return xxx_messageInfo_ReqAllExecBalance.Size(m)
}
func (m *ReqAllExecBalance) XXX_DiscardUnknown() {
xxx_messageInfo_ReqAllExecBalance.DiscardUnknown(m)
}
var xxx_messageInfo_ReqAllExecBalance proto.InternalMessageInfo
func (m *ReqAllExecBalance) GetAddr() string {
if m != nil {
return m.Addr
}
return ""
}
func (m *ReqAllExecBalance) GetExecer() string {
if m != nil {
return m.Execer
}
return ""
}
func (m *ReqAllExecBalance) GetStateHash() string {
if m != nil {
return m.StateHash
}
return ""
}
func (m *ReqAllExecBalance) GetAssetExec() string {
if m != nil {
return m.AssetExec
}
return ""
}
func (m *ReqAllExecBalance) GetAssetSymbol() string {
if m != nil {
return m.AssetSymbol
}
return ""
}
func init() { func init() {
proto.RegisterType((*Account)(nil), "types.Account") proto.RegisterType((*Account)(nil), "types.Account")
proto.RegisterType((*ReceiptExecAccountTransfer)(nil), "types.ReceiptExecAccountTransfer") proto.RegisterType((*ReceiptExecAccountTransfer)(nil), "types.ReceiptExecAccountTransfer")
...@@ -414,35 +487,37 @@ func init() { ...@@ -414,35 +487,37 @@ func init() {
proto.RegisterType((*Accounts)(nil), "types.Accounts") proto.RegisterType((*Accounts)(nil), "types.Accounts")
proto.RegisterType((*ExecAccount)(nil), "types.ExecAccount") proto.RegisterType((*ExecAccount)(nil), "types.ExecAccount")
proto.RegisterType((*AllExecBalance)(nil), "types.AllExecBalance") proto.RegisterType((*AllExecBalance)(nil), "types.AllExecBalance")
proto.RegisterType((*ReqAllExecBalance)(nil), "types.ReqAllExecBalance")
} }
func init() { proto.RegisterFile("account.proto", fileDescriptor_8e28828dcb8d24f0) } func init() { proto.RegisterFile("account.proto", fileDescriptor_8e28828dcb8d24f0) }
var fileDescriptor_8e28828dcb8d24f0 = []byte{ var fileDescriptor_8e28828dcb8d24f0 = []byte{
// 399 bytes of a gzipped FileDescriptorProto // 414 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xc1, 0x8e, 0xd3, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x53, 0xc1, 0x6e, 0xd3, 0x40,
0x10, 0x95, 0x9b, 0x76, 0xb3, 0x99, 0xc2, 0x1e, 0x7c, 0x58, 0x59, 0x2b, 0x56, 0x84, 0x9c, 0x72, 0x10, 0xd5, 0xc6, 0x49, 0x5d, 0x4f, 0xa0, 0x12, 0x7b, 0xa8, 0x56, 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b9, 0x56,
0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x95, 0x98, 0xa9, 0xbf, 0x03, 0x00, 0x00,
} }
...@@ -313,7 +313,7 @@ func (_m *Chain33Client) GetAddrOverview(ctx context.Context, in *types.ReqAddr, ...@@ -313,7 +313,7 @@ func (_m *Chain33Client) GetAddrOverview(ctx context.Context, in *types.ReqAddr,
} }
// GetAllExecBalance provides a mock function with given fields: ctx, in, opts // GetAllExecBalance provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetAllExecBalance(ctx context.Context, in *types.ReqAddr, opts ...grpc.CallOption) (*types.AllExecBalance, error) { func (_m *Chain33Client) GetAllExecBalance(ctx context.Context, in *types.ReqAllExecBalance, opts ...grpc.CallOption) (*types.AllExecBalance, error) {
_va := make([]interface{}, len(opts)) _va := make([]interface{}, len(opts))
for _i := range opts { for _i := range opts {
_va[_i] = opts[_i] _va[_i] = opts[_i]
...@@ -324,7 +324,7 @@ func (_m *Chain33Client) GetAllExecBalance(ctx context.Context, in *types.ReqAdd ...@@ -324,7 +324,7 @@ func (_m *Chain33Client) GetAllExecBalance(ctx context.Context, in *types.ReqAdd
ret := _m.Called(_ca...) ret := _m.Called(_ca...)
var r0 *types.AllExecBalance var r0 *types.AllExecBalance
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqAddr, ...grpc.CallOption) *types.AllExecBalance); ok { if rf, ok := ret.Get(0).(func(context.Context, *types.ReqAllExecBalance, ...grpc.CallOption) *types.AllExecBalance); ok {
r0 = rf(ctx, in, opts...) r0 = rf(ctx, in, opts...)
} else { } else {
if ret.Get(0) != nil { if ret.Get(0) != nil {
...@@ -333,7 +333,7 @@ func (_m *Chain33Client) GetAllExecBalance(ctx context.Context, in *types.ReqAdd ...@@ -333,7 +333,7 @@ func (_m *Chain33Client) GetAllExecBalance(ctx context.Context, in *types.ReqAdd
} }
var r1 error var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.ReqAddr, ...grpc.CallOption) error); ok { if rf, ok := ret.Get(1).(func(context.Context, *types.ReqAllExecBalance, ...grpc.CallOption) error); ok {
r1 = rf(ctx, in, opts...) r1 = rf(ctx, in, opts...)
} else { } else {
r1 = ret.Error(1) r1 = ret.Error(1)
......
...@@ -58,3 +58,13 @@ message AllExecBalance { ...@@ -58,3 +58,13 @@ message AllExecBalance {
string addr = 1; string addr = 1;
repeated ExecAccount ExecAccount = 2; repeated ExecAccount ExecAccount = 2;
} }
message ReqAllExecBalance {
//地址列表
string addr = 1;
//执行器名称
string execer = 2;
string stateHash = 3;
string asset_exec = 4;
string asset_symbol = 5;
}
\ No newline at end of file
...@@ -135,7 +135,7 @@ service chain33 { ...@@ -135,7 +135,7 @@ service chain33 {
rpc CloseQueue(ReqNil) returns (Reply) {} rpc CloseQueue(ReqNil) returns (Reply) {}
//获取地址所以合约下的余额 //获取地址所以合约下的余额
rpc GetAllExecBalance(ReqAddr) returns (AllExecBalance) {} rpc GetAllExecBalance(ReqAllExecBalance) returns (AllExecBalance) {}
//签名交易 //签名交易
rpc SignRawTx(ReqSignRawTx) returns (ReplySignRawTx) {} rpc SignRawTx(ReqSignRawTx) returns (ReplySignRawTx) {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment