Comparing version 0.0.51 to 0.0.53
@@ -33,3 +33,3 @@ import * as env from "./env"; | ||
get primary(): u64 { | ||
check(this.isOk(), "get primary: invalid iterator") | ||
check(this.isOk(), "get primary: invalid iterator"); | ||
@@ -58,3 +58,3 @@ if (this.validPrimary) { | ||
isEnd(): bool { | ||
return this.i == -2; | ||
return this.i <= -2; | ||
} | ||
@@ -61,0 +61,0 @@ } |
@@ -86,3 +86,3 @@ import { PermissionLevel, Action } from "./action" | ||
export class MockPacker implements MultiIndexValue { | ||
export class MockPacker implements Packer { | ||
pack(): u8[] { | ||
@@ -102,3 +102,23 @@ check(false, "not implemented"); | ||
} | ||
} | ||
export class Table extends MockPacker implements MultiIndexValue { | ||
static get tableName(): Name { | ||
check(false, "not implemented"); | ||
return Name.fromU64(0); | ||
} | ||
static tableIndexes(_: Name, __: Name): IDXDB[] { | ||
check(false, "not implemented"); | ||
return []; | ||
} | ||
getTableName(): Name { | ||
return Table.tableName; | ||
} | ||
getTableIndexes(_: Name, __: Name): IDXDB[] { | ||
return Table.tableIndexes(_, __) | ||
} | ||
getPrimaryValue(): u64 { | ||
@@ -125,22 +145,2 @@ check(false, "not implemented"); | ||
export class Table extends MockPacker { | ||
static get tableName(): Name { | ||
check(false, "not implemented"); | ||
return Name.fromU64(0); | ||
} | ||
static tableIndexes(_: Name, __: Name): IDXDB[] { | ||
check(false, "not implemented"); | ||
return []; | ||
} | ||
getTableName(): Name { | ||
return Table.tableName; | ||
} | ||
getTableIndexes(_: Name, __: Name): IDXDB[] { | ||
return Table.tableIndexes(_, __) | ||
} | ||
} | ||
export class ActionData extends MockPacker {} |
@@ -17,3 +17,3 @@ import { U128, U256 } from "./bignum"; | ||
isEnd(): bool { | ||
return this.i == -2; | ||
return this.i <= -2; | ||
} | ||
@@ -20,0 +20,0 @@ } |
@@ -156,2 +156,3 @@ import { IDXDB, SecondaryValue, SecondaryIterator } from "./idxdb"; | ||
let primaryIt = this.find(it.primary); | ||
check(primaryIt.isOk(), "idxUpdate: value by primary not found"); | ||
let value = this.get(primaryIt); | ||
@@ -158,0 +159,0 @@ value.setSecondaryValue(it.dbIndex, idxValue); |
@@ -140,3 +140,4 @@ import { Decoder, Packer } from "./serializer"; | ||
@inline constructor(n: u64=0) { | ||
@inline | ||
constructor(n: u64=0) { | ||
this.N = n; | ||
@@ -153,2 +154,6 @@ } | ||
get value(): u64 { | ||
return this.N; | ||
} | ||
toString(): string { | ||
@@ -155,0 +160,0 @@ return N2S(this.N); |
@@ -0,1 +1,2 @@ | ||
import { printString } from "./debug"; | ||
import { Packer, Encoder, Decoder } from "./serializer" | ||
@@ -77,2 +78,3 @@ import { Utils } from "./utils" | ||
} | ||
this.hasValue = true; | ||
this.value = dec.unpackNumber<T>(); | ||
@@ -79,0 +81,0 @@ return dec.getPos(); |
@@ -89,8 +89,2 @@ import * as env from "./env"; | ||
export class Transaction implements Packer { | ||
// time_point_sec expiration; | ||
// uint16_t ref_block_num; | ||
// uint32_t ref_block_prefix; | ||
// unsigned_int max_net_usage_words = 0UL; /// number of 8 byte words this transaction can serialize into after compressions | ||
// uint8_t max_cpu_usage_ms = 0UL; /// number of CPU usage units to bill transaction for | ||
// unsigned_int delay_sec = 0UL; /// number of seconds to delay transaction, default: 0 | ||
expiration: TimePointSec; | ||
@@ -101,5 +95,5 @@ refBlockNum: u16; | ||
//unsigned_int vaint (eosio.cdt/libraries/eosiolib/core/eosio/varint.hpp) | ||
maxNetUsageWords: VarUint32; | ||
maxCpuUsageMs: u8; | ||
delaySec: VarUint32; //unsigned_int | ||
maxNetUsageWords: VarUint32; /// number of 8 byte words this transaction can serialize into after compressions | ||
maxCpuUsageMs: u8; /// number of CPU usage units to bill transaction for | ||
delaySec: VarUint32; /// number of seconds to delay transaction, default: 0 | ||
contextFreeActions: Action[]; | ||
@@ -106,0 +100,0 @@ actions: Action[]; |
{ | ||
"name": "as-chain", | ||
"version": "0.0.51", | ||
"version": "0.0.53", | ||
"description": "chain module for assemblyscript", | ||
@@ -5,0 +5,0 @@ "main": "js/index.js", |
6412
1565340