@leofcoin/chain 1.5.8 → 1.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/exports/browser/chain.js
CHANGED
|
@@ -1491,6 +1491,7 @@ class State extends Contract {
|
|
|
1491
1491
|
}
|
|
1492
1492
|
try {
|
|
1493
1493
|
await this.#machine.execute(transaction.decoded.to, transaction.decoded.method, transaction.decoded.params);
|
|
1494
|
+
await globalThis.accountsStore.put(transaction.decoded.from, String(transaction.decoded.nonce));
|
|
1494
1495
|
if (transaction.decoded.to === nativeToken$2) {
|
|
1495
1496
|
this.#nativeCalls += 1;
|
|
1496
1497
|
if (transaction.decoded.method === 'burn')
|
|
@@ -1748,6 +1749,8 @@ class Chain extends State {
|
|
|
1748
1749
|
async #executeTransaction({ hash, from, to, method, params, nonce }) {
|
|
1749
1750
|
try {
|
|
1750
1751
|
let result = await this.machine.execute(to, method, params);
|
|
1752
|
+
// await accountsStore.put(to, nonce)
|
|
1753
|
+
await transactionPoolStore.delete(hash);
|
|
1751
1754
|
// if (!result) result = this.machine.state
|
|
1752
1755
|
globalThis.pubsub.publish(`transaction.completed.${hash}`, { status: 'fulfilled', hash });
|
|
1753
1756
|
return result || 'no state change';
|
package/exports/chain.js
CHANGED
|
@@ -931,6 +931,7 @@ class State extends Contract {
|
|
|
931
931
|
}
|
|
932
932
|
try {
|
|
933
933
|
await this.#machine.execute(transaction.decoded.to, transaction.decoded.method, transaction.decoded.params);
|
|
934
|
+
await globalThis.accountsStore.put(transaction.decoded.from, String(transaction.decoded.nonce));
|
|
934
935
|
if (transaction.decoded.to === nativeToken) {
|
|
935
936
|
this.#nativeCalls += 1;
|
|
936
937
|
if (transaction.decoded.method === 'burn')
|
|
@@ -1188,6 +1189,8 @@ class Chain extends State {
|
|
|
1188
1189
|
async #executeTransaction({ hash, from, to, method, params, nonce }) {
|
|
1189
1190
|
try {
|
|
1190
1191
|
let result = await this.machine.execute(to, method, params);
|
|
1192
|
+
// await accountsStore.put(to, nonce)
|
|
1193
|
+
await transactionPoolStore.delete(hash);
|
|
1191
1194
|
// if (!result) result = this.machine.state
|
|
1192
1195
|
globalThis.pubsub.publish(`transaction.completed.${hash}`, { status: 'fulfilled', hash });
|
|
1193
1196
|
return result || 'no state change';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/exports/types/types.d.ts
CHANGED
|
@@ -10,6 +10,13 @@ interface Transaction {
|
|
|
10
10
|
interface RawTransaction extends Transaction {
|
|
11
11
|
timestamp: Number;
|
|
12
12
|
}
|
|
13
|
+
export interface globalMessage {
|
|
14
|
+
sender: Address;
|
|
15
|
+
call: Function;
|
|
16
|
+
staticCall: Function;
|
|
17
|
+
delegate: Function;
|
|
18
|
+
staticDelegate: Function;
|
|
19
|
+
}
|
|
13
20
|
export declare type BlockInMemory = {
|
|
14
21
|
index: number;
|
|
15
22
|
transactions: RawTransaction[];
|