mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-21 17:01:35 +00:00
fix js
This commit is contained in:
@ -36,13 +36,13 @@ CounterAppContext.prototype.set_option = function(key, value){
|
|||||||
|
|
||||||
CounterAppContext.prototype.append_tx = function(txBytes){
|
CounterAppContext.prototype.append_tx = function(txBytes){
|
||||||
if (this.serial) {
|
if (this.serial) {
|
||||||
txByteArray = txBytes
|
txByteArray = new Buffer(txBytes)
|
||||||
if (txByte.length >= 2 && txBytes.slice(0, 2) == "0x") {
|
if (txBytes.length >= 2 && txBytes.slice(0, 2) == "0x") {
|
||||||
txByteArray = wire.hex2bytes(txBytes.slice(2));
|
txByteArray = wire.hex2bytes(txBytes.slice(2));
|
||||||
}
|
}
|
||||||
r = new wire.BytesReader(txByteArray)
|
r = new msg.buffer(txByteArray)
|
||||||
txValue = decode_big_endian(r, txBytes.length)
|
txValue = wire.decode_big_endian(r, txBytes.length)
|
||||||
if (txValue != this.txcount){
|
if (txValue != this.txCount){
|
||||||
return {"ret_code":1}
|
return {"ret_code":1}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,13 +88,11 @@ AppServer.prototype.createServer = function(){
|
|||||||
// done decoding
|
// done decoding
|
||||||
conn.msgLength = 0
|
conn.msgLength = 0
|
||||||
|
|
||||||
// NOTE: this throws of the "this"'s in app.js
|
|
||||||
//reqFunc = appCtx[reqType];
|
|
||||||
var res = function(){
|
var res = function(){
|
||||||
if (args == null){
|
if (args == null){
|
||||||
return appCtx[reqType]();
|
return appCtx[reqType]();
|
||||||
} else if (Array.isArray(args)){
|
} else if (Array.isArray(args)){
|
||||||
return appCtx[reqType].apply(this, args);
|
return appCtx[reqType].apply(appCtx, args);
|
||||||
} else {
|
} else {
|
||||||
return appCtx[reqType](args)
|
return appCtx[reqType](args)
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ math = require("math")
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
decode_string: decode_string,
|
decode_string: decode_string,
|
||||||
decode_varint: decode_varint,
|
decode_varint: decode_varint,
|
||||||
|
decode_big_endian: decode_big_endian,
|
||||||
encode_big_endian: encode_big_endian,
|
encode_big_endian: encode_big_endian,
|
||||||
encode: encode,
|
encode: encode,
|
||||||
reverse: reverse,
|
reverse: reverse,
|
||||||
|
Reference in New Issue
Block a user