From 8c5c0704f3a380b1ea93e716c6099dca2d1f325b Mon Sep 17 00:00:00 2001 From: aaroncox Date: Fri, 11 Jul 2025 11:29:15 -0700 Subject: [PATCH 01/17] Migrating some math to Antelope integers --- package.json | 4 ++-- src/powerup/abstract.ts | 35 ++++++++++++++++------------- yarn.lock | 50 +++++++++++++++++++++++++---------------- 3 files changed, 53 insertions(+), 36 deletions(-) diff --git a/package.json b/package.json index 9f8115c..f987ce1 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "prepare": "make" }, "dependencies": { - "@wharfkit/antelope": "^1.0.0", + "@wharfkit/antelope": "^1.1.0", "bn.js": "^4.11.9", "js-big-decimal": "^2.0.7", "tslib": "^2.1.0" @@ -31,7 +31,7 @@ "@types/node": "^14.14.28", "@typescript-eslint/eslint-plugin": "^4.15.1", "@typescript-eslint/parser": "^4.15.1", - "@wharfkit/mock-data": "^1.2.0", + "@wharfkit/mock-data": "^1.3.0", "assert": "^2.0.0", "eslint": "^7.19.0", "eslint-config-prettier": "^7.0.0", diff --git a/src/powerup/abstract.ts b/src/powerup/abstract.ts index bf17eaa..9a048ef 100644 --- a/src/powerup/abstract.ts +++ b/src/powerup/abstract.ts @@ -54,10 +54,10 @@ export abstract class PowerUpStateResource extends Struct { // Common casting for typed values to numbers cast() { return { - adjusted_utilization: Number(this.adjusted_utilization), + adjusted_utilization: String(this.adjusted_utilization), decay_secs: Number(this.decay_secs.value), exponent: Number(this.exponent), - utilization: Number(this.utilization), + utilization: String(this.utilization), utilization_timestamp: Number(this.utilization_timestamp.value), weight: new BN(String(this.weight)), weight_ratio: Number(this.weight_ratio), @@ -90,13 +90,13 @@ export abstract class PowerUpStateResource extends Struct { } // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L274-L280 - price_integral_delta(start_utilization: number, end_utilization: number): number { + price_integral_delta(start_utilization: Int64, end_utilization: Int64): number { const {exponent, weight} = this.cast() const max_price: number = this.max_price.value const min_price: number = this.min_price.value const coefficient = (max_price - min_price) / exponent - const start_u = new BN(start_utilization) / weight - const end_u = new BN(end_utilization) / weight + const start_u = Number(start_utilization.dividing(weight)) + const end_u = Number(end_utilization.dividing(weight)) const delta = min_price * end_u - min_price * start_u + @@ -107,14 +107,18 @@ export abstract class PowerUpStateResource extends Struct { // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L262-L315 fee(utilization_increase, adjusted_utilization) { - const {utilization, weight} = this.cast() + const {weight} = this.cast() + const {utilization} = this - let start_utilization: number = utilization - const end_utilization: number = start_utilization + utilization_increase + let start_utilization = Int64.from(utilization) + const end_utilization = start_utilization.adding(utilization_increase) let fee = 0 if (start_utilization < adjusted_utilization) { - const min = Math.min(utilization_increase, adjusted_utilization - start_utilization) + const min = Math.min( + utilization_increase, + adjusted_utilization.subtracting(start_utilization) + ) fee += Number( new bigDecimal(this.price_function(adjusted_utilization) * min) .divide(new bigDecimal(weight.toString())) @@ -122,7 +126,7 @@ export abstract class PowerUpStateResource extends Struct { ) start_utilization = adjusted_utilization } - if (start_utilization < end_utilization) { + if (start_utilization.gt(end_utilization)) { fee += this.price_integral_delta(start_utilization, end_utilization) } return fee @@ -131,17 +135,18 @@ export abstract class PowerUpStateResource extends Struct { // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L105-L117 determine_adjusted_utilization(options?: PowerUpStateOptions) { // Casting EOSIO types to usable formats for JS calculations - const {decay_secs, utilization, utilization_timestamp} = this.cast() - let {adjusted_utilization} = this.cast() + const {decay_secs, utilization_timestamp} = this.cast() + const {utilization} = this + let {adjusted_utilization} = this // If utilization is less than adjusted, calculate real time value - if (utilization < adjusted_utilization) { + if (utilization.lt(adjusted_utilization)) { // Create now & adjust JS timestamp to match EOSIO timestamp values const ts = options && options.timestamp ? options.timestamp : new Date() const now = TimePointSec.from(ts).toMilliseconds() / 1000 - const diff: number = adjusted_utilization - utilization + const diff = adjusted_utilization.subtracting(utilization).toNumber() let delta: number = diff * Math.exp(-(now - utilization_timestamp) / decay_secs) delta = Math.min(Math.max(delta, 0), diff) // Clamp the delta - adjusted_utilization = utilization + delta + adjusted_utilization = utilization.adding(delta) } return adjusted_utilization } diff --git a/yarn.lock b/yarn.lock index 7a60e34..19304ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -348,12 +348,12 @@ resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== -"@wharfkit/abicache@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@wharfkit/abicache/-/abicache-1.2.0.tgz#f67f7bbd854adc443c3e363d5fbe3d27ac4f8383" - integrity sha512-1+564ODM1KhUs7chE8KpYhnxShuPLC1MvqYcXVuLosxXXwcYC4IiJ1V3VuikLG+xfBDp1GZivGjHQwv1awE2Zw== +"@wharfkit/abicache@^1.2.1": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@wharfkit/abicache/-/abicache-1.2.2.tgz#c3d83485e3e3782ac94ced460915bad1ceee0be9" + integrity sha512-yOsYz2qQpQy7Nb8XZj62pZqp8YnmWDqFlrenYksBb9jl+1aWIpFhWd+14VEez4tUAezRH4UWW+w1SX5vhmUY9A== dependencies: - "@wharfkit/antelope" "^1.0.0" + "@wharfkit/antelope" "^1.0.2" "@wharfkit/signing-request" "^3.1.0" pako "^2.0.4" tslib "^2.1.0" @@ -370,6 +370,18 @@ pako "^2.1.0" tslib "^2.0.3" +"@wharfkit/antelope@^1.0.11", "@wharfkit/antelope@^1.0.2", "@wharfkit/antelope@^1.0.5", "@wharfkit/antelope@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@wharfkit/antelope/-/antelope-1.1.0.tgz#653f9a234a4e151b4fa3c25b476a5326124da0c3" + integrity sha512-/+zwJq/gFSvIpw3fwFPtpafLqoiipg7lkL1FROrKPyJbrQEaqB1BsCos2+hhWccY6qwKqmdE/iEmY2TZ9gfTPQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + elliptic "^6.5.4" + hash.js "^1.0.0" + pako "^2.1.0" + tslib "^2.0.3" + "@wharfkit/common@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@wharfkit/common/-/common-1.2.0.tgz#147f783f2ba5cc6fa7dd75863ba98dd05880a9aa" @@ -377,24 +389,24 @@ dependencies: tslib "^2.1.0" -"@wharfkit/mock-data@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@wharfkit/mock-data/-/mock-data-1.2.0.tgz#fa5749f1332e413ecd4126dedf1d17724840df41" - integrity sha512-R779GKbzVeJFvO/VMLnjSua4YteQiuJ1WX/MjEeo2ftP0aPgaLNEoFKGa7veAvYEv/6mgEcS4Sm5gyFi1Enxhg== +"@wharfkit/mock-data@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@wharfkit/mock-data/-/mock-data-1.3.0.tgz#7a9caa7c7fb2ad839bc12593de1b7a546b673ae6" + integrity sha512-LkhAkrUOvG6o+lPWb2Q6JCrs9++F2XowGK42PODh35Xu9an5H+THMGjpUhTC1sPiYkfjhkmBbAzMpZbHjkXj4w== dependencies: - "@wharfkit/antelope" "^1.0.0" - "@wharfkit/session" "^1.1.0-rcfinal" - "@wharfkit/wallet-plugin-privatekey" "^1.0.0" + "@wharfkit/antelope" "^1.0.5" + "@wharfkit/session" "^1.2.7" + "@wharfkit/wallet-plugin-privatekey" "^1.1.0" node-fetch "^2.6.1" tslib "^2.1.0" -"@wharfkit/session@^1.1.0-rcfinal": - version "1.1.0-rcfinal" - resolved "https://registry.yarnpkg.com/@wharfkit/session/-/session-1.1.0-rcfinal.tgz#29a9f40dca8557e96d5e44c1498b09eb641f47e1" - integrity sha512-UijDlP2yE8WoprAXz8EpAyz1GyxWv9OloRGApTUKM/lMuSk1U2d7vefQzyXTn14f1npd7bfBzeTQ5piTerBHww== +"@wharfkit/session@^1.2.7": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@wharfkit/session/-/session-1.6.0.tgz#8863feb83fc71f55e49a0729aceabf1c688e216a" + integrity sha512-yrCDcW42Dqd387usVHa3qjnttc65OzHK3REKovzo6wLpQsPn709xzx4J6B9e9Xjb0WC/GQLghtr9EX+T+rRH6w== dependencies: - "@wharfkit/abicache" "^1.2.0" - "@wharfkit/antelope" "^1.0.0" + "@wharfkit/abicache" "^1.2.1" + "@wharfkit/antelope" "^1.0.11" "@wharfkit/common" "^1.2.0" "@wharfkit/signing-request" "^3.1.0" pako "^2.0.4" @@ -408,7 +420,7 @@ "@wharfkit/antelope" "^1.0.0" tslib "^2.0.3" -"@wharfkit/wallet-plugin-privatekey@^1.0.0": +"@wharfkit/wallet-plugin-privatekey@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@wharfkit/wallet-plugin-privatekey/-/wallet-plugin-privatekey-1.1.0.tgz#5985bff61895c54d2afbef359cd42da4f3871c7d" integrity sha512-45LPj7AOVDm4RugDEhy0fnQX/BcMffeJPjGUCUrLazJ2S0Sti8nNk4nqiJqyme84c/0gq7d65vvwlmVfGtPVEg== From 7670438640694dec7611c293b6679f4d94f48576 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Fri, 11 Jul 2025 11:29:27 -0700 Subject: [PATCH 02/17] v1.4.0-rc1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f987ce1..6c56765 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/resources", "description": "Library to assist in Antelope-blockchain resource calculations.", - "version": "1.3.1", + "version": "1.4.0-rc1", "homepage": "https://github.com/wharfkit/resources", "license": "BSD-3-Clause", "main": "lib/wharfkit-resources.js", From 0302c444ef3cae56afe663b8d1f6ab6e86ac3f43 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Mon, 14 Jul 2025 15:07:18 -0700 Subject: [PATCH 03/17] v1.5.0-rc1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c56765..261b154 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/resources", "description": "Library to assist in Antelope-blockchain resource calculations.", - "version": "1.4.0-rc1", + "version": "1.5.0-rc1", "homepage": "https://github.com/wharfkit/resources", "license": "BSD-3-Clause", "main": "lib/wharfkit-resources.js", From e2d0ba4892635be93cc289fc190a5ae165f242b1 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Mon, 14 Jul 2025 16:18:38 -0700 Subject: [PATCH 04/17] v1.5.0-rc2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 261b154..961f193 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/resources", "description": "Library to assist in Antelope-blockchain resource calculations.", - "version": "1.5.0-rc1", + "version": "1.5.0-rc2", "homepage": "https://github.com/wharfkit/resources", "license": "BSD-3-Clause", "main": "lib/wharfkit-resources.js", From 628c86508fb3445d8ac0e81705da54a2c5fdacd3 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Mon, 14 Jul 2025 17:38:20 -0700 Subject: [PATCH 05/17] v1.5.0-rc3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 961f193..2a79361 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/resources", "description": "Library to assist in Antelope-blockchain resource calculations.", - "version": "1.5.0-rc2", + "version": "1.5.0-rc3", "homepage": "https://github.com/wharfkit/resources", "license": "BSD-3-Clause", "main": "lib/wharfkit-resources.js", From 66eee78736caa23319d0034fb52842183c8a62dc Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 15 Jul 2025 13:26:54 -0700 Subject: [PATCH 06/17] A-B testing function rewrites --- src/index.ts | 7 +- src/powerup/abstract.ts | 133 ++++++++---- src/powerup/cpu.ts | 63 ++++-- src/powerup/net.ts | 61 +++++- ...cefb4d7749510e87d710cef682f8f1c7b4f6a.json | 19 ++ ...80f33c07aa3ba09b6a5e5581463f95a168feb.json | 33 +++ ...84e00fc6d9fb01a8843f6e251e6811459169c.json | 5 +- ...bea5f5551dede21edba216e12db446ca68486.json | 19 ++ ...6fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json | 176 +++++++++++++++ ...7c3f434961f4b54c70c4b133e2fbeb1f75dfa.json | 96 +++++++++ ...c990e6ea2e283c39d1f3a8d1b7680fedaed53.json | 3 +- ...5170d875b36823010af2a74154bbd509bc3bc.json | 5 +- ...e7473fc9df54bb8b45bcf3d759b48ce9a5a64.json | 33 +++ ...ad3d64af233a183cab24ef0a34585838379c7.json | 148 +++++++++++++ ...4769002c6f1710084a9b2f020b2560af883ab.json | 19 ++ ...e86908a8b1681d083ebb686fc8d10989b0632.json | 5 +- ...0c13e62013539b53fd522e7d0834cc3a6aa66.json | 19 ++ ...8258766b498e71f703d93796baa80fc37ddc5.json | 9 +- ...1de03f2a7ee6c133465c8c6b2b286704a5d8f.json | 33 +++ ...8dc7a4513763428bf651dcf148ab41d72d3af.json | 9 +- ...e0d25e3f0a6ac99195e23bd7410ede02c58df.json | 19 ++ ...a436e837ecec4ca8e2283a0a1e7900a997b6e.json | 157 ++++++++++++++ ...ee4f1d7ff04f2dd45675f0f50a4e9094a5d13.json | 5 +- test/migrate.ts | 201 ++++++++++++++++++ 24 files changed, 1199 insertions(+), 78 deletions(-) create mode 100644 test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json create mode 100644 test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json create mode 100644 test/data/618bea5f5551dede21edba216e12db446ca68486.json create mode 100644 test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json create mode 100644 test/data/6757c3f434961f4b54c70c4b133e2fbeb1f75dfa.json create mode 100644 test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json create mode 100644 test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json create mode 100644 test/data/9524769002c6f1710084a9b2f020b2560af883ab.json create mode 100644 test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json create mode 100644 test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json create mode 100644 test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json create mode 100644 test/data/e6ea436e837ecec4ca8e2283a0a1e7900a997b6e.json create mode 100644 test/migrate.ts diff --git a/src/index.ts b/src/index.ts index d8b2724..10f1640 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,10 @@ -import {API, APIClient, APIClientOptions, FetchProvider, UInt128} from '@wharfkit/antelope' +import {API, APIClient, APIClientOptions, FetchProvider, Int, UInt128} from '@wharfkit/antelope' import BN from 'bn.js' import {PowerUpAPI} from './powerup' import {RAMAPI} from './ram' import {REXAPI} from './rex' +import bigDecimal from 'js-big-decimal' export * from './powerup' export * from './ram' @@ -85,3 +86,7 @@ function divCeil(num: BN, den: BN): UInt128 { } return UInt128.from(v) } + +export function intToBigDecimal(value: Int | number) { + return new bigDecimal(String(value)) +} diff --git a/src/powerup/abstract.ts b/src/powerup/abstract.ts index 9a048ef..f98eb0a 100644 --- a/src/powerup/abstract.ts +++ b/src/powerup/abstract.ts @@ -9,11 +9,12 @@ import { UInt64, UInt8, } from '@wharfkit/antelope' - import BN from 'bn.js' -import {PowerUpStateOptions} from './options' import bigDecimal from 'js-big-decimal' +import {intToBigDecimal} from '..' +import {PowerUpStateOptions} from './options' + export abstract class PowerUpStateResource extends Struct { @Struct.field('uint8') version!: UInt8 @Struct.field('int64') weight!: Int64 @@ -37,35 +38,30 @@ export abstract class PowerUpStateResource extends Struct { abstract per_day(options?: PowerUpStateOptions): number // Get the current number of allocated units (shift from REX -> PowerUp) - public get allocated() { + public get allocated_legacy() { return 1 - Number(this.weight_ratio) / Number(this.target_weight_ratio) / 100 } + public get allocated(): number { + return 1 - Number(this.weight_ratio.dividing(this.target_weight_ratio)) / 100 + } + // Get the current percentage of reserved units - public get reserved() { + public get reserved_legacy() { return new BN(String(this.utilization)) / new BN(String(this.weight)) } + public get reserved(): Int64 { + return this.utilization.dividing(this.weight) + } + // Get the symbol definition for the token public get symbol() { return this.min_price.symbol } - // Common casting for typed values to numbers - cast() { - return { - adjusted_utilization: String(this.adjusted_utilization), - decay_secs: Number(this.decay_secs.value), - exponent: Number(this.exponent), - utilization: String(this.utilization), - utilization_timestamp: Number(this.utilization_timestamp.value), - weight: new BN(String(this.weight)), - weight_ratio: Number(this.weight_ratio), - } - } - // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L358 - utilization_increase(sample: UInt128, frac) { + utilization_increase_legacy(frac) { const {weight} = this const frac128 = UInt128.from(frac) const utilization_increase = @@ -73,54 +69,92 @@ export abstract class PowerUpStateResource extends Struct { return Math.ceil(utilization_increase) } + utilization_increase(frac: UInt128) { + const base = intToBigDecimal(frac) + const weight = intToBigDecimal(this.weight) + const multiplier = intToBigDecimal(Math.pow(10, 15)) + return UInt128.from(base.multiply(weight).divide(multiplier, 15).ceil().getValue()) + } + // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L284-L298 - price_function(utilization: number): number { - const {exponent, weight} = this.cast() + price_function_legacy(utilization: Int64): number { + const {exponent, weight} = this const max_price: number = this.max_price.value const min_price: number = this.min_price.value let price = min_price - const new_exponent = exponent - 1.0 + const new_exponent = Number(exponent) - 1.0 if (new_exponent <= 0.0) { return max_price } else { - const util_weight = new BN(utilization) / weight - price += (max_price - min_price) * Math.pow(util_weight, new_exponent) + const util_weight = intToBigDecimal(utilization).divide(intToBigDecimal(weight), 18) + const difference = max_price - min_price + price += difference * Math.pow(Number(util_weight.getValue()), new_exponent) + } + return price + } + + price_function(utilization: Int64): number { + const {weight} = this + let price = this.min_price.value + const new_exponent = Number(this.exponent) - 1.0 + if (new_exponent <= 0.0) { + return this.max_price.value + } else { + // const util_weight = utilization.dividing(weight) + const util_weight = intToBigDecimal(utilization).divide(intToBigDecimal(weight), 18) + const difference = this.max_price.value - this.min_price.value + price += difference * Math.pow(Number(util_weight.getValue()), new_exponent) } return price } // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L274-L280 - price_integral_delta(start_utilization: Int64, end_utilization: Int64): number { - const {exponent, weight} = this.cast() + price_integral_delta_legacy(start_utilization: Int64, end_utilization: Int64): number { + const {exponent, weight} = this const max_price: number = this.max_price.value const min_price: number = this.min_price.value - const coefficient = (max_price - min_price) / exponent + const coefficient = (max_price - min_price) / exponent.value const start_u = Number(start_utilization.dividing(weight)) const end_u = Number(end_utilization.dividing(weight)) const delta = min_price * end_u - min_price * start_u + - coefficient * Math.pow(end_u, exponent) - - coefficient * Math.pow(start_u, exponent) + coefficient * Math.pow(end_u, exponent.value) - + coefficient * Math.pow(start_u, exponent.value) + return delta + } + + price_integral_delta(start_utilization: Int64, end_utilization: Int64): number { + const difference = Asset.fromUnits( + this.max_price.units.subtracting(this.min_price.units), + this.symbol + ) + const coefficient = difference.value / this.exponent.value + const start_u = Number(start_utilization.dividing(this.weight)) + const end_u = Number(end_utilization.dividing(this.weight)) + const delta = + this.min_price.value * end_u - + this.min_price.value * start_u + + coefficient * Math.pow(end_u, this.exponent.value) - + coefficient * Math.pow(start_u, this.exponent.value) return delta } // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L262-L315 - fee(utilization_increase, adjusted_utilization) { - const {weight} = this.cast() - const {utilization} = this + fee_legacy(utilization_increase, adjusted_utilization) { + const {utilization, weight} = this let start_utilization = Int64.from(utilization) const end_utilization = start_utilization.adding(utilization_increase) let fee = 0 - if (start_utilization < adjusted_utilization) { + if (start_utilization.lt(adjusted_utilization)) { const min = Math.min( utilization_increase, adjusted_utilization.subtracting(start_utilization) ) fee += Number( - new bigDecimal(this.price_function(adjusted_utilization) * min) + new bigDecimal(this.price_function_legacy(adjusted_utilization) * min) .divide(new bigDecimal(weight.toString())) .getValue() ) @@ -132,11 +166,36 @@ export abstract class PowerUpStateResource extends Struct { return fee } + fee(utilization_increase: UInt128, adjusted_utilization: Int64) { + const {utilization, weight} = this + + let start_utilization = Int64.from(utilization) + const end_utilization = start_utilization.adding(utilization_increase) + + let fee = 0 + if (start_utilization.lt(adjusted_utilization)) { + const min = Math.min( + Number(utilization_increase), + Number(adjusted_utilization.subtracting(start_utilization)) + ) + fee += Number( + intToBigDecimal(this.price_function(adjusted_utilization) * min) + .divide(intToBigDecimal(weight)) + .getValue() + ) + + start_utilization = adjusted_utilization + } + if (start_utilization.gt(end_utilization)) { + fee += this.price_integral_delta(start_utilization, end_utilization) + } + return fee + } + // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L105-L117 determine_adjusted_utilization(options?: PowerUpStateOptions) { // Casting EOSIO types to usable formats for JS calculations - const {decay_secs, utilization_timestamp} = this.cast() - const {utilization} = this + const {decay_secs, utilization, utilization_timestamp} = this let {adjusted_utilization} = this // If utilization is less than adjusted, calculate real time value if (utilization.lt(adjusted_utilization)) { @@ -144,7 +203,9 @@ export abstract class PowerUpStateResource extends Struct { const ts = options && options.timestamp ? options.timestamp : new Date() const now = TimePointSec.from(ts).toMilliseconds() / 1000 const diff = adjusted_utilization.subtracting(utilization).toNumber() - let delta: number = diff * Math.exp(-(now - utilization_timestamp) / decay_secs) + let delta: number = + diff * + Math.exp(-(now - utilization_timestamp.toMilliseconds()) / Number(decay_secs)) delta = Math.min(Math.max(delta, 0), diff) // Clamp the delta adjusted_utilization = utilization.adding(delta) } diff --git a/src/powerup/cpu.ts b/src/powerup/cpu.ts index 5259f65..8fc0929 100644 --- a/src/powerup/cpu.ts +++ b/src/powerup/cpu.ts @@ -1,9 +1,8 @@ -import {Struct, UInt128} from '@wharfkit/antelope' +import {Int64, Int64Type, Struct, UInt128, UInt128Type} from '@wharfkit/antelope' -import {BNPrecision, SampleUsage} from '..' +import {BNPrecision, intToBigDecimal, SampleUsage} from '..' import {PowerUpStateResource} from './abstract' import {PowerUpStateOptions} from './options' -import BN from 'bn.js' @Struct.type('powerupstateresourcecpu') export class PowerUpStateResourceCPU extends PowerUpStateResource { @@ -25,52 +24,86 @@ export class PowerUpStateResourceCPU extends PowerUpStateResource { } // Convert weight to μs (microseconds) - weight_to_us(sample: UInt128, weight: number): number { + weight_to_us_legacy(sample: UInt128, weight: number): number { return Math.ceil((weight * Number(sample)) / BNPrecision) } + weight_to_us(sample: UInt128Type, weight: Int64Type): UInt128 { + return UInt128.from( + UInt128.from(weight).multiplying(Int64.from(sample)).dividing(BNPrecision, 'ceil') + ) + } // Convert μs (microseconds) to weight - us_to_weight(sample: UInt128, us: number): number { - return Math.floor((us / Number(sample)) * BNPrecision) + us_to_weight_legacy(sample: UInt128, us: number): number { + const sampled = intToBigDecimal(sample) + return Math.floor((us / Number(sampled.getValue())) * BNPrecision) + } + us_to_weight(sample: UInt128, us: Int64Type): Int64 { + return Int64.from(us).multiplying(BNPrecision).dividing(Int64.from(sample), 'floor') } // Default frac generation by smallest unit type + frac_legacy = (usage: SampleUsage, us: number) => this.frac_by_us_legacy(usage, us) frac = (usage: SampleUsage, us: number) => this.frac_by_us(usage, us) // Frac generation by ms (milliseconds) + frac_by_ms_legacy = (usage: SampleUsage, ms: number) => this.frac_by_us_legacy(usage, ms * 1000) frac_by_ms = (usage: SampleUsage, ms: number) => this.frac_by_us(usage, ms * 1000) // Frac generation by μs (microseconds) - frac_by_us(usage: SampleUsage, us: number) { - const {weight} = this.cast() - const frac = new BN(this.us_to_weight(usage.cpu, us)) / weight - return Math.floor(frac * Math.pow(10, 15)) + frac_by_us_legacy(usage: SampleUsage, us: number) { + const converted = intToBigDecimal(this.us_to_weight_legacy(usage.cpu, us)) + const current = intToBigDecimal(this.weight) + const frac = converted.divide(current, 18) + return Math.floor(Number(frac.getValue()) * Math.pow(10, 15)) + } + frac_by_us(usage: SampleUsage, us: Int64Type): Int64 { + const precision = 15 + const converted = intToBigDecimal(this.us_to_weight(usage.cpu, us)) + const current = intToBigDecimal(this.weight) + const multiplier = intToBigDecimal(Math.pow(10, precision)) + const frac = converted.divide(current, precision).multiply(multiplier) + return Int64.from(frac.getValue()) } // Price generation by smallest units, μs (microseconds) + price_per_legacy = (usage: SampleUsage, us = 1000, options?: PowerUpStateOptions): number => + this.price_per_us_legacy(usage, us, options) price_per = (usage: SampleUsage, us = 1000, options?: PowerUpStateOptions): number => this.price_per_us(usage, us, options) // Price generation by ms (milliseconds) + price_per_ms_legacy = (usage: SampleUsage, ms = 1, options?: PowerUpStateOptions): number => + this.price_per_us_legacy(usage, ms * 1000, options) price_per_ms = (usage: SampleUsage, ms = 1, options?: PowerUpStateOptions): number => this.price_per_us(usage, ms * 1000, options) // Price generation by μs (microseconds) + price_per_us_legacy(usage: SampleUsage, us = 1000, options?: PowerUpStateOptions): number { + // Determine the utilization increase by this action + const frac = UInt128.from(this.frac_legacy(usage, us)) + const utilization_increase = this.utilization_increase_legacy(frac) + // Determine the adjusted utilization if needed + const adjusted_utilization = this.determine_adjusted_utilization(options) + // Derive the fee from the increase and utilization + const fee = this.fee_legacy(utilization_increase, adjusted_utilization) + // Force the fee up to the next highest value of precision + const precision = Math.pow(10, this.max_price.symbol.precision) + const value = Math.ceil(fee * precision) / precision + // Return the modified fee + return value + } price_per_us(usage: SampleUsage, us = 1000, options?: PowerUpStateOptions): number { // Determine the utilization increase by this action const frac = UInt128.from(this.frac(usage, us)) - const utilization_increase = this.utilization_increase(usage.cpu, frac) - + const utilization_increase = this.utilization_increase(frac) // Determine the adjusted utilization if needed const adjusted_utilization = this.determine_adjusted_utilization(options) - // Derive the fee from the increase and utilization const fee = this.fee(utilization_increase, adjusted_utilization) - // Force the fee up to the next highest value of precision const precision = Math.pow(10, this.max_price.symbol.precision) const value = Math.ceil(fee * precision) / precision - // Return the modified fee return value } diff --git a/src/powerup/net.ts b/src/powerup/net.ts index 1033a18..1f392c4 100644 --- a/src/powerup/net.ts +++ b/src/powerup/net.ts @@ -1,9 +1,9 @@ -import {Struct, UInt128} from '@wharfkit/antelope' +import {Int64, Int64Type, Struct, UInt128} from '@wharfkit/antelope' +import BN from 'bn.js' -import {BNPrecision, SampleUsage} from '..' +import {BNPrecision, intToBigDecimal, SampleUsage} from '..' import {PowerUpStateResource} from './abstract' import {PowerUpStateOptions} from './options' -import BN from 'bn.js' @Struct.type('powerupstateresourcenet') export class PowerUpStateResourceNET extends PowerUpStateResource { @@ -25,42 +25,85 @@ export class PowerUpStateResourceNET extends PowerUpStateResource { } // Convert weight to bytes - weight_to_bytes(sample: UInt128, weight: number): number { + weight_to_bytes_legacy(sample: UInt128, weight: number): number { return Math.ceil((weight * Number(sample)) / BNPrecision) } + weight_to_bytes(sample: UInt128, weight: number): UInt128 { + return UInt128.from( + UInt128.from(weight).multiplying(Int64.from(sample)).dividing(BNPrecision, 'ceil') + ) + } // Convert bytes to weight - bytes_to_weight(sample: UInt128, bytes: number): number { + bytes_to_weight_legacy(sample: UInt128, bytes: number): number { return Math.floor((bytes / Number(sample)) * BNPrecision) } + bytes_to_weight(sample: UInt128, bytes: Int64Type): Int64 { + return Int64.from(bytes).multiplying(BNPrecision).dividing(Int64.from(sample), 'floor') + } // Default frac generation by smallest unit type + frac_legacy = (usage: SampleUsage, bytes: number) => this.frac_by_bytes_legacy(usage, bytes) frac = (usage: SampleUsage, bytes: number) => this.frac_by_bytes(usage, bytes) // Frac generation by kb + frac_by_kb_legacy = (usage: SampleUsage, kilobytes: number) => + this.frac_by_bytes_legacy(usage, kilobytes * 1000) frac_by_kb = (usage: SampleUsage, kilobytes: number) => this.frac_by_bytes(usage, kilobytes * 1000) // Frac generation by bytes - frac_by_bytes(usage: SampleUsage, bytes: number) { - const {weight} = this.cast() - const frac = new BN(this.bytes_to_weight(usage.net, bytes)) / weight + frac_by_bytes_legacy(usage: SampleUsage, bytes: number) { + const {weight} = this + const frac = new BN(this.bytes_to_weight_legacy(usage.net, bytes)) / Number(weight) return Math.floor(frac * Math.pow(10, 15)) } + frac_by_bytes(usage: SampleUsage, bytes: Int64Type): Int64 { + const precision = 15 + const converted = intToBigDecimal(this.bytes_to_weight(usage.net, bytes)) + const current = intToBigDecimal(this.weight) + const multiplier = intToBigDecimal(Math.pow(10, precision)) + const frac = converted.divide(current, precision).multiply(multiplier) + return Int64.from(frac.getValue()) + } // Price generation by smallest units, bytes + price_per_legacy = (usage: SampleUsage, bytes = 1000, options?: PowerUpStateOptions) => + this.price_per_byte_legacy(usage, bytes, options) price_per = (usage: SampleUsage, bytes = 1000, options?: PowerUpStateOptions) => this.price_per_byte(usage, bytes, options) // Price generation by kb + price_per_kb_legacy = ( + usage: SampleUsage, + kilobytes = 1, + options?: PowerUpStateOptions + ): number => this.price_per_byte_legacy(usage, kilobytes * 1000, options) price_per_kb = (usage: SampleUsage, kilobytes = 1, options?: PowerUpStateOptions): number => this.price_per_byte(usage, kilobytes * 1000, options) // Price generation by bytes + price_per_byte_legacy(usage: SampleUsage, bytes = 1000, options?: PowerUpStateOptions): number { + // Determine the utilization increase by this action + const frac = UInt128.from(this.frac_legacy(usage, bytes)) + const utilization_increase = this.utilization_increase_legacy(frac) + + // Determine the adjusted utilization if needed + const adjusted_utilization = this.determine_adjusted_utilization(options) + + // Derive the fee from the increase and utilization + const fee = this.fee_legacy(utilization_increase, adjusted_utilization) + + const precision = Math.pow(10, this.max_price.symbol.precision) + const value = Math.ceil(fee * precision) / precision + + // Return the modified fee + return value + } price_per_byte(usage: SampleUsage, bytes = 1000, options?: PowerUpStateOptions): number { // Determine the utilization increase by this action const frac = UInt128.from(this.frac(usage, bytes)) - const utilization_increase = this.utilization_increase(usage.net, frac) + const utilization_increase = this.utilization_increase(frac) // Determine the adjusted utilization if needed const adjusted_utilization = this.determine_adjusted_utilization(options) diff --git a/test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json b/test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json new file mode 100644 index 0000000..1a91160 --- /dev/null +++ b/test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json @@ -0,0 +1,19 @@ +{ + "request": { + "path": "https://jungle4.greymass.com/v1/chain/get_table_rows", + "params": { + "method": "POST", + "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", + "headers": {} + } + }, + "status": 200, + "json": { + "rows": [ + "00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f5300000000458406b2310b0000454ff94f300b000015e37468000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c62be9e3a52200000dc40511d822000015e3746801000000e80300000000000004454f5300000000" + ], + "more": false, + "next_key": "" + }, + "text": "{\"rows\":[\"00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f5300000000458406b2310b0000454ff94f300b000015e37468000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c62be9e3a52200000dc40511d822000015e3746801000000e80300000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\"}" +} \ No newline at end of file diff --git a/test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json b/test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json new file mode 100644 index 0000000..80f0a1e --- /dev/null +++ b/test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json @@ -0,0 +1,33 @@ +{ + "request": { + "path": "https://eos.greymass.com/v1/chain/get_info", + "params": { + "method": "GET", + "headers": {} + } + }, + "status": 200, + "json": { + "server_version": "57465074", + "chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906", + "head_block_num": 446536657, + "last_irreversible_block_num": 446536655, + "last_irreversible_block_id": "1a9d9bcf41609405b18e2821acec0fc5398de1c5dd5955b6be2864b16721784e", + "head_block_id": "1a9d9bd1ac958b58d25cd4a033ebfd3c9d4a16f21d1aef871989e3aaac9eb980", + "head_block_time": "2025-07-14T21:47:31.000", + "head_block_producer": "aus1genereos", + "virtual_block_cpu_limit": 200000, + "virtual_block_net_limit": 1048576000, + "block_cpu_limit": 200000, + "block_net_limit": 1048576, + "server_version_string": "v1.0.1", + "fork_db_head_block_num": 446536657, + "fork_db_head_block_id": "1a9d9bd1ac958b58d25cd4a033ebfd3c9d4a16f21d1aef871989e3aaac9eb980", + "server_full_version_string": "v1.0.1-574650744460373f635d48cac9aa6dee67dcbfdb", + "total_cpu_weight": "382521459045091", + "total_net_weight": "95689592403490", + "earliest_available_block_num": 446363673, + "last_irreversible_block_time": "2025-07-14T21:47:30.000" + }, + "text": "{\"server_version\":\"57465074\",\"chain_id\":\"aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906\",\"head_block_num\":446536657,\"last_irreversible_block_num\":446536655,\"last_irreversible_block_id\":\"1a9d9bcf41609405b18e2821acec0fc5398de1c5dd5955b6be2864b16721784e\",\"head_block_id\":\"1a9d9bd1ac958b58d25cd4a033ebfd3c9d4a16f21d1aef871989e3aaac9eb980\",\"head_block_time\":\"2025-07-14T21:47:31.000\",\"head_block_producer\":\"aus1genereos\",\"virtual_block_cpu_limit\":200000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v1.0.1\",\"fork_db_head_block_num\":446536657,\"fork_db_head_block_id\":\"1a9d9bd1ac958b58d25cd4a033ebfd3c9d4a16f21d1aef871989e3aaac9eb980\",\"server_full_version_string\":\"v1.0.1-574650744460373f635d48cac9aa6dee67dcbfdb\",\"total_cpu_weight\":\"382521459045091\",\"total_net_weight\":\"95689592403490\",\"earliest_available_block_num\":446363673,\"last_irreversible_block_time\":\"2025-07-14T21:47:30.000\"}" +} \ No newline at end of file diff --git a/test/data/5e784e00fc6d9fb01a8843f6e251e6811459169c.json b/test/data/5e784e00fc6d9fb01a8843f6e251e6811459169c.json index 3bb36ac..75d9a95 100644 --- a/test/data/5e784e00fc6d9fb01a8843f6e251e6811459169c.json +++ b/test/data/5e784e00fc6d9fb01a8843f6e251e6811459169c.json @@ -3,7 +3,8 @@ "path": "https://eos.greymass.com/v1/chain/get_account", "params": { "method": "POST", - "body": "{\"account_name\":\"b1\"}" + "body": "{\"account_name\":\"b1\"}", + "headers": {} } }, "status": 200, @@ -127,4 +128,4 @@ "eosio_any_linked_actions": [] }, "text": "{\"account_name\":\"b1\",\"head_block_num\":340895515,\"head_block_time\":\"2023-11-10T17:36:13.000\",\"privileged\":false,\"last_code_update\":\"1970-01-01T00:00:00.000\",\"created\":\"2018-06-09T11:58:03.500\",\"core_liquid_balance\":\"0.2966 EOS\",\"ram_quota\":9487,\"net_weight\":\"350078512340\",\"cpu_weight\":\"296624975145\",\"net_limit\":{\"used\":271,\"available\":\"660087025601\",\"max\":\"660087025872\",\"last_usage_update_time\":\"2022-08-23T01:41:35.000\",\"current_used\":0},\"cpu_limit\":{\"used\":4647,\"available\":26738756,\"max\":26743403,\"last_usage_update_time\":\"2022-08-23T01:41:35.000\",\"current_used\":0},\"ram_usage\":5010,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":2,\"keys\":[{\"key\":\"EOS5BUDFbb2erXiRP8qHQAgVboCHgHGesbCubUfgXYJhnYZKSqNbD\",\"weight\":1},{\"key\":\"EOS6hQ6v8vut1V2giQCYha7J225GCzFJtF3o7fy8JYuN7k6fG4n23\",\"weight\":1},{\"key\":\"EOS7RodmQofvAxgYBJzfNuwRKr6TWh5LbCBfB4uQ8tjrjQ8Ukkwqq\",\"weight\":1},{\"key\":\"EOS7c9jHNgbtTMYgpXvmTb1kW61oH6kwfGioWk75ugDMhsywe6rWu\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":2,\"keys\":[{\"key\":\"EOS5BUDFbb2erXiRP8qHQAgVboCHgHGesbCubUfgXYJhnYZKSqNbD\",\"weight\":1},{\"key\":\"EOS6hQ6v8vut1V2giQCYha7J225GCzFJtF3o7fy8JYuN7k6fG4n23\",\"weight\":1},{\"key\":\"EOS7RodmQofvAxgYBJzfNuwRKr6TWh5LbCBfB4uQ8tjrjQ8Ukkwqq\",\"weight\":1},{\"key\":\"EOS7c9jHNgbtTMYgpXvmTb1kW61oH6kwfGioWk75ugDMhsywe6rWu\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]}],\"total_resources\":{\"owner\":\"b1\",\"net_weight\":\"35007851.2340 EOS\",\"cpu_weight\":\"29662497.5145 EOS\",\"ram_bytes\":8087},\"self_delegated_bandwidth\":{\"from\":\"b1\",\"to\":\"b1\",\"net_weight\":\"35007851.2340 EOS\",\"cpu_weight\":\"29662497.5145 EOS\"},\"refund_request\":null,\"voter_info\":{\"owner\":\"b1\",\"proxy\":\"\",\"producers\":[],\"staked\":\"646723487485\",\"last_vote_weight\":\"2768257912613634048.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0.0000 EOS\"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":0,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" -} \ No newline at end of file +} diff --git a/test/data/618bea5f5551dede21edba216e12db446ca68486.json b/test/data/618bea5f5551dede21edba216e12db446ca68486.json new file mode 100644 index 0000000..8769237 --- /dev/null +++ b/test/data/618bea5f5551dede21edba216e12db446ca68486.json @@ -0,0 +1,19 @@ +{ + "request": { + "path": "https://eos.greymass.com/v1/chain/get_table_rows", + "params": { + "method": "POST", + "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rexpool\",\"key_type\":\"name\",\"json\":false}", + "headers": {} + } + }, + "status": 200, + "json": { + "rows": [ + "003c6ed8140700000004454f5300000000c6cb1eb08700000004454f5300000000fef112020000000004454f5300000000023af7c48e00000004454f5300000000aeec1953f67015000452455800000000000000000000000004454f5300000000f2ad070000000000" + ], + "more": false, + "next_key": "" + }, + "text": "{\"rows\":[\"003c6ed8140700000004454f5300000000c6cb1eb08700000004454f5300000000fef112020000000004454f5300000000023af7c48e00000004454f5300000000aeec1953f67015000452455800000000000000000000000004454f5300000000f2ad070000000000\"],\"more\":false,\"next_key\":\"\"}" +} diff --git a/test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json b/test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json new file mode 100644 index 0000000..d345522 --- /dev/null +++ b/test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json @@ -0,0 +1,176 @@ +{ + "request": { + "path": "https://wax.greymass.com/v1/chain/get_account", + "params": { + "method": "POST", + "body": "{\"account_name\":\"boost.wax\"}", + "headers": {} + } + }, + "status": 200, + "json": { + "account_name": "boost.wax", + "head_block_num": 382100572, + "head_block_time": "2025-07-14T21:47:41.500", + "privileged": false, + "last_code_update": "2022-11-01T21:44:57.500", + "created": "2020-04-09T20:28:34.500", + "core_liquid_balance": "3796281.62693477 WAX", + "ram_quota": 106721149, + "net_weight": "30001100000000", + "cpu_weight": "770055200000000", + "net_limit": { + "used": 1914466, + "available": "14056505669", + "max": "14058420135", + "last_usage_update_time": "2025-07-14T21:47:22.500", + "current_used": 1914045 + }, + "cpu_limit": { + "used": 1305735, + "available": 200004187, + "max": 201309922, + "last_usage_update_time": "2025-07-14T21:47:22.500", + "current_used": 1305448 + }, + "ram_usage": 13138903, + "permissions": [ + { + "perm_name": "active", + "parent": "owner", + "required_auth": { + "threshold": 1, + "keys": [], + "accounts": [ + { + "permission": { + "actor": "admin.wax", + "permission": "active" + }, + "weight": 1 + }, + { + "permission": { + "actor": "boost.wax", + "permission": "eosio.code" + }, + "weight": 1 + } + ], + "waits": [] + }, + "linked_actions": [] + }, + { + "perm_name": "deploy", + "parent": "active", + "required_auth": { + "threshold": 1, + "keys": [], + "accounts": [ + { + "permission": { + "actor": "deploy.wax", + "permission": "all" + }, + "weight": 1 + } + ], + "waits": [] + }, + "linked_actions": [ + { + "account": "eosio", + "action": "setcode" + }, + { + "account": "eosio", + "action": "setabi" + } + ] + }, + { + "perm_name": "owner", + "parent": "", + "required_auth": { + "threshold": 1, + "keys": [], + "accounts": [ + { + "permission": { + "actor": "admin.wax", + "permission": "active" + }, + "weight": 1 + } + ], + "waits": [] + }, + "linked_actions": [] + }, + { + "perm_name": "paybw", + "parent": "active", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS5B2c2wNjaq342758aYvE71dTxpBVqHocnRU1aWxUdZAuxbgM6f", + "weight": 1 + } + ], + "accounts": [ + { + "permission": { + "actor": "oracle.wax", + "permission": "rngops" + }, + "weight": 1 + } + ], + "waits": [] + }, + "linked_actions": [ + { + "account": "boost.wax", + "action": "noop" + } + ] + } + ], + "total_resources": { + "owner": "boost.wax", + "net_weight": "300011.00000000 WAX", + "cpu_weight": "7700552.00000000 WAX", + "ram_bytes": 106719749 + }, + "self_delegated_bandwidth": null, + "refund_request": null, + "voter_info": { + "owner": "boost.wax", + "proxy": "", + "producers": [], + "staked": 0, + "unpaid_voteshare": "0.00000000000000000", + "unpaid_voteshare_last_updated": "1970-01-01T00:00:00.000", + "unpaid_voteshare_change_rate": "0.00000000000000000", + "last_claim_time": "1970-01-01T00:00:00.000", + "last_vote_weight": "0.00000000000000000", + "proxied_vote_weight": "0.00000000000000000", + "is_proxy": 0, + "flags1": 0, + "reserved2": 0, + "reserved3": "0 " + }, + "rex_info": null, + "subjective_cpu_bill_limit": { + "used": 20477, + "available": 0, + "max": 0, + "last_usage_update_time": "2000-01-01T00:00:00.000", + "current_used": 0 + }, + "eosio_any_linked_actions": [] + }, + "text": "{\"account_name\":\"boost.wax\",\"head_block_num\":382100572,\"head_block_time\":\"2025-07-14T21:47:41.500\",\"privileged\":false,\"last_code_update\":\"2022-11-01T21:44:57.500\",\"created\":\"2020-04-09T20:28:34.500\",\"core_liquid_balance\":\"3796281.62693477 WAX\",\"ram_quota\":106721149,\"net_weight\":\"30001100000000\",\"cpu_weight\":\"770055200000000\",\"net_limit\":{\"used\":1914466,\"available\":\"14056505669\",\"max\":\"14058420135\",\"last_usage_update_time\":\"2025-07-14T21:47:22.500\",\"current_used\":1914045},\"cpu_limit\":{\"used\":1305735,\"available\":200004187,\"max\":201309922,\"last_usage_update_time\":\"2025-07-14T21:47:22.500\",\"current_used\":1305448},\"ram_usage\":13138903,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"admin.wax\",\"permission\":\"active\"},\"weight\":1},{\"permission\":{\"actor\":\"boost.wax\",\"permission\":\"eosio.code\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"deploy\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"deploy.wax\",\"permission\":\"all\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[{\"account\":\"eosio\",\"action\":\"setcode\"},{\"account\":\"eosio\",\"action\":\"setabi\"}]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"admin.wax\",\"permission\":\"active\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"paybw\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS5B2c2wNjaq342758aYvE71dTxpBVqHocnRU1aWxUdZAuxbgM6f\",\"weight\":1}],\"accounts\":[{\"permission\":{\"actor\":\"oracle.wax\",\"permission\":\"rngops\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[{\"account\":\"boost.wax\",\"action\":\"noop\"}]}],\"total_resources\":{\"owner\":\"boost.wax\",\"net_weight\":\"300011.00000000 WAX\",\"cpu_weight\":\"7700552.00000000 WAX\",\"ram_bytes\":106719749},\"self_delegated_bandwidth\":null,\"refund_request\":null,\"voter_info\":{\"owner\":\"boost.wax\",\"proxy\":\"\",\"producers\":[],\"staked\":0,\"unpaid_voteshare\":\"0.00000000000000000\",\"unpaid_voteshare_last_updated\":\"1970-01-01T00:00:00.000\",\"unpaid_voteshare_change_rate\":\"0.00000000000000000\",\"last_claim_time\":\"1970-01-01T00:00:00.000\",\"last_vote_weight\":\"0.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0 \"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":20477,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" +} \ No newline at end of file diff --git a/test/data/6757c3f434961f4b54c70c4b133e2fbeb1f75dfa.json b/test/data/6757c3f434961f4b54c70c4b133e2fbeb1f75dfa.json new file mode 100644 index 0000000..c37338c --- /dev/null +++ b/test/data/6757c3f434961f4b54c70c4b133e2fbeb1f75dfa.json @@ -0,0 +1,96 @@ +{ + "request": { + "path": "https://eos.greymass.com/v1/chain/get_account", + "params": { + "method": "POST", + "body": "{\"account_name\":\"eosio.reserv\"}", + "headers": {} + } + }, + "status": 200, + "json": { + "account_name": "eosio.reserv", + "head_block_num": 446530512, + "head_block_time": "2025-07-14T20:56:17.000", + "privileged": false, + "last_code_update": "1970-01-01T00:00:00.000", + "created": "2021-02-07T15:45:07.500", + "ram_quota": 9587, + "net_weight": "95356278485774", + "cpu_weight": "362246729107787", + "net_limit": { + "used": 0, + "available": "180562783078374", + "max": "180562783078374", + "last_usage_update_time": "2021-02-07T15:45:07.500", + "current_used": 0 + }, + "cpu_limit": { + "used": 0, + "available": "32728221285", + "max": "32728221285", + "last_usage_update_time": "2021-02-07T15:45:07.500", + "current_used": 0 + }, + "ram_usage": 3212, + "permissions": [ + { + "perm_name": "active", + "parent": "owner", + "required_auth": { + "threshold": 1, + "keys": [], + "accounts": [ + { + "permission": { + "actor": "eosio", + "permission": "active" + }, + "weight": 1 + } + ], + "waits": [] + }, + "linked_actions": [] + }, + { + "perm_name": "owner", + "parent": "", + "required_auth": { + "threshold": 1, + "keys": [], + "accounts": [ + { + "permission": { + "actor": "eosio", + "permission": "active" + }, + "weight": 1 + } + ], + "waits": [] + }, + "linked_actions": [] + } + ], + "total_resources": { + "owner": "eosio.reserv", + "net_weight": "9535627848.5774 EOS", + "cpu_weight": "36224672910.7787 EOS", + "ram_bytes": 8187 + }, + "self_delegated_bandwidth": null, + "refund_request": null, + "voter_info": null, + "rex_info": null, + "subjective_cpu_bill_limit": { + "used": 0, + "available": 0, + "max": 0, + "last_usage_update_time": "2000-01-01T00:00:00.000", + "current_used": 0 + }, + "eosio_any_linked_actions": [] + }, + "text": "{\"account_name\":\"eosio.reserv\",\"head_block_num\":446530512,\"head_block_time\":\"2025-07-14T20:56:17.000\",\"privileged\":false,\"last_code_update\":\"1970-01-01T00:00:00.000\",\"created\":\"2021-02-07T15:45:07.500\",\"ram_quota\":9587,\"net_weight\":\"95356278485774\",\"cpu_weight\":\"362246729107787\",\"net_limit\":{\"used\":0,\"available\":\"180562783078374\",\"max\":\"180562783078374\",\"last_usage_update_time\":\"2021-02-07T15:45:07.500\",\"current_used\":0},\"cpu_limit\":{\"used\":0,\"available\":\"32728221285\",\"max\":\"32728221285\",\"last_usage_update_time\":\"2021-02-07T15:45:07.500\",\"current_used\":0},\"ram_usage\":3212,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"eosio\",\"permission\":\"active\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"eosio\",\"permission\":\"active\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]}],\"total_resources\":{\"owner\":\"eosio.reserv\",\"net_weight\":\"9535627848.5774 EOS\",\"cpu_weight\":\"36224672910.7787 EOS\",\"ram_bytes\":8187},\"self_delegated_bandwidth\":null,\"refund_request\":null,\"voter_info\":null,\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":0,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" +} \ No newline at end of file diff --git a/test/data/714c990e6ea2e283c39d1f3a8d1b7680fedaed53.json b/test/data/714c990e6ea2e283c39d1f3a8d1b7680fedaed53.json index fa01240..1c975f3 100644 --- a/test/data/714c990e6ea2e283c39d1f3a8d1b7680fedaed53.json +++ b/test/data/714c990e6ea2e283c39d1f3a8d1b7680fedaed53.json @@ -3,7 +3,8 @@ "path": "https://wax.greymass.com/v1/chain/get_table_rows", "params": { "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}" + "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", + "headers": {} } }, "status": 200, diff --git a/test/data/79c5170d875b36823010af2a74154bbd509bc3bc.json b/test/data/79c5170d875b36823010af2a74154bbd509bc3bc.json index 53fefa9..5ca0da6 100644 --- a/test/data/79c5170d875b36823010af2a74154bbd509bc3bc.json +++ b/test/data/79c5170d875b36823010af2a74154bbd509bc3bc.json @@ -3,7 +3,8 @@ "path": "https://eos.greymass.com/v1/chain/get_table_rows", "params": { "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}" + "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", + "headers": {} } }, "status": 200, @@ -15,4 +16,4 @@ "next_key": "" }, "text": "{\"rows\":[\"00002ae97f9fd056000000a0724e180900004e79bb7de00000000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000076ba22b5b0000009ece299b75000000e7694e6500a8a4ff7d425b010000a0724e1809000038e5edf6810300000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f530000000091b4bf6d671b00000724ec6d6c1b0000e7694e6501000000010000000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\"}" -} \ No newline at end of file +} diff --git a/test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json b/test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json new file mode 100644 index 0000000..17798d2 --- /dev/null +++ b/test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json @@ -0,0 +1,33 @@ +{ + "request": { + "path": "https://wax.greymass.com/v1/chain/get_info", + "params": { + "method": "GET", + "headers": {} + } + }, + "status": 200, + "json": { + "server_version": "b18375f7", + "chain_id": "1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4", + "head_block_num": 382100568, + "last_irreversible_block_num": 382100236, + "last_irreversible_block_id": "16c6630c95a000c54c3b8c1f62d31334bb0e766274643da69d015ec43381e2cd", + "head_block_id": "16c66458aa51154f60e748154db514dd6b62d9937b6ae04e8990c18bd60e11e5", + "head_block_time": "2025-07-14T21:47:39.500", + "head_block_producer": "wombatblockx", + "virtual_block_cpu_limit": 201403, + "virtual_block_net_limit": 1048576000, + "block_cpu_limit": 200000, + "block_net_limit": 1048576, + "server_version_string": "v5.0.3wax01", + "fork_db_head_block_num": 382100568, + "fork_db_head_block_id": "16c66458aa51154f60e748154db514dd6b62d9937b6ae04e8990c18bd60e11e5", + "server_full_version_string": "v5.0.3wax01-b18375f72cde5e3dbc31bcff1d4f546065975d1a", + "total_cpu_weight": "133659827352183743", + "total_net_weight": "386673413163967500", + "earliest_available_block_num": 381927067, + "last_irreversible_block_time": "2025-07-14T21:44:53.500" + }, + "text": "{\"server_version\":\"b18375f7\",\"chain_id\":\"1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4\",\"head_block_num\":382100568,\"last_irreversible_block_num\":382100236,\"last_irreversible_block_id\":\"16c6630c95a000c54c3b8c1f62d31334bb0e766274643da69d015ec43381e2cd\",\"head_block_id\":\"16c66458aa51154f60e748154db514dd6b62d9937b6ae04e8990c18bd60e11e5\",\"head_block_time\":\"2025-07-14T21:47:39.500\",\"head_block_producer\":\"wombatblockx\",\"virtual_block_cpu_limit\":201403,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v5.0.3wax01\",\"fork_db_head_block_num\":382100568,\"fork_db_head_block_id\":\"16c66458aa51154f60e748154db514dd6b62d9937b6ae04e8990c18bd60e11e5\",\"server_full_version_string\":\"v5.0.3wax01-b18375f72cde5e3dbc31bcff1d4f546065975d1a\",\"total_cpu_weight\":\"133659827352183743\",\"total_net_weight\":\"386673413163967500\",\"earliest_available_block_num\":381927067,\"last_irreversible_block_time\":\"2025-07-14T21:44:53.500\"}" +} \ No newline at end of file diff --git a/test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json b/test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json new file mode 100644 index 0000000..beda353 --- /dev/null +++ b/test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json @@ -0,0 +1,148 @@ +{ + "request": { + "path": "https://eos.greymass.com/v1/chain/get_account", + "params": { + "method": "POST", + "body": "{\"account_name\":\"greymassfuel\"}", + "headers": {} + } + }, + "status": 200, + "json": { + "account_name": "greymassfuel", + "head_block_num": 446695067, + "head_block_time": "2025-07-15T19:48:22.000", + "privileged": false, + "last_code_update": "1970-01-01T00:00:00.000", + "created": "2019-11-01T22:31:13.500", + "core_liquid_balance": "546.9574 EOS", + "ram_quota": 9229, + "net_weight": 5281058, + "cpu_weight": "5535259600", + "net_limit": { + "used": 139191, + "available": 9860806, + "max": 9999997, + "last_usage_update_time": "2025-07-15T19:45:48.500", + "current_used": 138944 + }, + "cpu_limit": { + "used": 424225, + "available": 75873, + "max": 500098, + "last_usage_update_time": "2025-07-15T19:45:48.500", + "current_used": 423471 + }, + "ram_usage": 4547, + "permissions": [ + { + "perm_name": "active", + "parent": "owner", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS8VE4hVEP4pNdFUwPf2u8inCscVeFGMf1MUt1ec8tfKHaiTJGQk", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [] + }, + { + "perm_name": "buyram", + "parent": "active", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS82EHUh2YMR51Hu6JRJWpQUhWQA3KarnePHuyi29AF9iJmoe6nK", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [ + { + "account": "eosio", + "action": "buyrambytes" + }, + { + "account": "eosio", + "action": "buyram" + } + ] + }, + { + "perm_name": "cosign", + "parent": "active", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS8Ym3MwFnAgPgDZUB9J9FwW3SrMNhr3JDv9qZA3R7nUC7DnBvm4", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [ + { + "account": "greymassnoop", + "action": "noop" + } + ] + }, + { + "perm_name": "owner", + "parent": "", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS6sLkWkqLZKPWEKpRqWU8oS8Tu7Ebjv4B8L82ViDb6r9fgZVYDx", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [] + } + ], + "total_resources": { + "owner": "greymassfuel", + "net_weight": "528.1058 EOS", + "cpu_weight": "553525.9600 EOS", + "ram_bytes": 7829 + }, + "self_delegated_bandwidth": null, + "refund_request": null, + "voter_info": { + "owner": "greymassfuel", + "proxy": "", + "producers": [], + "staked": 0, + "last_vote_weight": "0.00000000000000000", + "proxied_vote_weight": "0.00000000000000000", + "is_proxy": 0, + "flags1": 0, + "reserved2": 0, + "reserved3": "0 " + }, + "rex_info": null, + "subjective_cpu_bill_limit": { + "used": 0, + "available": 0, + "max": 0, + "last_usage_update_time": "2000-01-01T00:00:00.000", + "current_used": 0 + }, + "eosio_any_linked_actions": [] + }, + "text": "{\"account_name\":\"greymassfuel\",\"head_block_num\":446695067,\"head_block_time\":\"2025-07-15T19:48:22.000\",\"privileged\":false,\"last_code_update\":\"1970-01-01T00:00:00.000\",\"created\":\"2019-11-01T22:31:13.500\",\"core_liquid_balance\":\"546.9574 EOS\",\"ram_quota\":9229,\"net_weight\":5281058,\"cpu_weight\":\"5535259600\",\"net_limit\":{\"used\":139191,\"available\":9860806,\"max\":9999997,\"last_usage_update_time\":\"2025-07-15T19:45:48.500\",\"current_used\":138944},\"cpu_limit\":{\"used\":424225,\"available\":75873,\"max\":500098,\"last_usage_update_time\":\"2025-07-15T19:45:48.500\",\"current_used\":423471},\"ram_usage\":4547,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS8VE4hVEP4pNdFUwPf2u8inCscVeFGMf1MUt1ec8tfKHaiTJGQk\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"buyram\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS82EHUh2YMR51Hu6JRJWpQUhWQA3KarnePHuyi29AF9iJmoe6nK\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"eosio\",\"action\":\"buyrambytes\"},{\"account\":\"eosio\",\"action\":\"buyram\"}]},{\"perm_name\":\"cosign\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS8Ym3MwFnAgPgDZUB9J9FwW3SrMNhr3JDv9qZA3R7nUC7DnBvm4\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"greymassnoop\",\"action\":\"noop\"}]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS6sLkWkqLZKPWEKpRqWU8oS8Tu7Ebjv4B8L82ViDb6r9fgZVYDx\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]}],\"total_resources\":{\"owner\":\"greymassfuel\",\"net_weight\":\"528.1058 EOS\",\"cpu_weight\":\"553525.9600 EOS\",\"ram_bytes\":7829},\"self_delegated_bandwidth\":null,\"refund_request\":null,\"voter_info\":{\"owner\":\"greymassfuel\",\"proxy\":\"\",\"producers\":[],\"staked\":0,\"last_vote_weight\":\"0.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0 \"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":0,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" +} \ No newline at end of file diff --git a/test/data/9524769002c6f1710084a9b2f020b2560af883ab.json b/test/data/9524769002c6f1710084a9b2f020b2560af883ab.json new file mode 100644 index 0000000..b301246 --- /dev/null +++ b/test/data/9524769002c6f1710084a9b2f020b2560af883ab.json @@ -0,0 +1,19 @@ +{ + "request": { + "path": "https://eos.greymass.com/v1/chain/get_table_rows", + "params": { + "method": "POST", + "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rammarket\",\"key_type\":\"name\",\"json\":false}", + "headers": {} + } + }, + "status": 200, + "json": { + "rows": [ + "00407a10f35a00000452414d434f5245245a645b0e0000000052414d00000000000000000000e03fe1351e034800000004454f5300000000000000000000e03f" + ], + "more": false, + "next_key": "" + }, + "text": "{\"rows\":[\"00407a10f35a00000452414d434f5245245a645b0e0000000052414d00000000000000000000e03fe1351e034800000004454f5300000000000000000000e03f\"],\"more\":false,\"next_key\":\"\"}" +} diff --git a/test/data/993e86908a8b1681d083ebb686fc8d10989b0632.json b/test/data/993e86908a8b1681d083ebb686fc8d10989b0632.json index b702a14..8769237 100644 --- a/test/data/993e86908a8b1681d083ebb686fc8d10989b0632.json +++ b/test/data/993e86908a8b1681d083ebb686fc8d10989b0632.json @@ -3,7 +3,8 @@ "path": "https://eos.greymass.com/v1/chain/get_table_rows", "params": { "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rexpool\",\"key_type\":\"name\",\"json\":false}" + "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rexpool\",\"key_type\":\"name\",\"json\":false}", + "headers": {} } }, "status": 200, @@ -15,4 +16,4 @@ "next_key": "" }, "text": "{\"rows\":[\"003c6ed8140700000004454f5300000000c6cb1eb08700000004454f5300000000fef112020000000004454f5300000000023af7c48e00000004454f5300000000aeec1953f67015000452455800000000000000000000000004454f5300000000f2ad070000000000\"],\"more\":false,\"next_key\":\"\"}" -} \ No newline at end of file +} diff --git a/test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json b/test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json new file mode 100644 index 0000000..d927137 --- /dev/null +++ b/test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json @@ -0,0 +1,19 @@ +{ + "request": { + "path": "https://eos.greymass.com/v1/chain/get_table_rows", + "params": { + "method": "POST", + "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", + "headers": {} + } + }, + "status": 200, + "json": { + "rows": [ + "00002ae97f9fd056000000a0724e180900004e79bb7de00000000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000003ad7e5d22f0000009b50f34d3600000046b0766800a8a4ff7d425b010000a0724e1809000038e5edf6810300000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000003d7df5ad48150000230a7dfb6815000046b0766801000000010000000000000004454f5300000000" + ], + "more": false, + "next_key": "" + }, + "text": "{\"rows\":[\"00002ae97f9fd056000000a0724e180900004e79bb7de00000000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000003ad7e5d22f0000009b50f34d3600000046b0766800a8a4ff7d425b010000a0724e1809000038e5edf6810300000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000003d7df5ad48150000230a7dfb6815000046b0766801000000010000000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\"}" +} \ No newline at end of file diff --git a/test/data/9e08258766b498e71f703d93796baa80fc37ddc5.json b/test/data/9e08258766b498e71f703d93796baa80fc37ddc5.json index 37c229f..b301246 100644 --- a/test/data/9e08258766b498e71f703d93796baa80fc37ddc5.json +++ b/test/data/9e08258766b498e71f703d93796baa80fc37ddc5.json @@ -3,16 +3,17 @@ "path": "https://eos.greymass.com/v1/chain/get_table_rows", "params": { "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rammarket\",\"key_type\":\"name\",\"json\":false}" + "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rammarket\",\"key_type\":\"name\",\"json\":false}", + "headers": {} } }, "status": 200, "json": { "rows": [ - "00407a10f35a00000452414d434f5245ffcd4f55500000000052414d00000000000000000000e03ffce056a10c00000004454f5300000000000000000000e03f" + "00407a10f35a00000452414d434f5245245a645b0e0000000052414d00000000000000000000e03fe1351e034800000004454f5300000000000000000000e03f" ], "more": false, "next_key": "" }, - "text": "{\"rows\":[\"00407a10f35a00000452414d434f5245ffcd4f55500000000052414d00000000000000000000e03ffce056a10c00000004454f5300000000000000000000e03f\"],\"more\":false,\"next_key\":\"\"}" -} \ No newline at end of file + "text": "{\"rows\":[\"00407a10f35a00000452414d434f5245245a645b0e0000000052414d00000000000000000000e03fe1351e034800000004454f5300000000000000000000e03f\"],\"more\":false,\"next_key\":\"\"}" +} diff --git a/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json b/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json new file mode 100644 index 0000000..c600521 --- /dev/null +++ b/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json @@ -0,0 +1,33 @@ +{ + "request": { + "path": "https://jungle4.greymass.com/v1/chain/get_info", + "params": { + "method": "GET", + "headers": {} + } + }, + "status": 200, + "json": { + "server_version": "13356212", + "chain_id": "73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d", + "head_block_num": 213355243, + "last_irreversible_block_num": 213355241, + "last_irreversible_block_id": "0cb78ae9d244692f7c84c6cb3701d654fcc21a43026c5686eccfbaea77aa7625", + "head_block_id": "0cb78aebc487d33cfd475255cd01f1e20e01ffb66a696777d7c501eebc33b608", + "head_block_time": "2025-07-14T21:47:36.000", + "head_block_producer": "aus1genereos", + "virtual_block_cpu_limit": 200000000, + "virtual_block_net_limit": 1048576000, + "block_cpu_limit": 200000, + "block_net_limit": 1048576, + "server_version_string": "v1.1.5", + "fork_db_head_block_num": 213355243, + "fork_db_head_block_id": "0cb78aebc487d33cfd475255cd01f1e20e01ffb66a696777d7c501eebc33b608", + "server_full_version_string": "v1.1.5-13356212245054c35b1e1e7e20a9bd43ced48c4d", + "total_cpu_weight": "120570390761712", + "total_net_weight": "117540054157864", + "earliest_available_block_num": 213181258, + "last_irreversible_block_time": "2025-07-14T21:47:35.000" + }, + "text": "{\"server_version\":\"13356212\",\"chain_id\":\"73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d\",\"head_block_num\":213355243,\"last_irreversible_block_num\":213355241,\"last_irreversible_block_id\":\"0cb78ae9d244692f7c84c6cb3701d654fcc21a43026c5686eccfbaea77aa7625\",\"head_block_id\":\"0cb78aebc487d33cfd475255cd01f1e20e01ffb66a696777d7c501eebc33b608\",\"head_block_time\":\"2025-07-14T21:47:36.000\",\"head_block_producer\":\"aus1genereos\",\"virtual_block_cpu_limit\":200000000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v1.1.5\",\"fork_db_head_block_num\":213355243,\"fork_db_head_block_id\":\"0cb78aebc487d33cfd475255cd01f1e20e01ffb66a696777d7c501eebc33b608\",\"server_full_version_string\":\"v1.1.5-13356212245054c35b1e1e7e20a9bd43ced48c4d\",\"total_cpu_weight\":\"120570390761712\",\"total_net_weight\":\"117540054157864\",\"earliest_available_block_num\":213181258,\"last_irreversible_block_time\":\"2025-07-14T21:47:35.000\"}" +} \ No newline at end of file diff --git a/test/data/a158dc7a4513763428bf651dcf148ab41d72d3af.json b/test/data/a158dc7a4513763428bf651dcf148ab41d72d3af.json index ad4e334..1b15644 100644 --- a/test/data/a158dc7a4513763428bf651dcf148ab41d72d3af.json +++ b/test/data/a158dc7a4513763428bf651dcf148ab41d72d3af.json @@ -3,16 +3,17 @@ "path": "https://jungle4.greymass.com/v1/chain/get_table_rows", "params": { "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}" + "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", + "headers": {} } }, "status": 200, "json": { "rows": [ - "00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f53000000002cf6c08e4c0000002cf3aa404a00000085ee4d65000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000006e4a6642fd0100006e4750f4fa01000085ee4d6501000000e80300000000000004454f5300000000" + "00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f5300000000458406b2310b0000454ff94f300b000015e37468000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c62be9e3a52200000dc40511d822000015e3746801000000e80300000000000004454f5300000000" ], "more": false, "next_key": "" }, - "text": "{\"rows\":[\"00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f53000000002cf6c08e4c0000002cf3aa404a00000085ee4d65000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000006e4a6642fd0100006e4750f4fa01000085ee4d6501000000e80300000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\"}" -} \ No newline at end of file + "text": "{\"rows\":[\"00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f5300000000458406b2310b0000454ff94f300b000015e37468000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c62be9e3a52200000dc40511d822000015e3746801000000e80300000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\"}" +} diff --git a/test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json b/test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json new file mode 100644 index 0000000..02fff7a --- /dev/null +++ b/test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json @@ -0,0 +1,19 @@ +{ + "request": { + "path": "https://wax.greymass.com/v1/chain/get_table_rows", + "params": { + "method": "POST", + "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", + "headers": {} + } + }, + "status": 200, + "json": { + "rows": [ + "00004443c91d14a2460400c06e31d910010042f8c30ce420d5010000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf1700000857415800000000e92252a8a17a2b00027f8cc714cf2b003a9b756800883a7a3d22ca520100c06e31d91001001619a2ac0e3291000000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf17000008574158000000001b61834867c42200c92a9290946325003a9b75680100000001000000000000000857415800000000" + ], + "more": false, + "next_key": "" + }, + "text": "{\"rows\":[\"00004443c91d14a2460400c06e31d910010042f8c30ce420d5010000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf1700000857415800000000e92252a8a17a2b00027f8cc714cf2b003a9b756800883a7a3d22ca520100c06e31d91001001619a2ac0e3291000000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf17000008574158000000001b61834867c42200c92a9290946325003a9b75680100000001000000000000000857415800000000\"],\"more\":false,\"next_key\":\"\"}" +} \ No newline at end of file diff --git a/test/data/e6ea436e837ecec4ca8e2283a0a1e7900a997b6e.json b/test/data/e6ea436e837ecec4ca8e2283a0a1e7900a997b6e.json new file mode 100644 index 0000000..d66a87f --- /dev/null +++ b/test/data/e6ea436e837ecec4ca8e2283a0a1e7900a997b6e.json @@ -0,0 +1,157 @@ +{ + "request": { + "path": "https://wax.greymass.com/v1/chain/get_account", + "params": { + "method": "POST", + "body": "{\"account_name\":\"greymassfuel\"}", + "headers": {} + } + }, + "status": 200, + "json": { + "account_name": "greymassfuel", + "head_block_num": 382117080, + "head_block_time": "2025-07-15T00:05:15.500", + "privileged": false, + "last_code_update": "1970-01-01T00:00:00.000", + "created": "2021-02-16T19:10:33.000", + "core_liquid_balance": "8265.03826714 WAX", + "ram_quota": 5399, + "net_weight": "500000000000", + "cpu_weight": "100640000000000", + "net_limit": { + "used": 26518580, + "available": 207779846, + "max": 234298426, + "last_usage_update_time": "2025-07-15T00:05:15.000", + "current_used": 26518426 + }, + "cpu_limit": { + "used": 21230526, + "available": 5396250, + "max": 26626776, + "last_usage_update_time": "2025-07-15T00:05:15.000", + "current_used": 21230403 + }, + "ram_usage": 4714, + "permissions": [ + { + "perm_name": "active", + "parent": "owner", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS8VE4hVEP4pNdFUwPf2u8inCscVeFGMf1MUt1ec8tfKHaiTJGQk", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [] + }, + { + "perm_name": "buyram", + "parent": "active", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS82EHUh2YMR51Hu6JRJWpQUhWQA3KarnePHuyi29AF9iJmoe6nK", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [ + { + "account": "eosio", + "action": "buyram" + }, + { + "account": "eosio", + "action": "buyrambytes" + } + ] + }, + { + "perm_name": "cosign", + "parent": "active", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS8Ym3MwFnAgPgDZUB9J9FwW3SrMNhr3JDv9qZA3R7nUC7DnBvm4", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [ + { + "account": "greymassnoop", + "action": "noop" + } + ] + }, + { + "perm_name": "owner", + "parent": "", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS6RWZ1CmDL4B6LdixuertnzxcRuUDac3NQspJEvMnebGcUwhvfX", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [] + } + ], + "total_resources": { + "owner": "greymassfuel", + "net_weight": "5000.00000000 WAX", + "cpu_weight": "1006400.00000000 WAX", + "ram_bytes": 3999 + }, + "self_delegated_bandwidth": { + "from": "greymassfuel", + "to": "greymassfuel", + "net_weight": "0.00000000 WAX", + "cpu_weight": "900.00000000 WAX" + }, + "refund_request": null, + "voter_info": { + "owner": "greymassfuel", + "proxy": "", + "producers": [], + "staked": "90000000000", + "unpaid_voteshare": "0.00000000000000000", + "unpaid_voteshare_last_updated": "1970-01-01T00:00:00.000", + "unpaid_voteshare_change_rate": "0.00000000000000000", + "last_claim_time": "1970-01-01T00:00:00.000", + "last_vote_weight": "0.00000000000000000", + "proxied_vote_weight": "0.00000000000000000", + "is_proxy": 0, + "flags1": 0, + "reserved2": 0, + "reserved3": "0 " + }, + "rex_info": null, + "subjective_cpu_bill_limit": { + "used": 0, + "available": 0, + "max": 0, + "last_usage_update_time": "2000-01-01T00:00:00.000", + "current_used": 0 + }, + "eosio_any_linked_actions": [] + }, + "text": "{\"account_name\":\"greymassfuel\",\"head_block_num\":382117080,\"head_block_time\":\"2025-07-15T00:05:15.500\",\"privileged\":false,\"last_code_update\":\"1970-01-01T00:00:00.000\",\"created\":\"2021-02-16T19:10:33.000\",\"core_liquid_balance\":\"8265.03826714 WAX\",\"ram_quota\":5399,\"net_weight\":\"500000000000\",\"cpu_weight\":\"100640000000000\",\"net_limit\":{\"used\":26518580,\"available\":207779846,\"max\":234298426,\"last_usage_update_time\":\"2025-07-15T00:05:15.000\",\"current_used\":26518426},\"cpu_limit\":{\"used\":21230526,\"available\":5396250,\"max\":26626776,\"last_usage_update_time\":\"2025-07-15T00:05:15.000\",\"current_used\":21230403},\"ram_usage\":4714,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS8VE4hVEP4pNdFUwPf2u8inCscVeFGMf1MUt1ec8tfKHaiTJGQk\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"buyram\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS82EHUh2YMR51Hu6JRJWpQUhWQA3KarnePHuyi29AF9iJmoe6nK\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"eosio\",\"action\":\"buyram\"},{\"account\":\"eosio\",\"action\":\"buyrambytes\"}]},{\"perm_name\":\"cosign\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS8Ym3MwFnAgPgDZUB9J9FwW3SrMNhr3JDv9qZA3R7nUC7DnBvm4\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"greymassnoop\",\"action\":\"noop\"}]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS6RWZ1CmDL4B6LdixuertnzxcRuUDac3NQspJEvMnebGcUwhvfX\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]}],\"total_resources\":{\"owner\":\"greymassfuel\",\"net_weight\":\"5000.00000000 WAX\",\"cpu_weight\":\"1006400.00000000 WAX\",\"ram_bytes\":3999},\"self_delegated_bandwidth\":{\"from\":\"greymassfuel\",\"to\":\"greymassfuel\",\"net_weight\":\"0.00000000 WAX\",\"cpu_weight\":\"900.00000000 WAX\"},\"refund_request\":null,\"voter_info\":{\"owner\":\"greymassfuel\",\"proxy\":\"\",\"producers\":[],\"staked\":\"90000000000\",\"unpaid_voteshare\":\"0.00000000000000000\",\"unpaid_voteshare_last_updated\":\"1970-01-01T00:00:00.000\",\"unpaid_voteshare_change_rate\":\"0.00000000000000000\",\"last_claim_time\":\"1970-01-01T00:00:00.000\",\"last_vote_weight\":\"0.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0 \"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":0,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" +} \ No newline at end of file diff --git a/test/data/f81ee4f1d7ff04f2dd45675f0f50a4e9094a5d13.json b/test/data/f81ee4f1d7ff04f2dd45675f0f50a4e9094a5d13.json index 7808287..4d34440 100644 --- a/test/data/f81ee4f1d7ff04f2dd45675f0f50a4e9094a5d13.json +++ b/test/data/f81ee4f1d7ff04f2dd45675f0f50a4e9094a5d13.json @@ -3,7 +3,8 @@ "path": "https://wax.greymass.com/v1/chain/get_account", "params": { "method": "POST", - "body": "{\"account_name\":\"boost.wax\"}" + "body": "{\"account_name\":\"boost.wax\"}", + "headers": {} } }, "status": 200, @@ -164,4 +165,4 @@ "eosio_any_linked_actions": [] }, "text": "{\"account_name\":\"boost.wax\",\"head_block_num\":289066137,\"head_block_time\":\"2024-01-23T10:24:28.500\",\"privileged\":false,\"last_code_update\":\"2022-11-01T21:44:57.500\",\"created\":\"2020-04-09T20:28:34.500\",\"core_liquid_balance\":\"3796281.54208477 WAX\",\"ram_quota\":106721149,\"net_weight\":\"30001100000000\",\"cpu_weight\":\"770055200000000\",\"net_limit\":{\"used\":2960305,\"available\":\"40717140941\",\"max\":\"40720101246\",\"last_usage_update_time\":\"2024-01-23T10:24:26.000\",\"current_used\":2960219},\"cpu_limit\":{\"used\":10699884,\"available\":890363982,\"max\":901063866,\"last_usage_update_time\":\"2024-01-23T10:24:26.000\",\"current_used\":10699574},\"ram_usage\":13138871,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"admin.wax\",\"permission\":\"active\"},\"weight\":1},{\"permission\":{\"actor\":\"boost.wax\",\"permission\":\"eosio.code\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"deploy\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"deploy.wax\",\"permission\":\"all\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[{\"account\":\"eosio\",\"action\":\"setcode\"},{\"account\":\"eosio\",\"action\":\"setabi\"}]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"admin.wax\",\"permission\":\"active\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"paybw\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS5B2c2wNjaq342758aYvE71dTxpBVqHocnRU1aWxUdZAuxbgM6f\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"boost.wax\",\"action\":\"noop\"}]}],\"total_resources\":{\"owner\":\"boost.wax\",\"net_weight\":\"300011.00000000 WAX\",\"cpu_weight\":\"7700552.00000000 WAX\",\"ram_bytes\":106719749},\"self_delegated_bandwidth\":null,\"refund_request\":null,\"voter_info\":{\"owner\":\"boost.wax\",\"proxy\":\"\",\"producers\":[],\"staked\":0,\"unpaid_voteshare\":\"0.00000000000000000\",\"unpaid_voteshare_last_updated\":\"1970-01-01T00:00:00.000\",\"unpaid_voteshare_change_rate\":\"0.00000000000000000\",\"last_claim_time\":\"1970-01-01T00:00:00.000\",\"last_vote_weight\":\"0.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0 \"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":55504,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" -} \ No newline at end of file +} diff --git a/test/migrate.ts b/test/migrate.ts new file mode 100644 index 0000000..7982c55 --- /dev/null +++ b/test/migrate.ts @@ -0,0 +1,201 @@ +import 'mocha' +import {strict as assert} from 'assert' + +import {PowerUpState, RAMState, Resources, SampleUsage} from '../src' +import {makeClient} from '@wharfkit/mock-data' +import {UInt128, UInt64} from '@wharfkit/antelope' + +const resources = new Resources({api: makeClient('https://eos.greymass.com')}) + +let powerup: PowerUpState +let us: number +let bytes: number +let frac: UInt128 +let usage: SampleUsage +let utilization: UInt64 +let utilization_increase: UInt128 +let adjusted_utilization: UInt128 + +suite('migrate', function () { + setup(async function () { + // const info = await resources.api.v1.chain.get_info() + powerup = await resources.v1.powerup.get_state() + usage = await resources.getSampledUsage() + us = 1000 + bytes = 1000000 + frac = UInt128.from(powerup.cpu.frac(usage, us)) + utilization = powerup.cpu.utilization + utilization_increase = powerup.cpu.utilization_increase(frac) + adjusted_utilization = powerup.cpu.determine_adjusted_utilization() + }) + suite('cpu', function () { + test('reserved', async function () { + const modern = powerup.cpu.reserved + const legacy = powerup.cpu.reserved_legacy + assert.equal( + modern.equals(legacy), + true, + `modern=${modern.toString()} legacy=${legacy.toString()}` + ) + }) + test('allocated', async function () { + const modern = powerup.cpu.allocated + const legacy = powerup.cpu.allocated_legacy + assert.equal(modern, legacy, `modern=${modern} legacy=${legacy}`) + }) + test('utilization_increase', async function () { + const frac = UInt128.from(powerup.cpu.frac(usage, us)) + const modern = powerup.cpu.utilization_increase(frac) + const legacy = powerup.cpu.utilization_increase_legacy(frac) + assert.equal( + modern.equals(legacy), + true, + `modern=${modern.toString()} legacy=${legacy}` + ) + }) + test('price_function', async function () { + const modern = powerup.cpu.price_function(powerup.cpu.utilization) + const legacy = powerup.cpu.price_function_legacy(powerup.cpu.utilization) + assert.equal(modern, legacy, `modern=${modern.toString()} legacy=${legacy}`) + }) + test('price_integral_delta', async function () { + const start_utilization = utilization + const end_utilization = start_utilization.adding(utilization_increase) + + const modern = powerup.cpu.price_integral_delta(start_utilization, end_utilization) + const legacy = powerup.cpu.price_integral_delta_legacy( + start_utilization, + end_utilization + ) + const expected = legacy * Math.pow(10, powerup.cpu.symbol.precision) + assert.equal( + modern, + expected, + `modern=${modern.toString()} legacy=${expected} (start=${start_utilization.toString()} end=${end_utilization.toString()})` + ) + }) + test('fee', async function () { + const modern = powerup.cpu.fee(utilization_increase, adjusted_utilization) + const legacy = powerup.cpu.fee_legacy(utilization_increase, adjusted_utilization) + assert.equal(modern, legacy, `modern=${String(modern)} legacy=${legacy}`) + }) + test('weight_to_us', async function () { + const weight = 1000000 + const modern = powerup.cpu.weight_to_us(powerup.cpu.weight, weight) + const legacy = powerup.cpu.weight_to_us_legacy(powerup.cpu.weight, weight) + assert.equal( + modern.equals(legacy), + true, + `modern=${String(modern)} legacy=${legacy} weight=${weight}` + ) + }) + test('us_to_weight', async function () { + const modern = powerup.cpu.us_to_weight(powerup.cpu.weight, us) + const legacy = powerup.cpu.us_to_weight_legacy(powerup.cpu.weight, us) + assert.equal( + modern.equals(legacy), + true, + `modern=${String(modern)} legacy=${legacy} us=${us}` + ) + }) + test('frac_by_us now', async function () { + const modern = powerup.cpu.frac_by_us(usage, us) + const legacy = powerup.cpu.frac_by_us_legacy(usage, us) + assert.equal( + modern.equals(legacy), + true, + `modern=${String(modern)} legacy=${legacy} us=${us}` + ) + }) + test('price_per_us', async function () { + const modern = powerup.cpu.price_per_us(usage, us) + const legacy = powerup.cpu.price_per_us_legacy(usage, us) + assert.equal(modern, legacy, `modern=${String(modern)} legacy=${legacy} us=${us}`) + }) + }) + suite('net', function () { + test('reserved', async function () { + const modern = powerup.net.reserved + const legacy = powerup.net.reserved_legacy + assert.equal( + modern.equals(legacy), + true, + `modern=${modern.toString()} legacy=${legacy.toString()}` + ) + }) + test('allocated', async function () { + const modern = powerup.net.allocated + const legacy = powerup.net.allocated_legacy + assert.equal(modern, legacy, `modern=${modern} legacy=${legacy}`) + }) + test('utilization_increase', async function () { + const frac = UInt128.from(powerup.net.frac(usage, us)) + const modern = powerup.net.utilization_increase(frac) + const legacy = powerup.net.utilization_increase_legacy(frac) + assert.equal( + modern.equals(legacy), + true, + `modern=${modern.toString()} legacy=${legacy}` + ) + }) + test('price_function', async function () { + const modern = powerup.net.price_function(powerup.net.utilization) + const legacy = powerup.net.price_function_legacy(powerup.net.utilization) + assert.equal(modern, legacy, `modern=${modern.toString()} legacy=${legacy}`) + }) + test('price_integral_delta', async function () { + const start_utilization = utilization + const end_utilization = start_utilization.adding(utilization_increase) + + const modern = powerup.net.price_integral_delta(start_utilization, end_utilization) + const legacy = powerup.net.price_integral_delta_legacy( + start_utilization, + end_utilization + ) + const expected = legacy * Math.pow(10, powerup.net.symbol.precision) + assert.equal( + modern, + expected, + `modern=${modern.toString()} legacy=${expected} (start=${start_utilization.toString()} end=${end_utilization.toString()})` + ) + }) + test('fee', async function () { + const modern = powerup.net.fee(utilization_increase, adjusted_utilization) + const legacy = powerup.net.fee_legacy(utilization_increase, adjusted_utilization) + assert.equal(modern, legacy, `modern=${String(modern)} legacy=${legacy}`) + }) + test('weight_to_bytes', async function () { + const weight = 1000000 + const modern = powerup.net.weight_to_bytes(powerup.net.weight, weight) + const legacy = powerup.net.weight_to_bytes_legacy(powerup.net.weight, weight) + assert.equal( + modern.equals(legacy), + true, + `modern=${String(modern)} legacy=${legacy} weight=${weight}` + ) + }) + test('bytes_to_weight', async function () { + const modern = powerup.net.bytes_to_weight(powerup.net.weight, bytes) + const legacy = powerup.net.bytes_to_weight_legacy(powerup.net.weight, bytes) + assert.equal( + modern.equals(legacy), + true, + `modern=${String(modern)} legacy=${legacy} bytes=${bytes}` + ) + }) + test('frac_by_bytes', async function () { + const modern = powerup.net.frac_by_bytes(usage, bytes) + const legacy = powerup.net.frac_by_bytes_legacy(usage, bytes) + assert.equal( + modern.equals(legacy), + true, + `modern=${String(modern)} legacy=${legacy} bytes=${bytes}` + ) + }) + test('price_per_byte', async function () { + const modern = powerup.net.price_per_byte(usage, bytes) + const legacy = powerup.net.price_per_byte_legacy(usage, bytes) + assert.equal(modern, legacy, `modern=${String(modern)} legacy=${legacy} bytes=${bytes}`) + }) + }) +}) From fb3ec73c7838d9350f9a3b619bdc54015fc12cb4 Mon Sep 17 00:00:00 2001 From: Aaron Cox Date: Tue, 15 Jul 2025 13:33:47 -0700 Subject: [PATCH 07/17] Update src/powerup/abstract.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/powerup/abstract.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/powerup/abstract.ts b/src/powerup/abstract.ts index f98eb0a..a505e8f 100644 --- a/src/powerup/abstract.ts +++ b/src/powerup/abstract.ts @@ -160,7 +160,7 @@ export abstract class PowerUpStateResource extends Struct { ) start_utilization = adjusted_utilization } - if (start_utilization.gt(end_utilization)) { + if (start_utilization.lt(end_utilization)) { fee += this.price_integral_delta(start_utilization, end_utilization) } return fee From adaa0257980f96befbbe80a9d0485ab35b2d5bb3 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 15 Jul 2025 13:35:31 -0700 Subject: [PATCH 08/17] Removed direct usage of bigDecimal --- src/powerup/abstract.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/powerup/abstract.ts b/src/powerup/abstract.ts index a505e8f..fa778f5 100644 --- a/src/powerup/abstract.ts +++ b/src/powerup/abstract.ts @@ -10,7 +10,6 @@ import { UInt8, } from '@wharfkit/antelope' import BN from 'bn.js' -import bigDecimal from 'js-big-decimal' import {intToBigDecimal} from '..' import {PowerUpStateOptions} from './options' @@ -154,8 +153,8 @@ export abstract class PowerUpStateResource extends Struct { adjusted_utilization.subtracting(start_utilization) ) fee += Number( - new bigDecimal(this.price_function_legacy(adjusted_utilization) * min) - .divide(new bigDecimal(weight.toString())) + intToBigDecimal(this.price_function_legacy(adjusted_utilization) * min) + .divide(intToBigDecimal(weight)) .getValue() ) start_utilization = adjusted_utilization From c1839783008dcb0176666b148d868821e8851947 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 15 Jul 2025 13:37:01 -0700 Subject: [PATCH 09/17] Fixed comparison operators --- src/powerup/abstract.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/powerup/abstract.ts b/src/powerup/abstract.ts index fa778f5..d6f2837 100644 --- a/src/powerup/abstract.ts +++ b/src/powerup/abstract.ts @@ -185,7 +185,7 @@ export abstract class PowerUpStateResource extends Struct { start_utilization = adjusted_utilization } - if (start_utilization.gt(end_utilization)) { + if (start_utilization.lt(end_utilization)) { fee += this.price_integral_delta(start_utilization, end_utilization) } return fee From eb7d7a3103b307fbda01e2507d2ce720b4acda45 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 15 Jul 2025 13:38:19 -0700 Subject: [PATCH 10/17] Removed unneeded casting --- src/powerup/cpu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/powerup/cpu.ts b/src/powerup/cpu.ts index 8fc0929..7b6b7de 100644 --- a/src/powerup/cpu.ts +++ b/src/powerup/cpu.ts @@ -39,7 +39,7 @@ export class PowerUpStateResourceCPU extends PowerUpStateResource { return Math.floor((us / Number(sampled.getValue())) * BNPrecision) } us_to_weight(sample: UInt128, us: Int64Type): Int64 { - return Int64.from(us).multiplying(BNPrecision).dividing(Int64.from(sample), 'floor') + return Int64.from(us).multiplying(BNPrecision).dividing(sample, 'floor') } // Default frac generation by smallest unit type From 8113844ccee3cc8c85c7d1d22010e67a53d2afb4 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Wed, 16 Jul 2025 12:48:39 -0700 Subject: [PATCH 11/17] Removed legacy functions --- src/powerup/abstract.ts | 73 --------------- src/powerup/cpu.ts | 33 ------- src/powerup/net.ts | 39 -------- test/migrate.ts | 201 ---------------------------------------- 4 files changed, 346 deletions(-) delete mode 100644 test/migrate.ts diff --git a/src/powerup/abstract.ts b/src/powerup/abstract.ts index d6f2837..153b6db 100644 --- a/src/powerup/abstract.ts +++ b/src/powerup/abstract.ts @@ -9,7 +9,6 @@ import { UInt64, UInt8, } from '@wharfkit/antelope' -import BN from 'bn.js' import {intToBigDecimal} from '..' import {PowerUpStateOptions} from './options' @@ -37,19 +36,11 @@ export abstract class PowerUpStateResource extends Struct { abstract per_day(options?: PowerUpStateOptions): number // Get the current number of allocated units (shift from REX -> PowerUp) - public get allocated_legacy() { - return 1 - Number(this.weight_ratio) / Number(this.target_weight_ratio) / 100 - } - public get allocated(): number { return 1 - Number(this.weight_ratio.dividing(this.target_weight_ratio)) / 100 } // Get the current percentage of reserved units - public get reserved_legacy() { - return new BN(String(this.utilization)) / new BN(String(this.weight)) - } - public get reserved(): Int64 { return this.utilization.dividing(this.weight) } @@ -60,14 +51,6 @@ export abstract class PowerUpStateResource extends Struct { } // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L358 - utilization_increase_legacy(frac) { - const {weight} = this - const frac128 = UInt128.from(frac) - const utilization_increase = - new BN(weight.value.mul(new BN(frac128.value))) / Math.pow(10, 15) - return Math.ceil(utilization_increase) - } - utilization_increase(frac: UInt128) { const base = intToBigDecimal(frac) const weight = intToBigDecimal(this.weight) @@ -76,22 +59,6 @@ export abstract class PowerUpStateResource extends Struct { } // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L284-L298 - price_function_legacy(utilization: Int64): number { - const {exponent, weight} = this - const max_price: number = this.max_price.value - const min_price: number = this.min_price.value - let price = min_price - const new_exponent = Number(exponent) - 1.0 - if (new_exponent <= 0.0) { - return max_price - } else { - const util_weight = intToBigDecimal(utilization).divide(intToBigDecimal(weight), 18) - const difference = max_price - min_price - price += difference * Math.pow(Number(util_weight.getValue()), new_exponent) - } - return price - } - price_function(utilization: Int64): number { const {weight} = this let price = this.min_price.value @@ -108,21 +75,6 @@ export abstract class PowerUpStateResource extends Struct { } // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L274-L280 - price_integral_delta_legacy(start_utilization: Int64, end_utilization: Int64): number { - const {exponent, weight} = this - const max_price: number = this.max_price.value - const min_price: number = this.min_price.value - const coefficient = (max_price - min_price) / exponent.value - const start_u = Number(start_utilization.dividing(weight)) - const end_u = Number(end_utilization.dividing(weight)) - const delta = - min_price * end_u - - min_price * start_u + - coefficient * Math.pow(end_u, exponent.value) - - coefficient * Math.pow(start_u, exponent.value) - return delta - } - price_integral_delta(start_utilization: Int64, end_utilization: Int64): number { const difference = Asset.fromUnits( this.max_price.units.subtracting(this.min_price.units), @@ -140,31 +92,6 @@ export abstract class PowerUpStateResource extends Struct { } // Mimic: https://github.com/EOSIO/eosio.contracts/blob/d7bc0a5cc8c0c2edd4dc61b0126517d0cb46fd94/contracts/eosio.system/src/powerup.cpp#L262-L315 - fee_legacy(utilization_increase, adjusted_utilization) { - const {utilization, weight} = this - - let start_utilization = Int64.from(utilization) - const end_utilization = start_utilization.adding(utilization_increase) - - let fee = 0 - if (start_utilization.lt(adjusted_utilization)) { - const min = Math.min( - utilization_increase, - adjusted_utilization.subtracting(start_utilization) - ) - fee += Number( - intToBigDecimal(this.price_function_legacy(adjusted_utilization) * min) - .divide(intToBigDecimal(weight)) - .getValue() - ) - start_utilization = adjusted_utilization - } - if (start_utilization.lt(end_utilization)) { - fee += this.price_integral_delta(start_utilization, end_utilization) - } - return fee - } - fee(utilization_increase: UInt128, adjusted_utilization: Int64) { const {utilization, weight} = this diff --git a/src/powerup/cpu.ts b/src/powerup/cpu.ts index 7b6b7de..fa4a43f 100644 --- a/src/powerup/cpu.ts +++ b/src/powerup/cpu.ts @@ -24,9 +24,6 @@ export class PowerUpStateResourceCPU extends PowerUpStateResource { } // Convert weight to μs (microseconds) - weight_to_us_legacy(sample: UInt128, weight: number): number { - return Math.ceil((weight * Number(sample)) / BNPrecision) - } weight_to_us(sample: UInt128Type, weight: Int64Type): UInt128 { return UInt128.from( UInt128.from(weight).multiplying(Int64.from(sample)).dividing(BNPrecision, 'ceil') @@ -34,29 +31,17 @@ export class PowerUpStateResourceCPU extends PowerUpStateResource { } // Convert μs (microseconds) to weight - us_to_weight_legacy(sample: UInt128, us: number): number { - const sampled = intToBigDecimal(sample) - return Math.floor((us / Number(sampled.getValue())) * BNPrecision) - } us_to_weight(sample: UInt128, us: Int64Type): Int64 { return Int64.from(us).multiplying(BNPrecision).dividing(sample, 'floor') } // Default frac generation by smallest unit type - frac_legacy = (usage: SampleUsage, us: number) => this.frac_by_us_legacy(usage, us) frac = (usage: SampleUsage, us: number) => this.frac_by_us(usage, us) // Frac generation by ms (milliseconds) - frac_by_ms_legacy = (usage: SampleUsage, ms: number) => this.frac_by_us_legacy(usage, ms * 1000) frac_by_ms = (usage: SampleUsage, ms: number) => this.frac_by_us(usage, ms * 1000) // Frac generation by μs (microseconds) - frac_by_us_legacy(usage: SampleUsage, us: number) { - const converted = intToBigDecimal(this.us_to_weight_legacy(usage.cpu, us)) - const current = intToBigDecimal(this.weight) - const frac = converted.divide(current, 18) - return Math.floor(Number(frac.getValue()) * Math.pow(10, 15)) - } frac_by_us(usage: SampleUsage, us: Int64Type): Int64 { const precision = 15 const converted = intToBigDecimal(this.us_to_weight(usage.cpu, us)) @@ -67,32 +52,14 @@ export class PowerUpStateResourceCPU extends PowerUpStateResource { } // Price generation by smallest units, μs (microseconds) - price_per_legacy = (usage: SampleUsage, us = 1000, options?: PowerUpStateOptions): number => - this.price_per_us_legacy(usage, us, options) price_per = (usage: SampleUsage, us = 1000, options?: PowerUpStateOptions): number => this.price_per_us(usage, us, options) // Price generation by ms (milliseconds) - price_per_ms_legacy = (usage: SampleUsage, ms = 1, options?: PowerUpStateOptions): number => - this.price_per_us_legacy(usage, ms * 1000, options) price_per_ms = (usage: SampleUsage, ms = 1, options?: PowerUpStateOptions): number => this.price_per_us(usage, ms * 1000, options) // Price generation by μs (microseconds) - price_per_us_legacy(usage: SampleUsage, us = 1000, options?: PowerUpStateOptions): number { - // Determine the utilization increase by this action - const frac = UInt128.from(this.frac_legacy(usage, us)) - const utilization_increase = this.utilization_increase_legacy(frac) - // Determine the adjusted utilization if needed - const adjusted_utilization = this.determine_adjusted_utilization(options) - // Derive the fee from the increase and utilization - const fee = this.fee_legacy(utilization_increase, adjusted_utilization) - // Force the fee up to the next highest value of precision - const precision = Math.pow(10, this.max_price.symbol.precision) - const value = Math.ceil(fee * precision) / precision - // Return the modified fee - return value - } price_per_us(usage: SampleUsage, us = 1000, options?: PowerUpStateOptions): number { // Determine the utilization increase by this action const frac = UInt128.from(this.frac(usage, us)) diff --git a/src/powerup/net.ts b/src/powerup/net.ts index 1f392c4..b972210 100644 --- a/src/powerup/net.ts +++ b/src/powerup/net.ts @@ -1,5 +1,4 @@ import {Int64, Int64Type, Struct, UInt128} from '@wharfkit/antelope' -import BN from 'bn.js' import {BNPrecision, intToBigDecimal, SampleUsage} from '..' import {PowerUpStateResource} from './abstract' @@ -25,9 +24,6 @@ export class PowerUpStateResourceNET extends PowerUpStateResource { } // Convert weight to bytes - weight_to_bytes_legacy(sample: UInt128, weight: number): number { - return Math.ceil((weight * Number(sample)) / BNPrecision) - } weight_to_bytes(sample: UInt128, weight: number): UInt128 { return UInt128.from( UInt128.from(weight).multiplying(Int64.from(sample)).dividing(BNPrecision, 'ceil') @@ -35,29 +31,18 @@ export class PowerUpStateResourceNET extends PowerUpStateResource { } // Convert bytes to weight - bytes_to_weight_legacy(sample: UInt128, bytes: number): number { - return Math.floor((bytes / Number(sample)) * BNPrecision) - } bytes_to_weight(sample: UInt128, bytes: Int64Type): Int64 { return Int64.from(bytes).multiplying(BNPrecision).dividing(Int64.from(sample), 'floor') } // Default frac generation by smallest unit type - frac_legacy = (usage: SampleUsage, bytes: number) => this.frac_by_bytes_legacy(usage, bytes) frac = (usage: SampleUsage, bytes: number) => this.frac_by_bytes(usage, bytes) // Frac generation by kb - frac_by_kb_legacy = (usage: SampleUsage, kilobytes: number) => - this.frac_by_bytes_legacy(usage, kilobytes * 1000) frac_by_kb = (usage: SampleUsage, kilobytes: number) => this.frac_by_bytes(usage, kilobytes * 1000) // Frac generation by bytes - frac_by_bytes_legacy(usage: SampleUsage, bytes: number) { - const {weight} = this - const frac = new BN(this.bytes_to_weight_legacy(usage.net, bytes)) / Number(weight) - return Math.floor(frac * Math.pow(10, 15)) - } frac_by_bytes(usage: SampleUsage, bytes: Int64Type): Int64 { const precision = 15 const converted = intToBigDecimal(this.bytes_to_weight(usage.net, bytes)) @@ -68,38 +53,14 @@ export class PowerUpStateResourceNET extends PowerUpStateResource { } // Price generation by smallest units, bytes - price_per_legacy = (usage: SampleUsage, bytes = 1000, options?: PowerUpStateOptions) => - this.price_per_byte_legacy(usage, bytes, options) price_per = (usage: SampleUsage, bytes = 1000, options?: PowerUpStateOptions) => this.price_per_byte(usage, bytes, options) // Price generation by kb - price_per_kb_legacy = ( - usage: SampleUsage, - kilobytes = 1, - options?: PowerUpStateOptions - ): number => this.price_per_byte_legacy(usage, kilobytes * 1000, options) price_per_kb = (usage: SampleUsage, kilobytes = 1, options?: PowerUpStateOptions): number => this.price_per_byte(usage, kilobytes * 1000, options) // Price generation by bytes - price_per_byte_legacy(usage: SampleUsage, bytes = 1000, options?: PowerUpStateOptions): number { - // Determine the utilization increase by this action - const frac = UInt128.from(this.frac_legacy(usage, bytes)) - const utilization_increase = this.utilization_increase_legacy(frac) - - // Determine the adjusted utilization if needed - const adjusted_utilization = this.determine_adjusted_utilization(options) - - // Derive the fee from the increase and utilization - const fee = this.fee_legacy(utilization_increase, adjusted_utilization) - - const precision = Math.pow(10, this.max_price.symbol.precision) - const value = Math.ceil(fee * precision) / precision - - // Return the modified fee - return value - } price_per_byte(usage: SampleUsage, bytes = 1000, options?: PowerUpStateOptions): number { // Determine the utilization increase by this action const frac = UInt128.from(this.frac(usage, bytes)) diff --git a/test/migrate.ts b/test/migrate.ts deleted file mode 100644 index 7982c55..0000000 --- a/test/migrate.ts +++ /dev/null @@ -1,201 +0,0 @@ -import 'mocha' -import {strict as assert} from 'assert' - -import {PowerUpState, RAMState, Resources, SampleUsage} from '../src' -import {makeClient} from '@wharfkit/mock-data' -import {UInt128, UInt64} from '@wharfkit/antelope' - -const resources = new Resources({api: makeClient('https://eos.greymass.com')}) - -let powerup: PowerUpState -let us: number -let bytes: number -let frac: UInt128 -let usage: SampleUsage -let utilization: UInt64 -let utilization_increase: UInt128 -let adjusted_utilization: UInt128 - -suite('migrate', function () { - setup(async function () { - // const info = await resources.api.v1.chain.get_info() - powerup = await resources.v1.powerup.get_state() - usage = await resources.getSampledUsage() - us = 1000 - bytes = 1000000 - frac = UInt128.from(powerup.cpu.frac(usage, us)) - utilization = powerup.cpu.utilization - utilization_increase = powerup.cpu.utilization_increase(frac) - adjusted_utilization = powerup.cpu.determine_adjusted_utilization() - }) - suite('cpu', function () { - test('reserved', async function () { - const modern = powerup.cpu.reserved - const legacy = powerup.cpu.reserved_legacy - assert.equal( - modern.equals(legacy), - true, - `modern=${modern.toString()} legacy=${legacy.toString()}` - ) - }) - test('allocated', async function () { - const modern = powerup.cpu.allocated - const legacy = powerup.cpu.allocated_legacy - assert.equal(modern, legacy, `modern=${modern} legacy=${legacy}`) - }) - test('utilization_increase', async function () { - const frac = UInt128.from(powerup.cpu.frac(usage, us)) - const modern = powerup.cpu.utilization_increase(frac) - const legacy = powerup.cpu.utilization_increase_legacy(frac) - assert.equal( - modern.equals(legacy), - true, - `modern=${modern.toString()} legacy=${legacy}` - ) - }) - test('price_function', async function () { - const modern = powerup.cpu.price_function(powerup.cpu.utilization) - const legacy = powerup.cpu.price_function_legacy(powerup.cpu.utilization) - assert.equal(modern, legacy, `modern=${modern.toString()} legacy=${legacy}`) - }) - test('price_integral_delta', async function () { - const start_utilization = utilization - const end_utilization = start_utilization.adding(utilization_increase) - - const modern = powerup.cpu.price_integral_delta(start_utilization, end_utilization) - const legacy = powerup.cpu.price_integral_delta_legacy( - start_utilization, - end_utilization - ) - const expected = legacy * Math.pow(10, powerup.cpu.symbol.precision) - assert.equal( - modern, - expected, - `modern=${modern.toString()} legacy=${expected} (start=${start_utilization.toString()} end=${end_utilization.toString()})` - ) - }) - test('fee', async function () { - const modern = powerup.cpu.fee(utilization_increase, adjusted_utilization) - const legacy = powerup.cpu.fee_legacy(utilization_increase, adjusted_utilization) - assert.equal(modern, legacy, `modern=${String(modern)} legacy=${legacy}`) - }) - test('weight_to_us', async function () { - const weight = 1000000 - const modern = powerup.cpu.weight_to_us(powerup.cpu.weight, weight) - const legacy = powerup.cpu.weight_to_us_legacy(powerup.cpu.weight, weight) - assert.equal( - modern.equals(legacy), - true, - `modern=${String(modern)} legacy=${legacy} weight=${weight}` - ) - }) - test('us_to_weight', async function () { - const modern = powerup.cpu.us_to_weight(powerup.cpu.weight, us) - const legacy = powerup.cpu.us_to_weight_legacy(powerup.cpu.weight, us) - assert.equal( - modern.equals(legacy), - true, - `modern=${String(modern)} legacy=${legacy} us=${us}` - ) - }) - test('frac_by_us now', async function () { - const modern = powerup.cpu.frac_by_us(usage, us) - const legacy = powerup.cpu.frac_by_us_legacy(usage, us) - assert.equal( - modern.equals(legacy), - true, - `modern=${String(modern)} legacy=${legacy} us=${us}` - ) - }) - test('price_per_us', async function () { - const modern = powerup.cpu.price_per_us(usage, us) - const legacy = powerup.cpu.price_per_us_legacy(usage, us) - assert.equal(modern, legacy, `modern=${String(modern)} legacy=${legacy} us=${us}`) - }) - }) - suite('net', function () { - test('reserved', async function () { - const modern = powerup.net.reserved - const legacy = powerup.net.reserved_legacy - assert.equal( - modern.equals(legacy), - true, - `modern=${modern.toString()} legacy=${legacy.toString()}` - ) - }) - test('allocated', async function () { - const modern = powerup.net.allocated - const legacy = powerup.net.allocated_legacy - assert.equal(modern, legacy, `modern=${modern} legacy=${legacy}`) - }) - test('utilization_increase', async function () { - const frac = UInt128.from(powerup.net.frac(usage, us)) - const modern = powerup.net.utilization_increase(frac) - const legacy = powerup.net.utilization_increase_legacy(frac) - assert.equal( - modern.equals(legacy), - true, - `modern=${modern.toString()} legacy=${legacy}` - ) - }) - test('price_function', async function () { - const modern = powerup.net.price_function(powerup.net.utilization) - const legacy = powerup.net.price_function_legacy(powerup.net.utilization) - assert.equal(modern, legacy, `modern=${modern.toString()} legacy=${legacy}`) - }) - test('price_integral_delta', async function () { - const start_utilization = utilization - const end_utilization = start_utilization.adding(utilization_increase) - - const modern = powerup.net.price_integral_delta(start_utilization, end_utilization) - const legacy = powerup.net.price_integral_delta_legacy( - start_utilization, - end_utilization - ) - const expected = legacy * Math.pow(10, powerup.net.symbol.precision) - assert.equal( - modern, - expected, - `modern=${modern.toString()} legacy=${expected} (start=${start_utilization.toString()} end=${end_utilization.toString()})` - ) - }) - test('fee', async function () { - const modern = powerup.net.fee(utilization_increase, adjusted_utilization) - const legacy = powerup.net.fee_legacy(utilization_increase, adjusted_utilization) - assert.equal(modern, legacy, `modern=${String(modern)} legacy=${legacy}`) - }) - test('weight_to_bytes', async function () { - const weight = 1000000 - const modern = powerup.net.weight_to_bytes(powerup.net.weight, weight) - const legacy = powerup.net.weight_to_bytes_legacy(powerup.net.weight, weight) - assert.equal( - modern.equals(legacy), - true, - `modern=${String(modern)} legacy=${legacy} weight=${weight}` - ) - }) - test('bytes_to_weight', async function () { - const modern = powerup.net.bytes_to_weight(powerup.net.weight, bytes) - const legacy = powerup.net.bytes_to_weight_legacy(powerup.net.weight, bytes) - assert.equal( - modern.equals(legacy), - true, - `modern=${String(modern)} legacy=${legacy} bytes=${bytes}` - ) - }) - test('frac_by_bytes', async function () { - const modern = powerup.net.frac_by_bytes(usage, bytes) - const legacy = powerup.net.frac_by_bytes_legacy(usage, bytes) - assert.equal( - modern.equals(legacy), - true, - `modern=${String(modern)} legacy=${legacy} bytes=${bytes}` - ) - }) - test('price_per_byte', async function () { - const modern = powerup.net.price_per_byte(usage, bytes) - const legacy = powerup.net.price_per_byte_legacy(usage, bytes) - assert.equal(modern, legacy, `modern=${String(modern)} legacy=${legacy} bytes=${bytes}`) - }) - }) -}) From baef0d94f5926af3cb90e68d37648b386aea01fc Mon Sep 17 00:00:00 2001 From: aaroncox Date: Wed, 16 Jul 2025 12:48:53 -0700 Subject: [PATCH 12/17] Wipe test data --- ...b5fcee72a401636213f0e5e607c83e15eb11f.json | 32 ---- ...da3efa89d3edc24a644a654740cb46bf56429.json | 23 --- ...771d7dd9d5079ec2282d6c375f57e4e71863f.json | 23 --- ...db8a082add2a0239f42aed4a1d2aa2435b27a.json | 32 ---- ...7b867f12068c4909e7a817ed3e1a179b81f9c.json | 34 ---- ...324021634d5f0a70e60070d06db240a2732b0.json | 24 --- ...759db64d979ad79ff82ef8e536eb46163c447.json | 125 ------------- ...cefb4d7749510e87d710cef682f8f1c7b4f6a.json | 19 -- ...80f33c07aa3ba09b6a5e5581463f95a168feb.json | 33 ---- ...84e00fc6d9fb01a8843f6e251e6811459169c.json | 131 ------------- ...bea5f5551dede21edba216e12db446ca68486.json | 19 -- ...6fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json | 176 ------------------ ...7c3f434961f4b54c70c4b133e2fbeb1f75dfa.json | 96 ---------- ...c990e6ea2e283c39d1f3a8d1b7680fedaed53.json | 19 -- ...5170d875b36823010af2a74154bbd509bc3bc.json | 19 -- ...e7473fc9df54bb8b45bcf3d759b48ce9a5a64.json | 33 ---- ...ad3d64af233a183cab24ef0a34585838379c7.json | 148 --------------- ...4769002c6f1710084a9b2f020b2560af883ab.json | 19 -- ...e86908a8b1681d083ebb686fc8d10989b0632.json | 19 -- ...0c13e62013539b53fd522e7d0834cc3a6aa66.json | 19 -- ...8258766b498e71f703d93796baa80fc37ddc5.json | 19 -- ...1de03f2a7ee6c133465c8c6b2b286704a5d8f.json | 33 ---- ...8dc7a4513763428bf651dcf148ab41d72d3af.json | 19 -- ...ac04b00106a44611383931aef281f37cd304e.json | 32 ---- ...e0d25e3f0a6ac99195e23bd7410ede02c58df.json | 19 -- ...047680b4558dbac498c3202a772dc79fe8628.json | 24 --- ...cb61dbe788ea7b644cc3542a13b2b09a73c15.json | 35 ---- ...a436e837ecec4ca8e2283a0a1e7900a997b6e.json | 157 ---------------- ...ee4f1d7ff04f2dd45675f0f50a4e9094a5d13.json | 168 ----------------- 29 files changed, 1549 deletions(-) delete mode 100644 test/data/01db5fcee72a401636213f0e5e607c83e15eb11f.json delete mode 100644 test/data/069da3efa89d3edc24a644a654740cb46bf56429.json delete mode 100644 test/data/175771d7dd9d5079ec2282d6c375f57e4e71863f.json delete mode 100644 test/data/207db8a082add2a0239f42aed4a1d2aa2435b27a.json delete mode 100644 test/data/3a37b867f12068c4909e7a817ed3e1a179b81f9c.json delete mode 100644 test/data/3dc324021634d5f0a70e60070d06db240a2732b0.json delete mode 100644 test/data/494759db64d979ad79ff82ef8e536eb46163c447.json delete mode 100644 test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json delete mode 100644 test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json delete mode 100644 test/data/5e784e00fc6d9fb01a8843f6e251e6811459169c.json delete mode 100644 test/data/618bea5f5551dede21edba216e12db446ca68486.json delete mode 100644 test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json delete mode 100644 test/data/6757c3f434961f4b54c70c4b133e2fbeb1f75dfa.json delete mode 100644 test/data/714c990e6ea2e283c39d1f3a8d1b7680fedaed53.json delete mode 100644 test/data/79c5170d875b36823010af2a74154bbd509bc3bc.json delete mode 100644 test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json delete mode 100644 test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json delete mode 100644 test/data/9524769002c6f1710084a9b2f020b2560af883ab.json delete mode 100644 test/data/993e86908a8b1681d083ebb686fc8d10989b0632.json delete mode 100644 test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json delete mode 100644 test/data/9e08258766b498e71f703d93796baa80fc37ddc5.json delete mode 100644 test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json delete mode 100644 test/data/a158dc7a4513763428bf651dcf148ab41d72d3af.json delete mode 100644 test/data/a91ac04b00106a44611383931aef281f37cd304e.json delete mode 100644 test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json delete mode 100644 test/data/b13047680b4558dbac498c3202a772dc79fe8628.json delete mode 100644 test/data/e39cb61dbe788ea7b644cc3542a13b2b09a73c15.json delete mode 100644 test/data/e6ea436e837ecec4ca8e2283a0a1e7900a997b6e.json delete mode 100644 test/data/f81ee4f1d7ff04f2dd45675f0f50a4e9094a5d13.json diff --git a/test/data/01db5fcee72a401636213f0e5e607c83e15eb11f.json b/test/data/01db5fcee72a401636213f0e5e607c83e15eb11f.json deleted file mode 100644 index 7fe44c9..0000000 --- a/test/data/01db5fcee72a401636213f0e5e607c83e15eb11f.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "request": { - "path": "https://eos.greymass.com/v1/chain/get_info", - "params": { - "method": "GET" - } - }, - "status": 200, - "json": { - "server_version": "43873e82", - "chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906", - "head_block_num": 340895511, - "last_irreversible_block_num": 340895176, - "last_irreversible_block_id": "1451a5c88df252644e99a33ca328c3bd8d5e81361b9524b10a14b6901f6a2f55", - "head_block_id": "1451a717d660644b1e45760e39f9cfab50a983bb926940325b6f543987ca7366", - "head_block_time": "2023-11-10T17:36:11.000", - "head_block_producer": "bitfinexeos1", - "virtual_block_cpu_limit": 200000, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v3.2.3-hotfix", - "fork_db_head_block_num": 340895511, - "fork_db_head_block_id": "1451a717d660644b1e45760e39f9cfab50a983bb926940325b6f543987ca7366", - "server_full_version_string": "v3.2.3-hotfix-43873e822160be5e5f364fd867e3c7d27162cd0c-dirty", - "total_cpu_weight": "383322901692810", - "total_net_weight": "96096575077807", - "earliest_available_block_num": 340722102, - "last_irreversible_block_time": "2023-11-10T17:33:23.500" - }, - "text": "{\"server_version\":\"43873e82\",\"chain_id\":\"aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906\",\"head_block_num\":340895511,\"last_irreversible_block_num\":340895176,\"last_irreversible_block_id\":\"1451a5c88df252644e99a33ca328c3bd8d5e81361b9524b10a14b6901f6a2f55\",\"head_block_id\":\"1451a717d660644b1e45760e39f9cfab50a983bb926940325b6f543987ca7366\",\"head_block_time\":\"2023-11-10T17:36:11.000\",\"head_block_producer\":\"bitfinexeos1\",\"virtual_block_cpu_limit\":200000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v3.2.3-hotfix\",\"fork_db_head_block_num\":340895511,\"fork_db_head_block_id\":\"1451a717d660644b1e45760e39f9cfab50a983bb926940325b6f543987ca7366\",\"server_full_version_string\":\"v3.2.3-hotfix-43873e822160be5e5f364fd867e3c7d27162cd0c-dirty\",\"total_cpu_weight\":\"383322901692810\",\"total_net_weight\":\"96096575077807\",\"earliest_available_block_num\":340722102,\"last_irreversible_block_time\":\"2023-11-10T17:33:23.500\"}" -} \ No newline at end of file diff --git a/test/data/069da3efa89d3edc24a644a654740cb46bf56429.json b/test/data/069da3efa89d3edc24a644a654740cb46bf56429.json deleted file mode 100644 index e0ac52f..0000000 --- a/test/data/069da3efa89d3edc24a644a654740cb46bf56429.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "headers": { - "access-control-allow-headers": "X-Requested-With,Accept,Content-Type,Origin", - "access-control-allow-methods": "GET, POST, OPTIONS", - "access-control-allow-origin": "*", - "connection": "close", - "content-length": "554", - "content-type": "application/json", - "date": "Sat, 25 Sep 2021 08:01:05 GMT", - "host": "jungle3.greymass.com", - "server": "nginx" - }, - "status": 200, - "json": { - "rows": [ - "00005349b4ebb444030000a0724e18090000514ef29a7308000000a0724e1809000000a0724e180900004e84d3604e84d36000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c64a4c5911000000619dacd73900000003d74e61001226d1aed3120d0000a0724e180900004639c96bce21000000a0724e1809000000a0724e180900004e84d3604e84d36000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000534599d71501000071fdd168b202000003d74e6101000000010000000000000004454f5300000000" - ], - "more": false, - "next_key": "", - "next_key_bytes": "" - }, - "text": "{\"rows\":[\"00005349b4ebb444030000a0724e18090000514ef29a7308000000a0724e1809000000a0724e180900004e84d3604e84d36000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c64a4c5911000000619dacd73900000003d74e61001226d1aed3120d0000a0724e180900004639c96bce21000000a0724e1809000000a0724e180900004e84d3604e84d36000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000534599d71501000071fdd168b202000003d74e6101000000010000000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\",\"next_key_bytes\":\"\"}" -} \ No newline at end of file diff --git a/test/data/175771d7dd9d5079ec2282d6c375f57e4e71863f.json b/test/data/175771d7dd9d5079ec2282d6c375f57e4e71863f.json deleted file mode 100644 index 359f68a..0000000 --- a/test/data/175771d7dd9d5079ec2282d6c375f57e4e71863f.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "headers": { - "access-control-allow-headers": "X-Requested-With,Accept,Content-Type,Origin", - "access-control-allow-methods": "GET, POST, OPTIONS", - "access-control-allow-origin": "*", - "connection": "close", - "content-length": "168", - "content-type": "application/json", - "date": "Mon, 04 Sep 2023 19:09:10 GMT", - "host": "eos.greymass.com", - "server": "nginx", - "x-cached": "MISS" - }, - "status": 200, - "json": { - "rows": [ - "00407a10f35a00000452414d434f52453e4e92cf4d0000000052414d00000000000000000000e03f97babe970c00000004454f5300000000000000000000e03f" - ], - "more": false, - "next_key": "" - }, - "text": "{\"rows\":[\"00407a10f35a00000452414d434f52453e4e92cf4d0000000052414d00000000000000000000e03f97babe970c00000004454f5300000000000000000000e03f\"],\"more\":false,\"next_key\":\"\"}" -} \ No newline at end of file diff --git a/test/data/207db8a082add2a0239f42aed4a1d2aa2435b27a.json b/test/data/207db8a082add2a0239f42aed4a1d2aa2435b27a.json deleted file mode 100644 index b41ae51..0000000 --- a/test/data/207db8a082add2a0239f42aed4a1d2aa2435b27a.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "request": { - "path": "https://wax.greymass.com/v1/chain/get_info", - "params": { - "method": "GET" - } - }, - "status": 200, - "json": { - "server_version": "7aa24ce9", - "chain_id": "1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4", - "head_block_num": 289066283, - "last_irreversible_block_num": 289065947, - "last_irreversible_block_id": "113acbdb0b088d60b5e6fb6c7c923ffdc1034ac6e452cc086b974248c7e82e5b", - "head_block_id": "113acd2bcd90ab0d5c167340fb660ce3deafd23d7c6a9f3c777790bc278efa4f", - "head_block_time": "2024-01-23T10:25:41.500", - "head_block_producer": "alohaeosprod", - "virtual_block_cpu_limit": 219406, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v5.0.0wax01", - "fork_db_head_block_num": 289066283, - "fork_db_head_block_id": "113acd2bcd90ab0d5c167340fb660ce3deafd23d7c6a9f3c777790bc278efa4f", - "server_full_version_string": "v5.0.0wax01-7aa24ce9d98c744564840e23833bdbf7ec00af33", - "total_cpu_weight": "41228592284233074", - "total_net_weight": "133497145042255682", - "earliest_available_block_num": 288892579, - "last_irreversible_block_time": "2024-01-23T10:22:53.500" - }, - "text": "{\"server_version\":\"7aa24ce9\",\"chain_id\":\"1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4\",\"head_block_num\":289066283,\"last_irreversible_block_num\":289065947,\"last_irreversible_block_id\":\"113acbdb0b088d60b5e6fb6c7c923ffdc1034ac6e452cc086b974248c7e82e5b\",\"head_block_id\":\"113acd2bcd90ab0d5c167340fb660ce3deafd23d7c6a9f3c777790bc278efa4f\",\"head_block_time\":\"2024-01-23T10:25:41.500\",\"head_block_producer\":\"alohaeosprod\",\"virtual_block_cpu_limit\":219406,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v5.0.0wax01\",\"fork_db_head_block_num\":289066283,\"fork_db_head_block_id\":\"113acd2bcd90ab0d5c167340fb660ce3deafd23d7c6a9f3c777790bc278efa4f\",\"server_full_version_string\":\"v5.0.0wax01-7aa24ce9d98c744564840e23833bdbf7ec00af33\",\"total_cpu_weight\":\"41228592284233074\",\"total_net_weight\":\"133497145042255682\",\"earliest_available_block_num\":288892579,\"last_irreversible_block_time\":\"2024-01-23T10:22:53.500\"}" -} \ No newline at end of file diff --git a/test/data/3a37b867f12068c4909e7a817ed3e1a179b81f9c.json b/test/data/3a37b867f12068c4909e7a817ed3e1a179b81f9c.json deleted file mode 100644 index 64fd04b..0000000 --- a/test/data/3a37b867f12068c4909e7a817ed3e1a179b81f9c.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "headers": { - "access-control-allow-headers": "X-Requested-With,Accept,Content-Type,Origin", - "access-control-allow-methods": "GET, POST, OPTIONS", - "access-control-allow-origin": "*", - "connection": "close", - "content-length": "853", - "content-type": "application/json", - "date": "Sat, 25 Sep 2021 08:01:05 GMT", - "host": "jungle3.greymass.com", - "server": "nginx" - }, - "status": 200, - "json": { - "server_version": "26a4d285", - "chain_id": "2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840", - "head_block_num": 100688669, - "last_irreversible_block_num": 100688334, - "last_irreversible_block_id": "060061ce3d5775fd99180ffc1a93c153d4ef6a4736a357111d99740a3a4855c4", - "head_block_id": "0600631d1760b0a285d2db1b310c0fa20ada8882ef10ae786e53e135d7aa66f9", - "head_block_time": "2021-09-25T08:01:05.000", - "head_block_producer": "batinthedark", - "virtual_block_cpu_limit": 200000000, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v2.1.0", - "fork_db_head_block_num": 100688669, - "fork_db_head_block_id": "0600631d1760b0a285d2db1b310c0fa20ada8882ef10ae786e53e135d7aa66f9", - "server_full_version_string": "v2.1.0-26a4d285d0be1052d962149e431eb81500782991", - "last_irreversible_block_time": "2021-09-25T07:58:17.500" - }, - "text": "{\"server_version\":\"26a4d285\",\"chain_id\":\"2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840\",\"head_block_num\":100688669,\"last_irreversible_block_num\":100688334,\"last_irreversible_block_id\":\"060061ce3d5775fd99180ffc1a93c153d4ef6a4736a357111d99740a3a4855c4\",\"head_block_id\":\"0600631d1760b0a285d2db1b310c0fa20ada8882ef10ae786e53e135d7aa66f9\",\"head_block_time\":\"2021-09-25T08:01:05.000\",\"head_block_producer\":\"batinthedark\",\"virtual_block_cpu_limit\":200000000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v2.1.0\",\"fork_db_head_block_num\":100688669,\"fork_db_head_block_id\":\"0600631d1760b0a285d2db1b310c0fa20ada8882ef10ae786e53e135d7aa66f9\",\"server_full_version_string\":\"v2.1.0-26a4d285d0be1052d962149e431eb81500782991\",\"last_irreversible_block_time\":\"2021-09-25T07:58:17.500\"}" -} \ No newline at end of file diff --git a/test/data/3dc324021634d5f0a70e60070d06db240a2732b0.json b/test/data/3dc324021634d5f0a70e60070d06db240a2732b0.json deleted file mode 100644 index 3771fb1..0000000 --- a/test/data/3dc324021634d5f0a70e60070d06db240a2732b0.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "headers": { - "access-control-allow-headers": "X-Requested-With,Accept,Content-Type,Origin", - "access-control-allow-methods": "GET, POST, OPTIONS", - "access-control-allow-origin": "*", - "connection": "close", - "content-length": "270", - "content-type": "application/json", - "date": "Sat, 25 Sep 2021 08:01:07 GMT", - "host": "eos.greymass.com", - "server": "nginx", - "x-cached": "EXPIRED" - }, - "status": 200, - "json": { - "rows": [ - "00e0fa6f331300000004454f53000000006219f82a7000000004454f5300000000cb844c020000000004454f53000000004214685e8300000004454f530000000051f9aba540d313000452455800000000000000000000000004454f5300000000218a070000000000" - ], - "more": false, - "next_key": "", - "next_key_bytes": "" - }, - "text": "{\"rows\":[\"00e0fa6f331300000004454f53000000006219f82a7000000004454f5300000000cb844c020000000004454f53000000004214685e8300000004454f530000000051f9aba540d313000452455800000000000000000000000004454f5300000000218a070000000000\"],\"more\":false,\"next_key\":\"\",\"next_key_bytes\":\"\"}" -} \ No newline at end of file diff --git a/test/data/494759db64d979ad79ff82ef8e536eb46163c447.json b/test/data/494759db64d979ad79ff82ef8e536eb46163c447.json deleted file mode 100644 index f1cfacf..0000000 --- a/test/data/494759db64d979ad79ff82ef8e536eb46163c447.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "headers": { - "access-control-allow-headers": "X-Requested-With,Accept,Content-Type,Origin", - "access-control-allow-methods": "GET, POST, OPTIONS", - "access-control-allow-origin": "*", - "connection": "close", - "content-length": "1956", - "content-type": "application/json", - "date": "Sat, 25 Sep 2021 08:01:04 GMT", - "host": "eos.greymass.com", - "server": "nginx", - "x-cached": "EXPIRED" - }, - "status": 200, - "json": { - "account_name": "b1", - "head_block_num": 206790429, - "head_block_time": "2021-09-25T08:01:04.500", - "privileged": false, - "last_code_update": "1970-01-01T00:00:00.000", - "created": "2018-06-09T11:58:03.500", - "core_liquid_balance": "1500000.0029 EOS", - "ram_quota": "34307705487", - "net_weight": "398984142967", - "cpu_weight": "345999975142", - "net_limit": { - "used": 145, - "available": "748210466963", - "max": "748210467108", - "last_usage_update_time": "2021-09-23T02:01:22.500", - "current_used": 0 - }, - "cpu_limit": { - "used": 1222, - "available": 31097733, - "max": 31098955, - "last_usage_update_time": "2021-09-23T02:01:22.500", - "current_used": 0 - }, - "ram_usage": 4786, - "permissions": [ - { - "perm_name": "active", - "parent": "owner", - "required_auth": { - "threshold": 2, - "keys": [ - { - "key": "EOS6hQ6v8vut1V2giQCYha7J225GCzFJtF3o7fy8JYuN7k6fG4n23", - "weight": 1 - }, - { - "key": "EOS6kY8kfmFHiXkVqxDNo1uRhW9g4SvHsfgdvfMu2N6Qz4A59rrjd", - "weight": 1 - }, - { - "key": "EOS7RodmQofvAxgYBJzfNuwRKr6TWh5LbCBfB4uQ8tjrjQ8Ukkwqq", - "weight": 1 - }, - { - "key": "EOS7c9jHNgbtTMYgpXvmTb1kW61oH6kwfGioWk75ugDMhsywe6rWu", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - } - }, - { - "perm_name": "owner", - "parent": "", - "required_auth": { - "threshold": 2, - "keys": [ - { - "key": "EOS6hQ6v8vut1V2giQCYha7J225GCzFJtF3o7fy8JYuN7k6fG4n23", - "weight": 1 - }, - { - "key": "EOS6kY8kfmFHiXkVqxDNo1uRhW9g4SvHsfgdvfMu2N6Qz4A59rrjd", - "weight": 1 - }, - { - "key": "EOS7RodmQofvAxgYBJzfNuwRKr6TWh5LbCBfB4uQ8tjrjQ8Ukkwqq", - "weight": 1 - }, - { - "key": "EOS7c9jHNgbtTMYgpXvmTb1kW61oH6kwfGioWk75ugDMhsywe6rWu", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - } - } - ], - "total_resources": { - "owner": "b1", - "net_weight": "39898414.2967 EOS", - "cpu_weight": "34599997.5142 EOS", - "ram_bytes": "34307704087" - }, - "self_delegated_bandwidth": { - "from": "b1", - "to": "b1", - "net_weight": "39898414.2967 EOS", - "cpu_weight": "34599997.5142 EOS" - }, - "refund_request": null, - "voter_info": { - "owner": "b1", - "proxy": "sub2.b1", - "producers": [], - "staked": "745004118109", - "last_vote_weight": "2698603975553012224.00000000000000000", - "proxied_vote_weight": "0.00000000000000000", - "is_proxy": 0, - "flags1": 0, - "reserved2": 0, - "reserved3": "0.0000 EOS" - }, - "rex_info": null - }, - "text": "{\"account_name\":\"b1\",\"head_block_num\":206790429,\"head_block_time\":\"2021-09-25T08:01:04.500\",\"privileged\":false,\"last_code_update\":\"1970-01-01T00:00:00.000\",\"created\":\"2018-06-09T11:58:03.500\",\"core_liquid_balance\":\"1500000.0029 EOS\",\"ram_quota\":\"34307705487\",\"net_weight\":\"398984142967\",\"cpu_weight\":\"345999975142\",\"net_limit\":{\"used\":145,\"available\":\"748210466963\",\"max\":\"748210467108\",\"last_usage_update_time\":\"2021-09-23T02:01:22.500\",\"current_used\":0},\"cpu_limit\":{\"used\":1222,\"available\":31097733,\"max\":31098955,\"last_usage_update_time\":\"2021-09-23T02:01:22.500\",\"current_used\":0},\"ram_usage\":4786,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":2,\"keys\":[{\"key\":\"EOS6hQ6v8vut1V2giQCYha7J225GCzFJtF3o7fy8JYuN7k6fG4n23\",\"weight\":1},{\"key\":\"EOS6kY8kfmFHiXkVqxDNo1uRhW9g4SvHsfgdvfMu2N6Qz4A59rrjd\",\"weight\":1},{\"key\":\"EOS7RodmQofvAxgYBJzfNuwRKr6TWh5LbCBfB4uQ8tjrjQ8Ukkwqq\",\"weight\":1},{\"key\":\"EOS7c9jHNgbtTMYgpXvmTb1kW61oH6kwfGioWk75ugDMhsywe6rWu\",\"weight\":1}],\"accounts\":[],\"waits\":[]}},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":2,\"keys\":[{\"key\":\"EOS6hQ6v8vut1V2giQCYha7J225GCzFJtF3o7fy8JYuN7k6fG4n23\",\"weight\":1},{\"key\":\"EOS6kY8kfmFHiXkVqxDNo1uRhW9g4SvHsfgdvfMu2N6Qz4A59rrjd\",\"weight\":1},{\"key\":\"EOS7RodmQofvAxgYBJzfNuwRKr6TWh5LbCBfB4uQ8tjrjQ8Ukkwqq\",\"weight\":1},{\"key\":\"EOS7c9jHNgbtTMYgpXvmTb1kW61oH6kwfGioWk75ugDMhsywe6rWu\",\"weight\":1}],\"accounts\":[],\"waits\":[]}}],\"total_resources\":{\"owner\":\"b1\",\"net_weight\":\"39898414.2967 EOS\",\"cpu_weight\":\"34599997.5142 EOS\",\"ram_bytes\":\"34307704087\"},\"self_delegated_bandwidth\":{\"from\":\"b1\",\"to\":\"b1\",\"net_weight\":\"39898414.2967 EOS\",\"cpu_weight\":\"34599997.5142 EOS\"},\"refund_request\":null,\"voter_info\":{\"owner\":\"b1\",\"proxy\":\"sub2.b1\",\"producers\":[],\"staked\":\"745004118109\",\"last_vote_weight\":\"2698603975553012224.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0.0000 EOS\"},\"rex_info\":null}" -} \ No newline at end of file diff --git a/test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json b/test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json deleted file mode 100644 index 1a91160..0000000 --- a/test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_table_rows", - "params": { - "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", - "headers": {} - } - }, - "status": 200, - "json": { - "rows": [ - "00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f5300000000458406b2310b0000454ff94f300b000015e37468000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c62be9e3a52200000dc40511d822000015e3746801000000e80300000000000004454f5300000000" - ], - "more": false, - "next_key": "" - }, - "text": "{\"rows\":[\"00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f5300000000458406b2310b0000454ff94f300b000015e37468000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c62be9e3a52200000dc40511d822000015e3746801000000e80300000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\"}" -} \ No newline at end of file diff --git a/test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json b/test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json deleted file mode 100644 index 80f0a1e..0000000 --- a/test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "request": { - "path": "https://eos.greymass.com/v1/chain/get_info", - "params": { - "method": "GET", - "headers": {} - } - }, - "status": 200, - "json": { - "server_version": "57465074", - "chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906", - "head_block_num": 446536657, - "last_irreversible_block_num": 446536655, - "last_irreversible_block_id": "1a9d9bcf41609405b18e2821acec0fc5398de1c5dd5955b6be2864b16721784e", - "head_block_id": "1a9d9bd1ac958b58d25cd4a033ebfd3c9d4a16f21d1aef871989e3aaac9eb980", - "head_block_time": "2025-07-14T21:47:31.000", - "head_block_producer": "aus1genereos", - "virtual_block_cpu_limit": 200000, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v1.0.1", - "fork_db_head_block_num": 446536657, - "fork_db_head_block_id": "1a9d9bd1ac958b58d25cd4a033ebfd3c9d4a16f21d1aef871989e3aaac9eb980", - "server_full_version_string": "v1.0.1-574650744460373f635d48cac9aa6dee67dcbfdb", - "total_cpu_weight": "382521459045091", - "total_net_weight": "95689592403490", - "earliest_available_block_num": 446363673, - "last_irreversible_block_time": "2025-07-14T21:47:30.000" - }, - "text": "{\"server_version\":\"57465074\",\"chain_id\":\"aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906\",\"head_block_num\":446536657,\"last_irreversible_block_num\":446536655,\"last_irreversible_block_id\":\"1a9d9bcf41609405b18e2821acec0fc5398de1c5dd5955b6be2864b16721784e\",\"head_block_id\":\"1a9d9bd1ac958b58d25cd4a033ebfd3c9d4a16f21d1aef871989e3aaac9eb980\",\"head_block_time\":\"2025-07-14T21:47:31.000\",\"head_block_producer\":\"aus1genereos\",\"virtual_block_cpu_limit\":200000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v1.0.1\",\"fork_db_head_block_num\":446536657,\"fork_db_head_block_id\":\"1a9d9bd1ac958b58d25cd4a033ebfd3c9d4a16f21d1aef871989e3aaac9eb980\",\"server_full_version_string\":\"v1.0.1-574650744460373f635d48cac9aa6dee67dcbfdb\",\"total_cpu_weight\":\"382521459045091\",\"total_net_weight\":\"95689592403490\",\"earliest_available_block_num\":446363673,\"last_irreversible_block_time\":\"2025-07-14T21:47:30.000\"}" -} \ No newline at end of file diff --git a/test/data/5e784e00fc6d9fb01a8843f6e251e6811459169c.json b/test/data/5e784e00fc6d9fb01a8843f6e251e6811459169c.json deleted file mode 100644 index 75d9a95..0000000 --- a/test/data/5e784e00fc6d9fb01a8843f6e251e6811459169c.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "request": { - "path": "https://eos.greymass.com/v1/chain/get_account", - "params": { - "method": "POST", - "body": "{\"account_name\":\"b1\"}", - "headers": {} - } - }, - "status": 200, - "json": { - "account_name": "b1", - "head_block_num": 340895515, - "head_block_time": "2023-11-10T17:36:13.000", - "privileged": false, - "last_code_update": "1970-01-01T00:00:00.000", - "created": "2018-06-09T11:58:03.500", - "core_liquid_balance": "0.2966 EOS", - "ram_quota": 9487, - "net_weight": "350078512340", - "cpu_weight": "296624975145", - "net_limit": { - "used": 271, - "available": "660087025601", - "max": "660087025872", - "last_usage_update_time": "2022-08-23T01:41:35.000", - "current_used": 0 - }, - "cpu_limit": { - "used": 4647, - "available": 26738756, - "max": 26743403, - "last_usage_update_time": "2022-08-23T01:41:35.000", - "current_used": 0 - }, - "ram_usage": 5010, - "permissions": [ - { - "perm_name": "active", - "parent": "owner", - "required_auth": { - "threshold": 2, - "keys": [ - { - "key": "EOS5BUDFbb2erXiRP8qHQAgVboCHgHGesbCubUfgXYJhnYZKSqNbD", - "weight": 1 - }, - { - "key": "EOS6hQ6v8vut1V2giQCYha7J225GCzFJtF3o7fy8JYuN7k6fG4n23", - "weight": 1 - }, - { - "key": "EOS7RodmQofvAxgYBJzfNuwRKr6TWh5LbCBfB4uQ8tjrjQ8Ukkwqq", - "weight": 1 - }, - { - "key": "EOS7c9jHNgbtTMYgpXvmTb1kW61oH6kwfGioWk75ugDMhsywe6rWu", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - }, - "linked_actions": [] - }, - { - "perm_name": "owner", - "parent": "", - "required_auth": { - "threshold": 2, - "keys": [ - { - "key": "EOS5BUDFbb2erXiRP8qHQAgVboCHgHGesbCubUfgXYJhnYZKSqNbD", - "weight": 1 - }, - { - "key": "EOS6hQ6v8vut1V2giQCYha7J225GCzFJtF3o7fy8JYuN7k6fG4n23", - "weight": 1 - }, - { - "key": "EOS7RodmQofvAxgYBJzfNuwRKr6TWh5LbCBfB4uQ8tjrjQ8Ukkwqq", - "weight": 1 - }, - { - "key": "EOS7c9jHNgbtTMYgpXvmTb1kW61oH6kwfGioWk75ugDMhsywe6rWu", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - }, - "linked_actions": [] - } - ], - "total_resources": { - "owner": "b1", - "net_weight": "35007851.2340 EOS", - "cpu_weight": "29662497.5145 EOS", - "ram_bytes": 8087 - }, - "self_delegated_bandwidth": { - "from": "b1", - "to": "b1", - "net_weight": "35007851.2340 EOS", - "cpu_weight": "29662497.5145 EOS" - }, - "refund_request": null, - "voter_info": { - "owner": "b1", - "proxy": "", - "producers": [], - "staked": "646723487485", - "last_vote_weight": "2768257912613634048.00000000000000000", - "proxied_vote_weight": "0.00000000000000000", - "is_proxy": 0, - "flags1": 0, - "reserved2": 0, - "reserved3": "0.0000 EOS" - }, - "rex_info": null, - "subjective_cpu_bill_limit": { - "used": 0, - "available": 0, - "max": 0, - "last_usage_update_time": "2000-01-01T00:00:00.000", - "current_used": 0 - }, - "eosio_any_linked_actions": [] - }, - "text": "{\"account_name\":\"b1\",\"head_block_num\":340895515,\"head_block_time\":\"2023-11-10T17:36:13.000\",\"privileged\":false,\"last_code_update\":\"1970-01-01T00:00:00.000\",\"created\":\"2018-06-09T11:58:03.500\",\"core_liquid_balance\":\"0.2966 EOS\",\"ram_quota\":9487,\"net_weight\":\"350078512340\",\"cpu_weight\":\"296624975145\",\"net_limit\":{\"used\":271,\"available\":\"660087025601\",\"max\":\"660087025872\",\"last_usage_update_time\":\"2022-08-23T01:41:35.000\",\"current_used\":0},\"cpu_limit\":{\"used\":4647,\"available\":26738756,\"max\":26743403,\"last_usage_update_time\":\"2022-08-23T01:41:35.000\",\"current_used\":0},\"ram_usage\":5010,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":2,\"keys\":[{\"key\":\"EOS5BUDFbb2erXiRP8qHQAgVboCHgHGesbCubUfgXYJhnYZKSqNbD\",\"weight\":1},{\"key\":\"EOS6hQ6v8vut1V2giQCYha7J225GCzFJtF3o7fy8JYuN7k6fG4n23\",\"weight\":1},{\"key\":\"EOS7RodmQofvAxgYBJzfNuwRKr6TWh5LbCBfB4uQ8tjrjQ8Ukkwqq\",\"weight\":1},{\"key\":\"EOS7c9jHNgbtTMYgpXvmTb1kW61oH6kwfGioWk75ugDMhsywe6rWu\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":2,\"keys\":[{\"key\":\"EOS5BUDFbb2erXiRP8qHQAgVboCHgHGesbCubUfgXYJhnYZKSqNbD\",\"weight\":1},{\"key\":\"EOS6hQ6v8vut1V2giQCYha7J225GCzFJtF3o7fy8JYuN7k6fG4n23\",\"weight\":1},{\"key\":\"EOS7RodmQofvAxgYBJzfNuwRKr6TWh5LbCBfB4uQ8tjrjQ8Ukkwqq\",\"weight\":1},{\"key\":\"EOS7c9jHNgbtTMYgpXvmTb1kW61oH6kwfGioWk75ugDMhsywe6rWu\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]}],\"total_resources\":{\"owner\":\"b1\",\"net_weight\":\"35007851.2340 EOS\",\"cpu_weight\":\"29662497.5145 EOS\",\"ram_bytes\":8087},\"self_delegated_bandwidth\":{\"from\":\"b1\",\"to\":\"b1\",\"net_weight\":\"35007851.2340 EOS\",\"cpu_weight\":\"29662497.5145 EOS\"},\"refund_request\":null,\"voter_info\":{\"owner\":\"b1\",\"proxy\":\"\",\"producers\":[],\"staked\":\"646723487485\",\"last_vote_weight\":\"2768257912613634048.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0.0000 EOS\"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":0,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" -} diff --git a/test/data/618bea5f5551dede21edba216e12db446ca68486.json b/test/data/618bea5f5551dede21edba216e12db446ca68486.json deleted file mode 100644 index 8769237..0000000 --- a/test/data/618bea5f5551dede21edba216e12db446ca68486.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "request": { - "path": "https://eos.greymass.com/v1/chain/get_table_rows", - "params": { - "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rexpool\",\"key_type\":\"name\",\"json\":false}", - "headers": {} - } - }, - "status": 200, - "json": { - "rows": [ - "003c6ed8140700000004454f5300000000c6cb1eb08700000004454f5300000000fef112020000000004454f5300000000023af7c48e00000004454f5300000000aeec1953f67015000452455800000000000000000000000004454f5300000000f2ad070000000000" - ], - "more": false, - "next_key": "" - }, - "text": "{\"rows\":[\"003c6ed8140700000004454f5300000000c6cb1eb08700000004454f5300000000fef112020000000004454f5300000000023af7c48e00000004454f5300000000aeec1953f67015000452455800000000000000000000000004454f5300000000f2ad070000000000\"],\"more\":false,\"next_key\":\"\"}" -} diff --git a/test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json b/test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json deleted file mode 100644 index d345522..0000000 --- a/test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "request": { - "path": "https://wax.greymass.com/v1/chain/get_account", - "params": { - "method": "POST", - "body": "{\"account_name\":\"boost.wax\"}", - "headers": {} - } - }, - "status": 200, - "json": { - "account_name": "boost.wax", - "head_block_num": 382100572, - "head_block_time": "2025-07-14T21:47:41.500", - "privileged": false, - "last_code_update": "2022-11-01T21:44:57.500", - "created": "2020-04-09T20:28:34.500", - "core_liquid_balance": "3796281.62693477 WAX", - "ram_quota": 106721149, - "net_weight": "30001100000000", - "cpu_weight": "770055200000000", - "net_limit": { - "used": 1914466, - "available": "14056505669", - "max": "14058420135", - "last_usage_update_time": "2025-07-14T21:47:22.500", - "current_used": 1914045 - }, - "cpu_limit": { - "used": 1305735, - "available": 200004187, - "max": 201309922, - "last_usage_update_time": "2025-07-14T21:47:22.500", - "current_used": 1305448 - }, - "ram_usage": 13138903, - "permissions": [ - { - "perm_name": "active", - "parent": "owner", - "required_auth": { - "threshold": 1, - "keys": [], - "accounts": [ - { - "permission": { - "actor": "admin.wax", - "permission": "active" - }, - "weight": 1 - }, - { - "permission": { - "actor": "boost.wax", - "permission": "eosio.code" - }, - "weight": 1 - } - ], - "waits": [] - }, - "linked_actions": [] - }, - { - "perm_name": "deploy", - "parent": "active", - "required_auth": { - "threshold": 1, - "keys": [], - "accounts": [ - { - "permission": { - "actor": "deploy.wax", - "permission": "all" - }, - "weight": 1 - } - ], - "waits": [] - }, - "linked_actions": [ - { - "account": "eosio", - "action": "setcode" - }, - { - "account": "eosio", - "action": "setabi" - } - ] - }, - { - "perm_name": "owner", - "parent": "", - "required_auth": { - "threshold": 1, - "keys": [], - "accounts": [ - { - "permission": { - "actor": "admin.wax", - "permission": "active" - }, - "weight": 1 - } - ], - "waits": [] - }, - "linked_actions": [] - }, - { - "perm_name": "paybw", - "parent": "active", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS5B2c2wNjaq342758aYvE71dTxpBVqHocnRU1aWxUdZAuxbgM6f", - "weight": 1 - } - ], - "accounts": [ - { - "permission": { - "actor": "oracle.wax", - "permission": "rngops" - }, - "weight": 1 - } - ], - "waits": [] - }, - "linked_actions": [ - { - "account": "boost.wax", - "action": "noop" - } - ] - } - ], - "total_resources": { - "owner": "boost.wax", - "net_weight": "300011.00000000 WAX", - "cpu_weight": "7700552.00000000 WAX", - "ram_bytes": 106719749 - }, - "self_delegated_bandwidth": null, - "refund_request": null, - "voter_info": { - "owner": "boost.wax", - "proxy": "", - "producers": [], - "staked": 0, - "unpaid_voteshare": "0.00000000000000000", - "unpaid_voteshare_last_updated": "1970-01-01T00:00:00.000", - "unpaid_voteshare_change_rate": "0.00000000000000000", - "last_claim_time": "1970-01-01T00:00:00.000", - "last_vote_weight": "0.00000000000000000", - "proxied_vote_weight": "0.00000000000000000", - "is_proxy": 0, - "flags1": 0, - "reserved2": 0, - "reserved3": "0 " - }, - "rex_info": null, - "subjective_cpu_bill_limit": { - "used": 20477, - "available": 0, - "max": 0, - "last_usage_update_time": "2000-01-01T00:00:00.000", - "current_used": 0 - }, - "eosio_any_linked_actions": [] - }, - "text": "{\"account_name\":\"boost.wax\",\"head_block_num\":382100572,\"head_block_time\":\"2025-07-14T21:47:41.500\",\"privileged\":false,\"last_code_update\":\"2022-11-01T21:44:57.500\",\"created\":\"2020-04-09T20:28:34.500\",\"core_liquid_balance\":\"3796281.62693477 WAX\",\"ram_quota\":106721149,\"net_weight\":\"30001100000000\",\"cpu_weight\":\"770055200000000\",\"net_limit\":{\"used\":1914466,\"available\":\"14056505669\",\"max\":\"14058420135\",\"last_usage_update_time\":\"2025-07-14T21:47:22.500\",\"current_used\":1914045},\"cpu_limit\":{\"used\":1305735,\"available\":200004187,\"max\":201309922,\"last_usage_update_time\":\"2025-07-14T21:47:22.500\",\"current_used\":1305448},\"ram_usage\":13138903,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"admin.wax\",\"permission\":\"active\"},\"weight\":1},{\"permission\":{\"actor\":\"boost.wax\",\"permission\":\"eosio.code\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"deploy\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"deploy.wax\",\"permission\":\"all\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[{\"account\":\"eosio\",\"action\":\"setcode\"},{\"account\":\"eosio\",\"action\":\"setabi\"}]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"admin.wax\",\"permission\":\"active\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"paybw\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS5B2c2wNjaq342758aYvE71dTxpBVqHocnRU1aWxUdZAuxbgM6f\",\"weight\":1}],\"accounts\":[{\"permission\":{\"actor\":\"oracle.wax\",\"permission\":\"rngops\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[{\"account\":\"boost.wax\",\"action\":\"noop\"}]}],\"total_resources\":{\"owner\":\"boost.wax\",\"net_weight\":\"300011.00000000 WAX\",\"cpu_weight\":\"7700552.00000000 WAX\",\"ram_bytes\":106719749},\"self_delegated_bandwidth\":null,\"refund_request\":null,\"voter_info\":{\"owner\":\"boost.wax\",\"proxy\":\"\",\"producers\":[],\"staked\":0,\"unpaid_voteshare\":\"0.00000000000000000\",\"unpaid_voteshare_last_updated\":\"1970-01-01T00:00:00.000\",\"unpaid_voteshare_change_rate\":\"0.00000000000000000\",\"last_claim_time\":\"1970-01-01T00:00:00.000\",\"last_vote_weight\":\"0.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0 \"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":20477,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" -} \ No newline at end of file diff --git a/test/data/6757c3f434961f4b54c70c4b133e2fbeb1f75dfa.json b/test/data/6757c3f434961f4b54c70c4b133e2fbeb1f75dfa.json deleted file mode 100644 index c37338c..0000000 --- a/test/data/6757c3f434961f4b54c70c4b133e2fbeb1f75dfa.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "request": { - "path": "https://eos.greymass.com/v1/chain/get_account", - "params": { - "method": "POST", - "body": "{\"account_name\":\"eosio.reserv\"}", - "headers": {} - } - }, - "status": 200, - "json": { - "account_name": "eosio.reserv", - "head_block_num": 446530512, - "head_block_time": "2025-07-14T20:56:17.000", - "privileged": false, - "last_code_update": "1970-01-01T00:00:00.000", - "created": "2021-02-07T15:45:07.500", - "ram_quota": 9587, - "net_weight": "95356278485774", - "cpu_weight": "362246729107787", - "net_limit": { - "used": 0, - "available": "180562783078374", - "max": "180562783078374", - "last_usage_update_time": "2021-02-07T15:45:07.500", - "current_used": 0 - }, - "cpu_limit": { - "used": 0, - "available": "32728221285", - "max": "32728221285", - "last_usage_update_time": "2021-02-07T15:45:07.500", - "current_used": 0 - }, - "ram_usage": 3212, - "permissions": [ - { - "perm_name": "active", - "parent": "owner", - "required_auth": { - "threshold": 1, - "keys": [], - "accounts": [ - { - "permission": { - "actor": "eosio", - "permission": "active" - }, - "weight": 1 - } - ], - "waits": [] - }, - "linked_actions": [] - }, - { - "perm_name": "owner", - "parent": "", - "required_auth": { - "threshold": 1, - "keys": [], - "accounts": [ - { - "permission": { - "actor": "eosio", - "permission": "active" - }, - "weight": 1 - } - ], - "waits": [] - }, - "linked_actions": [] - } - ], - "total_resources": { - "owner": "eosio.reserv", - "net_weight": "9535627848.5774 EOS", - "cpu_weight": "36224672910.7787 EOS", - "ram_bytes": 8187 - }, - "self_delegated_bandwidth": null, - "refund_request": null, - "voter_info": null, - "rex_info": null, - "subjective_cpu_bill_limit": { - "used": 0, - "available": 0, - "max": 0, - "last_usage_update_time": "2000-01-01T00:00:00.000", - "current_used": 0 - }, - "eosio_any_linked_actions": [] - }, - "text": "{\"account_name\":\"eosio.reserv\",\"head_block_num\":446530512,\"head_block_time\":\"2025-07-14T20:56:17.000\",\"privileged\":false,\"last_code_update\":\"1970-01-01T00:00:00.000\",\"created\":\"2021-02-07T15:45:07.500\",\"ram_quota\":9587,\"net_weight\":\"95356278485774\",\"cpu_weight\":\"362246729107787\",\"net_limit\":{\"used\":0,\"available\":\"180562783078374\",\"max\":\"180562783078374\",\"last_usage_update_time\":\"2021-02-07T15:45:07.500\",\"current_used\":0},\"cpu_limit\":{\"used\":0,\"available\":\"32728221285\",\"max\":\"32728221285\",\"last_usage_update_time\":\"2021-02-07T15:45:07.500\",\"current_used\":0},\"ram_usage\":3212,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"eosio\",\"permission\":\"active\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"eosio\",\"permission\":\"active\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]}],\"total_resources\":{\"owner\":\"eosio.reserv\",\"net_weight\":\"9535627848.5774 EOS\",\"cpu_weight\":\"36224672910.7787 EOS\",\"ram_bytes\":8187},\"self_delegated_bandwidth\":null,\"refund_request\":null,\"voter_info\":null,\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":0,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" -} \ No newline at end of file diff --git a/test/data/714c990e6ea2e283c39d1f3a8d1b7680fedaed53.json b/test/data/714c990e6ea2e283c39d1f3a8d1b7680fedaed53.json deleted file mode 100644 index 1c975f3..0000000 --- a/test/data/714c990e6ea2e283c39d1f3a8d1b7680fedaed53.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "request": { - "path": "https://wax.greymass.com/v1/chain/get_table_rows", - "params": { - "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", - "headers": {} - } - }, - "status": 200, - "json": { - "rows": [ - "0000ea70c0561920340000404c948b32030042f8c30ce420d5010080c6a47e8d030000404c948b320300411caf6500f6b265000000000000004080510100006e10bacb000000085741580000000000e4eccddf1700000857415800000000c9dc94f2d9000000d881d7e7650100008c30ea65001e5867a10122100000404c948b3203001619a2ac0e3291000080c6a47e8d030000404c948b320300411caf6500f6b265000000000000004080510100006e10bacb000000085741580000000000e4eccddf1700000857415800000000e5eba314f0d9010086d44d5355fd01008c30ea650100000001000000000000000857415800000000" - ], - "more": false, - "next_key": "" - }, - "text": "{\"rows\":[\"0000ea70c0561920340000404c948b32030042f8c30ce420d5010080c6a47e8d030000404c948b320300411caf6500f6b265000000000000004080510100006e10bacb000000085741580000000000e4eccddf1700000857415800000000c9dc94f2d9000000d881d7e7650100008c30ea65001e5867a10122100000404c948b3203001619a2ac0e3291000080c6a47e8d030000404c948b320300411caf6500f6b265000000000000004080510100006e10bacb000000085741580000000000e4eccddf1700000857415800000000e5eba314f0d9010086d44d5355fd01008c30ea650100000001000000000000000857415800000000\"],\"more\":false,\"next_key\":\"\"}" -} diff --git a/test/data/79c5170d875b36823010af2a74154bbd509bc3bc.json b/test/data/79c5170d875b36823010af2a74154bbd509bc3bc.json deleted file mode 100644 index 5ca0da6..0000000 --- a/test/data/79c5170d875b36823010af2a74154bbd509bc3bc.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "request": { - "path": "https://eos.greymass.com/v1/chain/get_table_rows", - "params": { - "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", - "headers": {} - } - }, - "status": 200, - "json": { - "rows": [ - "00002ae97f9fd056000000a0724e180900004e79bb7de00000000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000076ba22b5b0000009ece299b75000000e7694e6500a8a4ff7d425b010000a0724e1809000038e5edf6810300000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f530000000091b4bf6d671b00000724ec6d6c1b0000e7694e6501000000010000000000000004454f5300000000" - ], - "more": false, - "next_key": "" - }, - "text": "{\"rows\":[\"00002ae97f9fd056000000a0724e180900004e79bb7de00000000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000076ba22b5b0000009ece299b75000000e7694e6500a8a4ff7d425b010000a0724e1809000038e5edf6810300000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f530000000091b4bf6d671b00000724ec6d6c1b0000e7694e6501000000010000000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\"}" -} diff --git a/test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json b/test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json deleted file mode 100644 index 17798d2..0000000 --- a/test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "request": { - "path": "https://wax.greymass.com/v1/chain/get_info", - "params": { - "method": "GET", - "headers": {} - } - }, - "status": 200, - "json": { - "server_version": "b18375f7", - "chain_id": "1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4", - "head_block_num": 382100568, - "last_irreversible_block_num": 382100236, - "last_irreversible_block_id": "16c6630c95a000c54c3b8c1f62d31334bb0e766274643da69d015ec43381e2cd", - "head_block_id": "16c66458aa51154f60e748154db514dd6b62d9937b6ae04e8990c18bd60e11e5", - "head_block_time": "2025-07-14T21:47:39.500", - "head_block_producer": "wombatblockx", - "virtual_block_cpu_limit": 201403, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v5.0.3wax01", - "fork_db_head_block_num": 382100568, - "fork_db_head_block_id": "16c66458aa51154f60e748154db514dd6b62d9937b6ae04e8990c18bd60e11e5", - "server_full_version_string": "v5.0.3wax01-b18375f72cde5e3dbc31bcff1d4f546065975d1a", - "total_cpu_weight": "133659827352183743", - "total_net_weight": "386673413163967500", - "earliest_available_block_num": 381927067, - "last_irreversible_block_time": "2025-07-14T21:44:53.500" - }, - "text": "{\"server_version\":\"b18375f7\",\"chain_id\":\"1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4\",\"head_block_num\":382100568,\"last_irreversible_block_num\":382100236,\"last_irreversible_block_id\":\"16c6630c95a000c54c3b8c1f62d31334bb0e766274643da69d015ec43381e2cd\",\"head_block_id\":\"16c66458aa51154f60e748154db514dd6b62d9937b6ae04e8990c18bd60e11e5\",\"head_block_time\":\"2025-07-14T21:47:39.500\",\"head_block_producer\":\"wombatblockx\",\"virtual_block_cpu_limit\":201403,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v5.0.3wax01\",\"fork_db_head_block_num\":382100568,\"fork_db_head_block_id\":\"16c66458aa51154f60e748154db514dd6b62d9937b6ae04e8990c18bd60e11e5\",\"server_full_version_string\":\"v5.0.3wax01-b18375f72cde5e3dbc31bcff1d4f546065975d1a\",\"total_cpu_weight\":\"133659827352183743\",\"total_net_weight\":\"386673413163967500\",\"earliest_available_block_num\":381927067,\"last_irreversible_block_time\":\"2025-07-14T21:44:53.500\"}" -} \ No newline at end of file diff --git a/test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json b/test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json deleted file mode 100644 index beda353..0000000 --- a/test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "request": { - "path": "https://eos.greymass.com/v1/chain/get_account", - "params": { - "method": "POST", - "body": "{\"account_name\":\"greymassfuel\"}", - "headers": {} - } - }, - "status": 200, - "json": { - "account_name": "greymassfuel", - "head_block_num": 446695067, - "head_block_time": "2025-07-15T19:48:22.000", - "privileged": false, - "last_code_update": "1970-01-01T00:00:00.000", - "created": "2019-11-01T22:31:13.500", - "core_liquid_balance": "546.9574 EOS", - "ram_quota": 9229, - "net_weight": 5281058, - "cpu_weight": "5535259600", - "net_limit": { - "used": 139191, - "available": 9860806, - "max": 9999997, - "last_usage_update_time": "2025-07-15T19:45:48.500", - "current_used": 138944 - }, - "cpu_limit": { - "used": 424225, - "available": 75873, - "max": 500098, - "last_usage_update_time": "2025-07-15T19:45:48.500", - "current_used": 423471 - }, - "ram_usage": 4547, - "permissions": [ - { - "perm_name": "active", - "parent": "owner", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS8VE4hVEP4pNdFUwPf2u8inCscVeFGMf1MUt1ec8tfKHaiTJGQk", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - }, - "linked_actions": [] - }, - { - "perm_name": "buyram", - "parent": "active", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS82EHUh2YMR51Hu6JRJWpQUhWQA3KarnePHuyi29AF9iJmoe6nK", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - }, - "linked_actions": [ - { - "account": "eosio", - "action": "buyrambytes" - }, - { - "account": "eosio", - "action": "buyram" - } - ] - }, - { - "perm_name": "cosign", - "parent": "active", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS8Ym3MwFnAgPgDZUB9J9FwW3SrMNhr3JDv9qZA3R7nUC7DnBvm4", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - }, - "linked_actions": [ - { - "account": "greymassnoop", - "action": "noop" - } - ] - }, - { - "perm_name": "owner", - "parent": "", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS6sLkWkqLZKPWEKpRqWU8oS8Tu7Ebjv4B8L82ViDb6r9fgZVYDx", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - }, - "linked_actions": [] - } - ], - "total_resources": { - "owner": "greymassfuel", - "net_weight": "528.1058 EOS", - "cpu_weight": "553525.9600 EOS", - "ram_bytes": 7829 - }, - "self_delegated_bandwidth": null, - "refund_request": null, - "voter_info": { - "owner": "greymassfuel", - "proxy": "", - "producers": [], - "staked": 0, - "last_vote_weight": "0.00000000000000000", - "proxied_vote_weight": "0.00000000000000000", - "is_proxy": 0, - "flags1": 0, - "reserved2": 0, - "reserved3": "0 " - }, - "rex_info": null, - "subjective_cpu_bill_limit": { - "used": 0, - "available": 0, - "max": 0, - "last_usage_update_time": "2000-01-01T00:00:00.000", - "current_used": 0 - }, - "eosio_any_linked_actions": [] - }, - "text": "{\"account_name\":\"greymassfuel\",\"head_block_num\":446695067,\"head_block_time\":\"2025-07-15T19:48:22.000\",\"privileged\":false,\"last_code_update\":\"1970-01-01T00:00:00.000\",\"created\":\"2019-11-01T22:31:13.500\",\"core_liquid_balance\":\"546.9574 EOS\",\"ram_quota\":9229,\"net_weight\":5281058,\"cpu_weight\":\"5535259600\",\"net_limit\":{\"used\":139191,\"available\":9860806,\"max\":9999997,\"last_usage_update_time\":\"2025-07-15T19:45:48.500\",\"current_used\":138944},\"cpu_limit\":{\"used\":424225,\"available\":75873,\"max\":500098,\"last_usage_update_time\":\"2025-07-15T19:45:48.500\",\"current_used\":423471},\"ram_usage\":4547,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS8VE4hVEP4pNdFUwPf2u8inCscVeFGMf1MUt1ec8tfKHaiTJGQk\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"buyram\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS82EHUh2YMR51Hu6JRJWpQUhWQA3KarnePHuyi29AF9iJmoe6nK\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"eosio\",\"action\":\"buyrambytes\"},{\"account\":\"eosio\",\"action\":\"buyram\"}]},{\"perm_name\":\"cosign\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS8Ym3MwFnAgPgDZUB9J9FwW3SrMNhr3JDv9qZA3R7nUC7DnBvm4\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"greymassnoop\",\"action\":\"noop\"}]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS6sLkWkqLZKPWEKpRqWU8oS8Tu7Ebjv4B8L82ViDb6r9fgZVYDx\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]}],\"total_resources\":{\"owner\":\"greymassfuel\",\"net_weight\":\"528.1058 EOS\",\"cpu_weight\":\"553525.9600 EOS\",\"ram_bytes\":7829},\"self_delegated_bandwidth\":null,\"refund_request\":null,\"voter_info\":{\"owner\":\"greymassfuel\",\"proxy\":\"\",\"producers\":[],\"staked\":0,\"last_vote_weight\":\"0.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0 \"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":0,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" -} \ No newline at end of file diff --git a/test/data/9524769002c6f1710084a9b2f020b2560af883ab.json b/test/data/9524769002c6f1710084a9b2f020b2560af883ab.json deleted file mode 100644 index b301246..0000000 --- a/test/data/9524769002c6f1710084a9b2f020b2560af883ab.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "request": { - "path": "https://eos.greymass.com/v1/chain/get_table_rows", - "params": { - "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rammarket\",\"key_type\":\"name\",\"json\":false}", - "headers": {} - } - }, - "status": 200, - "json": { - "rows": [ - "00407a10f35a00000452414d434f5245245a645b0e0000000052414d00000000000000000000e03fe1351e034800000004454f5300000000000000000000e03f" - ], - "more": false, - "next_key": "" - }, - "text": "{\"rows\":[\"00407a10f35a00000452414d434f5245245a645b0e0000000052414d00000000000000000000e03fe1351e034800000004454f5300000000000000000000e03f\"],\"more\":false,\"next_key\":\"\"}" -} diff --git a/test/data/993e86908a8b1681d083ebb686fc8d10989b0632.json b/test/data/993e86908a8b1681d083ebb686fc8d10989b0632.json deleted file mode 100644 index 8769237..0000000 --- a/test/data/993e86908a8b1681d083ebb686fc8d10989b0632.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "request": { - "path": "https://eos.greymass.com/v1/chain/get_table_rows", - "params": { - "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rexpool\",\"key_type\":\"name\",\"json\":false}", - "headers": {} - } - }, - "status": 200, - "json": { - "rows": [ - "003c6ed8140700000004454f5300000000c6cb1eb08700000004454f5300000000fef112020000000004454f5300000000023af7c48e00000004454f5300000000aeec1953f67015000452455800000000000000000000000004454f5300000000f2ad070000000000" - ], - "more": false, - "next_key": "" - }, - "text": "{\"rows\":[\"003c6ed8140700000004454f5300000000c6cb1eb08700000004454f5300000000fef112020000000004454f5300000000023af7c48e00000004454f5300000000aeec1953f67015000452455800000000000000000000000004454f5300000000f2ad070000000000\"],\"more\":false,\"next_key\":\"\"}" -} diff --git a/test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json b/test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json deleted file mode 100644 index d927137..0000000 --- a/test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "request": { - "path": "https://eos.greymass.com/v1/chain/get_table_rows", - "params": { - "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", - "headers": {} - } - }, - "status": 200, - "json": { - "rows": [ - "00002ae97f9fd056000000a0724e180900004e79bb7de00000000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000003ad7e5d22f0000009b50f34d3600000046b0766800a8a4ff7d425b010000a0724e1809000038e5edf6810300000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000003d7df5ad48150000230a7dfb6815000046b0766801000000010000000000000004454f5300000000" - ], - "more": false, - "next_key": "" - }, - "text": "{\"rows\":[\"00002ae97f9fd056000000a0724e180900004e79bb7de00000000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000003ad7e5d22f0000009b50f34d3600000046b0766800a8a4ff7d425b010000a0724e1809000038e5edf6810300000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000003d7df5ad48150000230a7dfb6815000046b0766801000000010000000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\"}" -} \ No newline at end of file diff --git a/test/data/9e08258766b498e71f703d93796baa80fc37ddc5.json b/test/data/9e08258766b498e71f703d93796baa80fc37ddc5.json deleted file mode 100644 index b301246..0000000 --- a/test/data/9e08258766b498e71f703d93796baa80fc37ddc5.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "request": { - "path": "https://eos.greymass.com/v1/chain/get_table_rows", - "params": { - "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rammarket\",\"key_type\":\"name\",\"json\":false}", - "headers": {} - } - }, - "status": 200, - "json": { - "rows": [ - "00407a10f35a00000452414d434f5245245a645b0e0000000052414d00000000000000000000e03fe1351e034800000004454f5300000000000000000000e03f" - ], - "more": false, - "next_key": "" - }, - "text": "{\"rows\":[\"00407a10f35a00000452414d434f5245245a645b0e0000000052414d00000000000000000000e03fe1351e034800000004454f5300000000000000000000e03f\"],\"more\":false,\"next_key\":\"\"}" -} diff --git a/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json b/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json deleted file mode 100644 index c600521..0000000 --- a/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_info", - "params": { - "method": "GET", - "headers": {} - } - }, - "status": 200, - "json": { - "server_version": "13356212", - "chain_id": "73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d", - "head_block_num": 213355243, - "last_irreversible_block_num": 213355241, - "last_irreversible_block_id": "0cb78ae9d244692f7c84c6cb3701d654fcc21a43026c5686eccfbaea77aa7625", - "head_block_id": "0cb78aebc487d33cfd475255cd01f1e20e01ffb66a696777d7c501eebc33b608", - "head_block_time": "2025-07-14T21:47:36.000", - "head_block_producer": "aus1genereos", - "virtual_block_cpu_limit": 200000000, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v1.1.5", - "fork_db_head_block_num": 213355243, - "fork_db_head_block_id": "0cb78aebc487d33cfd475255cd01f1e20e01ffb66a696777d7c501eebc33b608", - "server_full_version_string": "v1.1.5-13356212245054c35b1e1e7e20a9bd43ced48c4d", - "total_cpu_weight": "120570390761712", - "total_net_weight": "117540054157864", - "earliest_available_block_num": 213181258, - "last_irreversible_block_time": "2025-07-14T21:47:35.000" - }, - "text": "{\"server_version\":\"13356212\",\"chain_id\":\"73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d\",\"head_block_num\":213355243,\"last_irreversible_block_num\":213355241,\"last_irreversible_block_id\":\"0cb78ae9d244692f7c84c6cb3701d654fcc21a43026c5686eccfbaea77aa7625\",\"head_block_id\":\"0cb78aebc487d33cfd475255cd01f1e20e01ffb66a696777d7c501eebc33b608\",\"head_block_time\":\"2025-07-14T21:47:36.000\",\"head_block_producer\":\"aus1genereos\",\"virtual_block_cpu_limit\":200000000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v1.1.5\",\"fork_db_head_block_num\":213355243,\"fork_db_head_block_id\":\"0cb78aebc487d33cfd475255cd01f1e20e01ffb66a696777d7c501eebc33b608\",\"server_full_version_string\":\"v1.1.5-13356212245054c35b1e1e7e20a9bd43ced48c4d\",\"total_cpu_weight\":\"120570390761712\",\"total_net_weight\":\"117540054157864\",\"earliest_available_block_num\":213181258,\"last_irreversible_block_time\":\"2025-07-14T21:47:35.000\"}" -} \ No newline at end of file diff --git a/test/data/a158dc7a4513763428bf651dcf148ab41d72d3af.json b/test/data/a158dc7a4513763428bf651dcf148ab41d72d3af.json deleted file mode 100644 index 1b15644..0000000 --- a/test/data/a158dc7a4513763428bf651dcf148ab41d72d3af.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_table_rows", - "params": { - "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", - "headers": {} - } - }, - "status": 200, - "json": { - "rows": [ - "00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f5300000000458406b2310b0000454ff94f300b000015e37468000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c62be9e3a52200000dc40511d822000015e3746801000000e80300000000000004454f5300000000" - ], - "more": false, - "next_key": "" - }, - "text": "{\"rows\":[\"00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f5300000000458406b2310b0000454ff94f300b000015e37468000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c62be9e3a52200000dc40511d822000015e3746801000000e80300000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\"}" -} diff --git a/test/data/a91ac04b00106a44611383931aef281f37cd304e.json b/test/data/a91ac04b00106a44611383931aef281f37cd304e.json deleted file mode 100644 index c5b6a94..0000000 --- a/test/data/a91ac04b00106a44611383931aef281f37cd304e.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "request": { - "path": "https://jungle4.greymass.com/v1/chain/get_info", - "params": { - "method": "GET" - } - }, - "status": 200, - "json": { - "server_version": "905c5cc9", - "chain_id": "73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d", - "head_block_num": 107761721, - "last_irreversible_block_num": 107761390, - "last_irreversible_block_id": "066c4eee01dd56004d35613ee759811dad7a7db92b3e691fd822f9bef3b78850", - "head_block_id": "066c503946353b4af42adf1c0705d8aea8b62a41dc85cb7e43510289c0f2060e", - "head_block_time": "2023-11-10T17:42:27.000", - "head_block_producer": "eosamsterdam", - "virtual_block_cpu_limit": 184188825, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v3.1.3", - "fork_db_head_block_num": 107761721, - "fork_db_head_block_id": "066c503946353b4af42adf1c0705d8aea8b62a41dc85cb7e43510289c0f2060e", - "server_full_version_string": "v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140", - "total_cpu_weight": "120613298869319", - "total_net_weight": "117529300091371", - "earliest_available_block_num": 107585477, - "last_irreversible_block_time": "2023-11-10T17:39:41.500" - }, - "text": "{\"server_version\":\"905c5cc9\",\"chain_id\":\"73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d\",\"head_block_num\":107761721,\"last_irreversible_block_num\":107761390,\"last_irreversible_block_id\":\"066c4eee01dd56004d35613ee759811dad7a7db92b3e691fd822f9bef3b78850\",\"head_block_id\":\"066c503946353b4af42adf1c0705d8aea8b62a41dc85cb7e43510289c0f2060e\",\"head_block_time\":\"2023-11-10T17:42:27.000\",\"head_block_producer\":\"eosamsterdam\",\"virtual_block_cpu_limit\":184188825,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v3.1.3\",\"fork_db_head_block_num\":107761721,\"fork_db_head_block_id\":\"066c503946353b4af42adf1c0705d8aea8b62a41dc85cb7e43510289c0f2060e\",\"server_full_version_string\":\"v3.1.3-905c5cc900b4e88aed4ab6912009127bf9f4f140\",\"total_cpu_weight\":\"120613298869319\",\"total_net_weight\":\"117529300091371\",\"earliest_available_block_num\":107585477,\"last_irreversible_block_time\":\"2023-11-10T17:39:41.500\"}" -} \ No newline at end of file diff --git a/test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json b/test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json deleted file mode 100644 index 02fff7a..0000000 --- a/test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "request": { - "path": "https://wax.greymass.com/v1/chain/get_table_rows", - "params": { - "method": "POST", - "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", - "headers": {} - } - }, - "status": 200, - "json": { - "rows": [ - "00004443c91d14a2460400c06e31d910010042f8c30ce420d5010000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf1700000857415800000000e92252a8a17a2b00027f8cc714cf2b003a9b756800883a7a3d22ca520100c06e31d91001001619a2ac0e3291000000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf17000008574158000000001b61834867c42200c92a9290946325003a9b75680100000001000000000000000857415800000000" - ], - "more": false, - "next_key": "" - }, - "text": "{\"rows\":[\"00004443c91d14a2460400c06e31d910010042f8c30ce420d5010000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf1700000857415800000000e92252a8a17a2b00027f8cc714cf2b003a9b756800883a7a3d22ca520100c06e31d91001001619a2ac0e3291000000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf17000008574158000000001b61834867c42200c92a9290946325003a9b75680100000001000000000000000857415800000000\"],\"more\":false,\"next_key\":\"\"}" -} \ No newline at end of file diff --git a/test/data/b13047680b4558dbac498c3202a772dc79fe8628.json b/test/data/b13047680b4558dbac498c3202a772dc79fe8628.json deleted file mode 100644 index 54f267b..0000000 --- a/test/data/b13047680b4558dbac498c3202a772dc79fe8628.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "headers": { - "access-control-allow-headers": "X-Requested-With,Accept,Content-Type,Origin", - "access-control-allow-methods": "GET, POST, OPTIONS", - "access-control-allow-origin": "*", - "connection": "close", - "content-length": "554", - "content-type": "application/json", - "date": "Sat, 25 Sep 2021 08:01:03 GMT", - "host": "eos.greymass.com", - "server": "nginx", - "x-cached": "EXPIRED" - }, - "status": 200, - "json": { - "rows": [ - "00002ae97f9fd056000000a0724e180900004e79bb7de00000000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000bac8bf620b000000ec7cb3750b0000001dd74e6100a8a4ff7d425b010000a0724e1809000038e5edf6810300000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f530000000054decad5400d0000091ac9dd490e00001dd74e6101000000010000000000000004454f5300000000" - ], - "more": false, - "next_key": "", - "next_key_bytes": "" - }, - "text": "{\"rows\":[\"00002ae97f9fd056000000a0724e180900004e79bb7de00000000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000bac8bf620b000000ec7cb3750b0000001dd74e6100a8a4ff7d425b010000a0724e1809000038e5edf6810300000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f530000000054decad5400d0000091ac9dd490e00001dd74e6101000000010000000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\",\"next_key_bytes\":\"\"}" -} \ No newline at end of file diff --git a/test/data/e39cb61dbe788ea7b644cc3542a13b2b09a73c15.json b/test/data/e39cb61dbe788ea7b644cc3542a13b2b09a73c15.json deleted file mode 100644 index 1c03250..0000000 --- a/test/data/e39cb61dbe788ea7b644cc3542a13b2b09a73c15.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "headers": { - "access-control-allow-headers": "X-Requested-With,Accept,Content-Type,Origin", - "access-control-allow-methods": "GET, POST, OPTIONS", - "access-control-allow-origin": "*", - "connection": "close", - "content-length": "845", - "content-type": "application/json", - "date": "Sat, 25 Sep 2021 08:01:03 GMT", - "host": "eos.greymass.com", - "server": "nginx", - "x-cached": "HIT" - }, - "status": 200, - "json": { - "server_version": "26a4d285", - "chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906", - "head_block_num": 206790424, - "last_irreversible_block_num": 206790095, - "last_irreversible_block_id": "0c535dcfb7c6f6665a7f289f7e9f26b4256b1db383645cec984c66314888d593", - "head_block_id": "0c535f18a25aa05dab742542a22c47facd358ac013c4a1489e1db44131565380", - "head_block_time": "2021-09-25T08:01:02.000", - "head_block_producer": "big.one", - "virtual_block_cpu_limit": 200000, - "virtual_block_net_limit": 1048576000, - "block_cpu_limit": 200000, - "block_net_limit": 1048576, - "server_version_string": "v2.1.0", - "fork_db_head_block_num": 206790424, - "fork_db_head_block_id": "0c535f18a25aa05dab742542a22c47facd358ac013c4a1489e1db44131565380", - "server_full_version_string": "v2.1.0-26a4d285d0be1052d962149e431eb81500782991", - "last_irreversible_block_time": "2021-09-25T07:58:17.500" - }, - "text": "{\"server_version\":\"26a4d285\",\"chain_id\":\"aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906\",\"head_block_num\":206790424,\"last_irreversible_block_num\":206790095,\"last_irreversible_block_id\":\"0c535dcfb7c6f6665a7f289f7e9f26b4256b1db383645cec984c66314888d593\",\"head_block_id\":\"0c535f18a25aa05dab742542a22c47facd358ac013c4a1489e1db44131565380\",\"head_block_time\":\"2021-09-25T08:01:02.000\",\"head_block_producer\":\"big.one\",\"virtual_block_cpu_limit\":200000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v2.1.0\",\"fork_db_head_block_num\":206790424,\"fork_db_head_block_id\":\"0c535f18a25aa05dab742542a22c47facd358ac013c4a1489e1db44131565380\",\"server_full_version_string\":\"v2.1.0-26a4d285d0be1052d962149e431eb81500782991\",\"last_irreversible_block_time\":\"2021-09-25T07:58:17.500\"}" -} \ No newline at end of file diff --git a/test/data/e6ea436e837ecec4ca8e2283a0a1e7900a997b6e.json b/test/data/e6ea436e837ecec4ca8e2283a0a1e7900a997b6e.json deleted file mode 100644 index d66a87f..0000000 --- a/test/data/e6ea436e837ecec4ca8e2283a0a1e7900a997b6e.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "request": { - "path": "https://wax.greymass.com/v1/chain/get_account", - "params": { - "method": "POST", - "body": "{\"account_name\":\"greymassfuel\"}", - "headers": {} - } - }, - "status": 200, - "json": { - "account_name": "greymassfuel", - "head_block_num": 382117080, - "head_block_time": "2025-07-15T00:05:15.500", - "privileged": false, - "last_code_update": "1970-01-01T00:00:00.000", - "created": "2021-02-16T19:10:33.000", - "core_liquid_balance": "8265.03826714 WAX", - "ram_quota": 5399, - "net_weight": "500000000000", - "cpu_weight": "100640000000000", - "net_limit": { - "used": 26518580, - "available": 207779846, - "max": 234298426, - "last_usage_update_time": "2025-07-15T00:05:15.000", - "current_used": 26518426 - }, - "cpu_limit": { - "used": 21230526, - "available": 5396250, - "max": 26626776, - "last_usage_update_time": "2025-07-15T00:05:15.000", - "current_used": 21230403 - }, - "ram_usage": 4714, - "permissions": [ - { - "perm_name": "active", - "parent": "owner", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS8VE4hVEP4pNdFUwPf2u8inCscVeFGMf1MUt1ec8tfKHaiTJGQk", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - }, - "linked_actions": [] - }, - { - "perm_name": "buyram", - "parent": "active", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS82EHUh2YMR51Hu6JRJWpQUhWQA3KarnePHuyi29AF9iJmoe6nK", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - }, - "linked_actions": [ - { - "account": "eosio", - "action": "buyram" - }, - { - "account": "eosio", - "action": "buyrambytes" - } - ] - }, - { - "perm_name": "cosign", - "parent": "active", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS8Ym3MwFnAgPgDZUB9J9FwW3SrMNhr3JDv9qZA3R7nUC7DnBvm4", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - }, - "linked_actions": [ - { - "account": "greymassnoop", - "action": "noop" - } - ] - }, - { - "perm_name": "owner", - "parent": "", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS6RWZ1CmDL4B6LdixuertnzxcRuUDac3NQspJEvMnebGcUwhvfX", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - }, - "linked_actions": [] - } - ], - "total_resources": { - "owner": "greymassfuel", - "net_weight": "5000.00000000 WAX", - "cpu_weight": "1006400.00000000 WAX", - "ram_bytes": 3999 - }, - "self_delegated_bandwidth": { - "from": "greymassfuel", - "to": "greymassfuel", - "net_weight": "0.00000000 WAX", - "cpu_weight": "900.00000000 WAX" - }, - "refund_request": null, - "voter_info": { - "owner": "greymassfuel", - "proxy": "", - "producers": [], - "staked": "90000000000", - "unpaid_voteshare": "0.00000000000000000", - "unpaid_voteshare_last_updated": "1970-01-01T00:00:00.000", - "unpaid_voteshare_change_rate": "0.00000000000000000", - "last_claim_time": "1970-01-01T00:00:00.000", - "last_vote_weight": "0.00000000000000000", - "proxied_vote_weight": "0.00000000000000000", - "is_proxy": 0, - "flags1": 0, - "reserved2": 0, - "reserved3": "0 " - }, - "rex_info": null, - "subjective_cpu_bill_limit": { - "used": 0, - "available": 0, - "max": 0, - "last_usage_update_time": "2000-01-01T00:00:00.000", - "current_used": 0 - }, - "eosio_any_linked_actions": [] - }, - "text": "{\"account_name\":\"greymassfuel\",\"head_block_num\":382117080,\"head_block_time\":\"2025-07-15T00:05:15.500\",\"privileged\":false,\"last_code_update\":\"1970-01-01T00:00:00.000\",\"created\":\"2021-02-16T19:10:33.000\",\"core_liquid_balance\":\"8265.03826714 WAX\",\"ram_quota\":5399,\"net_weight\":\"500000000000\",\"cpu_weight\":\"100640000000000\",\"net_limit\":{\"used\":26518580,\"available\":207779846,\"max\":234298426,\"last_usage_update_time\":\"2025-07-15T00:05:15.000\",\"current_used\":26518426},\"cpu_limit\":{\"used\":21230526,\"available\":5396250,\"max\":26626776,\"last_usage_update_time\":\"2025-07-15T00:05:15.000\",\"current_used\":21230403},\"ram_usage\":4714,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS8VE4hVEP4pNdFUwPf2u8inCscVeFGMf1MUt1ec8tfKHaiTJGQk\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"buyram\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS82EHUh2YMR51Hu6JRJWpQUhWQA3KarnePHuyi29AF9iJmoe6nK\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"eosio\",\"action\":\"buyram\"},{\"account\":\"eosio\",\"action\":\"buyrambytes\"}]},{\"perm_name\":\"cosign\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS8Ym3MwFnAgPgDZUB9J9FwW3SrMNhr3JDv9qZA3R7nUC7DnBvm4\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"greymassnoop\",\"action\":\"noop\"}]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS6RWZ1CmDL4B6LdixuertnzxcRuUDac3NQspJEvMnebGcUwhvfX\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]}],\"total_resources\":{\"owner\":\"greymassfuel\",\"net_weight\":\"5000.00000000 WAX\",\"cpu_weight\":\"1006400.00000000 WAX\",\"ram_bytes\":3999},\"self_delegated_bandwidth\":{\"from\":\"greymassfuel\",\"to\":\"greymassfuel\",\"net_weight\":\"0.00000000 WAX\",\"cpu_weight\":\"900.00000000 WAX\"},\"refund_request\":null,\"voter_info\":{\"owner\":\"greymassfuel\",\"proxy\":\"\",\"producers\":[],\"staked\":\"90000000000\",\"unpaid_voteshare\":\"0.00000000000000000\",\"unpaid_voteshare_last_updated\":\"1970-01-01T00:00:00.000\",\"unpaid_voteshare_change_rate\":\"0.00000000000000000\",\"last_claim_time\":\"1970-01-01T00:00:00.000\",\"last_vote_weight\":\"0.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0 \"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":0,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" -} \ No newline at end of file diff --git a/test/data/f81ee4f1d7ff04f2dd45675f0f50a4e9094a5d13.json b/test/data/f81ee4f1d7ff04f2dd45675f0f50a4e9094a5d13.json deleted file mode 100644 index 4d34440..0000000 --- a/test/data/f81ee4f1d7ff04f2dd45675f0f50a4e9094a5d13.json +++ /dev/null @@ -1,168 +0,0 @@ -{ - "request": { - "path": "https://wax.greymass.com/v1/chain/get_account", - "params": { - "method": "POST", - "body": "{\"account_name\":\"boost.wax\"}", - "headers": {} - } - }, - "status": 200, - "json": { - "account_name": "boost.wax", - "head_block_num": 289066137, - "head_block_time": "2024-01-23T10:24:28.500", - "privileged": false, - "last_code_update": "2022-11-01T21:44:57.500", - "created": "2020-04-09T20:28:34.500", - "core_liquid_balance": "3796281.54208477 WAX", - "ram_quota": 106721149, - "net_weight": "30001100000000", - "cpu_weight": "770055200000000", - "net_limit": { - "used": 2960305, - "available": "40717140941", - "max": "40720101246", - "last_usage_update_time": "2024-01-23T10:24:26.000", - "current_used": 2960219 - }, - "cpu_limit": { - "used": 10699884, - "available": 890363982, - "max": 901063866, - "last_usage_update_time": "2024-01-23T10:24:26.000", - "current_used": 10699574 - }, - "ram_usage": 13138871, - "permissions": [ - { - "perm_name": "active", - "parent": "owner", - "required_auth": { - "threshold": 1, - "keys": [], - "accounts": [ - { - "permission": { - "actor": "admin.wax", - "permission": "active" - }, - "weight": 1 - }, - { - "permission": { - "actor": "boost.wax", - "permission": "eosio.code" - }, - "weight": 1 - } - ], - "waits": [] - }, - "linked_actions": [] - }, - { - "perm_name": "deploy", - "parent": "active", - "required_auth": { - "threshold": 1, - "keys": [], - "accounts": [ - { - "permission": { - "actor": "deploy.wax", - "permission": "all" - }, - "weight": 1 - } - ], - "waits": [] - }, - "linked_actions": [ - { - "account": "eosio", - "action": "setcode" - }, - { - "account": "eosio", - "action": "setabi" - } - ] - }, - { - "perm_name": "owner", - "parent": "", - "required_auth": { - "threshold": 1, - "keys": [], - "accounts": [ - { - "permission": { - "actor": "admin.wax", - "permission": "active" - }, - "weight": 1 - } - ], - "waits": [] - }, - "linked_actions": [] - }, - { - "perm_name": "paybw", - "parent": "active", - "required_auth": { - "threshold": 1, - "keys": [ - { - "key": "EOS5B2c2wNjaq342758aYvE71dTxpBVqHocnRU1aWxUdZAuxbgM6f", - "weight": 1 - } - ], - "accounts": [], - "waits": [] - }, - "linked_actions": [ - { - "account": "boost.wax", - "action": "noop" - } - ] - } - ], - "total_resources": { - "owner": "boost.wax", - "net_weight": "300011.00000000 WAX", - "cpu_weight": "7700552.00000000 WAX", - "ram_bytes": 106719749 - }, - "self_delegated_bandwidth": null, - "refund_request": null, - "voter_info": { - "owner": "boost.wax", - "proxy": "", - "producers": [], - "staked": 0, - "unpaid_voteshare": "0.00000000000000000", - "unpaid_voteshare_last_updated": "1970-01-01T00:00:00.000", - "unpaid_voteshare_change_rate": "0.00000000000000000", - "last_claim_time": "1970-01-01T00:00:00.000", - "last_vote_weight": "0.00000000000000000", - "proxied_vote_weight": "0.00000000000000000", - "is_proxy": 0, - "flags1": 0, - "reserved2": 0, - "reserved3": "0 " - }, - "rex_info": null, - "subjective_cpu_bill_limit": { - "used": 55504, - "available": 0, - "max": 0, - "last_usage_update_time": "2000-01-01T00:00:00.000", - "current_used": 0 - }, - "eosio_any_linked_actions": [] - }, - "text": "{\"account_name\":\"boost.wax\",\"head_block_num\":289066137,\"head_block_time\":\"2024-01-23T10:24:28.500\",\"privileged\":false,\"last_code_update\":\"2022-11-01T21:44:57.500\",\"created\":\"2020-04-09T20:28:34.500\",\"core_liquid_balance\":\"3796281.54208477 WAX\",\"ram_quota\":106721149,\"net_weight\":\"30001100000000\",\"cpu_weight\":\"770055200000000\",\"net_limit\":{\"used\":2960305,\"available\":\"40717140941\",\"max\":\"40720101246\",\"last_usage_update_time\":\"2024-01-23T10:24:26.000\",\"current_used\":2960219},\"cpu_limit\":{\"used\":10699884,\"available\":890363982,\"max\":901063866,\"last_usage_update_time\":\"2024-01-23T10:24:26.000\",\"current_used\":10699574},\"ram_usage\":13138871,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"admin.wax\",\"permission\":\"active\"},\"weight\":1},{\"permission\":{\"actor\":\"boost.wax\",\"permission\":\"eosio.code\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"deploy\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"deploy.wax\",\"permission\":\"all\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[{\"account\":\"eosio\",\"action\":\"setcode\"},{\"account\":\"eosio\",\"action\":\"setabi\"}]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"admin.wax\",\"permission\":\"active\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"paybw\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS5B2c2wNjaq342758aYvE71dTxpBVqHocnRU1aWxUdZAuxbgM6f\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"boost.wax\",\"action\":\"noop\"}]}],\"total_resources\":{\"owner\":\"boost.wax\",\"net_weight\":\"300011.00000000 WAX\",\"cpu_weight\":\"7700552.00000000 WAX\",\"ram_bytes\":106719749},\"self_delegated_bandwidth\":null,\"refund_request\":null,\"voter_info\":{\"owner\":\"boost.wax\",\"proxy\":\"\",\"producers\":[],\"staked\":0,\"unpaid_voteshare\":\"0.00000000000000000\",\"unpaid_voteshare_last_updated\":\"1970-01-01T00:00:00.000\",\"unpaid_voteshare_change_rate\":\"0.00000000000000000\",\"last_claim_time\":\"1970-01-01T00:00:00.000\",\"last_vote_weight\":\"0.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0 \"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":55504,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" -} From 3983499c2a8b3baba4fa091a456cd8acd57e9082 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Wed, 16 Jul 2025 13:28:20 -0700 Subject: [PATCH 13/17] Fixed tests --- src/rex.ts | 19 +- ...cefb4d7749510e87d710cef682f8f1c7b4f6a.json | 19 ++ ...80f33c07aa3ba09b6a5e5581463f95a168feb.json | 33 ++++ ...bea5f5551dede21edba216e12db446ca68486.json | 19 ++ ...6fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json | 176 ++++++++++++++++++ ...e7473fc9df54bb8b45bcf3d759b48ce9a5a64.json | 33 ++++ ...ad3d64af233a183cab24ef0a34585838379c7.json | 148 +++++++++++++++ ...4769002c6f1710084a9b2f020b2560af883ab.json | 19 ++ ...0c13e62013539b53fd522e7d0834cc3a6aa66.json | 19 ++ ...1de03f2a7ee6c133465c8c6b2b286704a5d8f.json | 33 ++++ ...e0d25e3f0a6ac99195e23bd7410ede02c58df.json | 19 ++ test/powerup.ts | 102 +++++----- test/ram.ts | 8 +- test/rex.ts | 26 ++- 14 files changed, 603 insertions(+), 70 deletions(-) create mode 100644 test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json create mode 100644 test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json create mode 100644 test/data/618bea5f5551dede21edba216e12db446ca68486.json create mode 100644 test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json create mode 100644 test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json create mode 100644 test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json create mode 100644 test/data/9524769002c6f1710084a9b2f020b2560af883ab.json create mode 100644 test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json create mode 100644 test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json create mode 100644 test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json diff --git a/src/rex.ts b/src/rex.ts index 3ceb04e..ca215d6 100644 --- a/src/rex.ts +++ b/src/rex.ts @@ -1,4 +1,4 @@ -import {BNPrecision, Resources, SampleUsage} from './' +import {BNPrecision, intToBigDecimal, Resources, SampleUsage} from './' import {Asset, Struct, UInt128, UInt64, UInt8} from '@wharfkit/antelope' @@ -26,17 +26,18 @@ export class REXState extends Struct { } public get value() { - return ( - (Number(this.total_lent.units) + Number(this.total_unlent.units)) / - Number(this.total_rex.units) - ) + const lent = intToBigDecimal(this.total_lent.units) + const unlent = intToBigDecimal(this.total_unlent.units) + const rex = intToBigDecimal(this.total_rex.units) + return Number(lent.add(unlent).divide(rex, 18).getValue()) } exchange(amount: Asset): Asset { - return Asset.from( - (amount.value * this.total_lendable.value) / this.total_rex.value, - this.symbol - ) + const value = intToBigDecimal(amount.units) + const lendable = intToBigDecimal(this.total_lendable.units) + const rex = intToBigDecimal(this.total_rex.units) + const tokens = value.multiply(lendable).divide(rex, this.precision) + return Asset.fromUnits(Number(tokens.getValue()), this.symbol) } cpu_price_per_ms(sample: SampleUsage, ms = 1): number { diff --git a/test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json b/test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json new file mode 100644 index 0000000..9c9530a --- /dev/null +++ b/test/data/518cefb4d7749510e87d710cef682f8f1c7b4f6a.json @@ -0,0 +1,19 @@ +{ + "request": { + "path": "https://jungle4.greymass.com/v1/chain/get_table_rows", + "params": { + "method": "POST", + "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", + "headers": {} + } + }, + "status": 200, + "json": { + "rows": [ + "00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f530000000045bc2962350b000098ddc5e5380b0000eef87768000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c669d12b3822000034d205737a220000eef8776801000000e80300000000000004454f5300000000" + ], + "more": false, + "next_key": "" + }, + "text": "{\"rows\":[\"00000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd751562000000000000004080510100809698000000000004454f5300000000002f68590000000004454f530000000045bc2962350b000098ddc5e5380b0000eef87768000030d53b0a5a000000a0724e180900000010a5d4e800000000a0724e1809000000a0724e18090000dd751562dd75156200000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000c669d12b3822000034d205737a220000eef8776801000000e80300000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\"}" +} \ No newline at end of file diff --git a/test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json b/test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json new file mode 100644 index 0000000..d466ad4 --- /dev/null +++ b/test/data/52780f33c07aa3ba09b6a5e5581463f95a168feb.json @@ -0,0 +1,33 @@ +{ + "request": { + "path": "https://eos.greymass.com/v1/chain/get_info", + "params": { + "method": "GET", + "headers": {} + } + }, + "status": 200, + "json": { + "server_version": "57465074", + "chain_id": "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906", + "head_block_num": 446867844, + "last_irreversible_block_num": 446867842, + "last_irreversible_block_id": "1aa2a9829150573f8bd87bae1c9b91001331dac978002d5ad98481a6ab8efceb", + "head_block_id": "1aa2a9844056231b55b8b1d3269b4a150fc37bc21d899c9abf63a2473ebaad71", + "head_block_time": "2025-07-16T19:49:03.000", + "head_block_producer": "aus1genereos", + "virtual_block_cpu_limit": 200000, + "virtual_block_net_limit": 1048576000, + "block_cpu_limit": 200000, + "block_net_limit": 1048576, + "server_version_string": "v1.0.1", + "fork_db_head_block_num": 446867844, + "fork_db_head_block_id": "1aa2a9844056231b55b8b1d3269b4a150fc37bc21d899c9abf63a2473ebaad71", + "server_full_version_string": "v1.0.1-574650744460373f635d48cac9aa6dee67dcbfdb", + "total_cpu_weight": "382520753105234", + "total_net_weight": "95689554310803", + "earliest_available_block_num": 446693968, + "last_irreversible_block_time": "2025-07-16T19:49:02.000" + }, + "text": "{\"server_version\":\"57465074\",\"chain_id\":\"aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906\",\"head_block_num\":446867844,\"last_irreversible_block_num\":446867842,\"last_irreversible_block_id\":\"1aa2a9829150573f8bd87bae1c9b91001331dac978002d5ad98481a6ab8efceb\",\"head_block_id\":\"1aa2a9844056231b55b8b1d3269b4a150fc37bc21d899c9abf63a2473ebaad71\",\"head_block_time\":\"2025-07-16T19:49:03.000\",\"head_block_producer\":\"aus1genereos\",\"virtual_block_cpu_limit\":200000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v1.0.1\",\"fork_db_head_block_num\":446867844,\"fork_db_head_block_id\":\"1aa2a9844056231b55b8b1d3269b4a150fc37bc21d899c9abf63a2473ebaad71\",\"server_full_version_string\":\"v1.0.1-574650744460373f635d48cac9aa6dee67dcbfdb\",\"total_cpu_weight\":\"382520753105234\",\"total_net_weight\":\"95689554310803\",\"earliest_available_block_num\":446693968,\"last_irreversible_block_time\":\"2025-07-16T19:49:02.000\"}" +} \ No newline at end of file diff --git a/test/data/618bea5f5551dede21edba216e12db446ca68486.json b/test/data/618bea5f5551dede21edba216e12db446ca68486.json new file mode 100644 index 0000000..34039df --- /dev/null +++ b/test/data/618bea5f5551dede21edba216e12db446ca68486.json @@ -0,0 +1,19 @@ +{ + "request": { + "path": "https://eos.greymass.com/v1/chain/get_table_rows", + "params": { + "method": "POST", + "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rexpool\",\"key_type\":\"name\",\"json\":false}", + "headers": {} + } + }, + "status": 200, + "json": { + "rows": [ + "0074c75f460500000004454f5300000000b08252dbd002000004454f5300000000abfa25020000000004454f5300000000244ab221d602000004454f5300000000e681c9da2d5f53000452455800000000000000000000000004454f53000000002eb7070000000000" + ], + "more": false, + "next_key": "" + }, + "text": "{\"rows\":[\"0074c75f460500000004454f5300000000b08252dbd002000004454f5300000000abfa25020000000004454f5300000000244ab221d602000004454f5300000000e681c9da2d5f53000452455800000000000000000000000004454f53000000002eb7070000000000\"],\"more\":false,\"next_key\":\"\"}" +} \ No newline at end of file diff --git a/test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json b/test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json new file mode 100644 index 0000000..ee569fa --- /dev/null +++ b/test/data/6576fbd58ff96d97f216ac8e3c46fcbfbdbffafb.json @@ -0,0 +1,176 @@ +{ + "request": { + "path": "https://wax.greymass.com/v1/chain/get_account", + "params": { + "method": "POST", + "body": "{\"account_name\":\"boost.wax\"}", + "headers": {} + } + }, + "status": 200, + "json": { + "account_name": "boost.wax", + "head_block_num": 382431930, + "head_block_time": "2025-07-16T19:49:06.500", + "privileged": false, + "last_code_update": "2022-11-01T21:44:57.500", + "created": "2020-04-09T20:28:34.500", + "core_liquid_balance": "3796281.62693477 WAX", + "ram_quota": 106721149, + "net_weight": "30001100000000", + "cpu_weight": "770055200000000", + "net_limit": { + "used": 3488768, + "available": "14054767267", + "max": "14058256035", + "last_usage_update_time": "2025-07-16T19:48:41.500", + "current_used": 3487758 + }, + "cpu_limit": { + "used": 2491680, + "available": 196529461, + "max": 199021141, + "last_usage_update_time": "2025-07-16T19:48:41.500", + "current_used": 2490958 + }, + "ram_usage": 13138903, + "permissions": [ + { + "perm_name": "active", + "parent": "owner", + "required_auth": { + "threshold": 1, + "keys": [], + "accounts": [ + { + "permission": { + "actor": "admin.wax", + "permission": "active" + }, + "weight": 1 + }, + { + "permission": { + "actor": "boost.wax", + "permission": "eosio.code" + }, + "weight": 1 + } + ], + "waits": [] + }, + "linked_actions": [] + }, + { + "perm_name": "deploy", + "parent": "active", + "required_auth": { + "threshold": 1, + "keys": [], + "accounts": [ + { + "permission": { + "actor": "deploy.wax", + "permission": "all" + }, + "weight": 1 + } + ], + "waits": [] + }, + "linked_actions": [ + { + "account": "eosio", + "action": "setcode" + }, + { + "account": "eosio", + "action": "setabi" + } + ] + }, + { + "perm_name": "owner", + "parent": "", + "required_auth": { + "threshold": 1, + "keys": [], + "accounts": [ + { + "permission": { + "actor": "admin.wax", + "permission": "active" + }, + "weight": 1 + } + ], + "waits": [] + }, + "linked_actions": [] + }, + { + "perm_name": "paybw", + "parent": "active", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS5B2c2wNjaq342758aYvE71dTxpBVqHocnRU1aWxUdZAuxbgM6f", + "weight": 1 + } + ], + "accounts": [ + { + "permission": { + "actor": "oracle.wax", + "permission": "rngops" + }, + "weight": 1 + } + ], + "waits": [] + }, + "linked_actions": [ + { + "account": "boost.wax", + "action": "noop" + } + ] + } + ], + "total_resources": { + "owner": "boost.wax", + "net_weight": "300011.00000000 WAX", + "cpu_weight": "7700552.00000000 WAX", + "ram_bytes": 106719749 + }, + "self_delegated_bandwidth": null, + "refund_request": null, + "voter_info": { + "owner": "boost.wax", + "proxy": "", + "producers": [], + "staked": 0, + "unpaid_voteshare": "0.00000000000000000", + "unpaid_voteshare_last_updated": "1970-01-01T00:00:00.000", + "unpaid_voteshare_change_rate": "0.00000000000000000", + "last_claim_time": "1970-01-01T00:00:00.000", + "last_vote_weight": "0.00000000000000000", + "proxied_vote_weight": "0.00000000000000000", + "is_proxy": 0, + "flags1": 0, + "reserved2": 0, + "reserved3": "0 " + }, + "rex_info": null, + "subjective_cpu_bill_limit": { + "used": 57962, + "available": 0, + "max": 0, + "last_usage_update_time": "2000-01-01T00:00:00.000", + "current_used": 0 + }, + "eosio_any_linked_actions": [] + }, + "text": "{\"account_name\":\"boost.wax\",\"head_block_num\":382431930,\"head_block_time\":\"2025-07-16T19:49:06.500\",\"privileged\":false,\"last_code_update\":\"2022-11-01T21:44:57.500\",\"created\":\"2020-04-09T20:28:34.500\",\"core_liquid_balance\":\"3796281.62693477 WAX\",\"ram_quota\":106721149,\"net_weight\":\"30001100000000\",\"cpu_weight\":\"770055200000000\",\"net_limit\":{\"used\":3488768,\"available\":\"14054767267\",\"max\":\"14058256035\",\"last_usage_update_time\":\"2025-07-16T19:48:41.500\",\"current_used\":3487758},\"cpu_limit\":{\"used\":2491680,\"available\":196529461,\"max\":199021141,\"last_usage_update_time\":\"2025-07-16T19:48:41.500\",\"current_used\":2490958},\"ram_usage\":13138903,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"admin.wax\",\"permission\":\"active\"},\"weight\":1},{\"permission\":{\"actor\":\"boost.wax\",\"permission\":\"eosio.code\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"deploy\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"deploy.wax\",\"permission\":\"all\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[{\"account\":\"eosio\",\"action\":\"setcode\"},{\"account\":\"eosio\",\"action\":\"setabi\"}]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[],\"accounts\":[{\"permission\":{\"actor\":\"admin.wax\",\"permission\":\"active\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"paybw\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS5B2c2wNjaq342758aYvE71dTxpBVqHocnRU1aWxUdZAuxbgM6f\",\"weight\":1}],\"accounts\":[{\"permission\":{\"actor\":\"oracle.wax\",\"permission\":\"rngops\"},\"weight\":1}],\"waits\":[]},\"linked_actions\":[{\"account\":\"boost.wax\",\"action\":\"noop\"}]}],\"total_resources\":{\"owner\":\"boost.wax\",\"net_weight\":\"300011.00000000 WAX\",\"cpu_weight\":\"7700552.00000000 WAX\",\"ram_bytes\":106719749},\"self_delegated_bandwidth\":null,\"refund_request\":null,\"voter_info\":{\"owner\":\"boost.wax\",\"proxy\":\"\",\"producers\":[],\"staked\":0,\"unpaid_voteshare\":\"0.00000000000000000\",\"unpaid_voteshare_last_updated\":\"1970-01-01T00:00:00.000\",\"unpaid_voteshare_change_rate\":\"0.00000000000000000\",\"last_claim_time\":\"1970-01-01T00:00:00.000\",\"last_vote_weight\":\"0.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0 \"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":57962,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" +} \ No newline at end of file diff --git a/test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json b/test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json new file mode 100644 index 0000000..322c14e --- /dev/null +++ b/test/data/7ece7473fc9df54bb8b45bcf3d759b48ce9a5a64.json @@ -0,0 +1,33 @@ +{ + "request": { + "path": "https://wax.greymass.com/v1/chain/get_info", + "params": { + "method": "GET", + "headers": {} + } + }, + "status": 200, + "json": { + "server_version": "b18375f7", + "chain_id": "1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4", + "head_block_num": 382431929, + "last_irreversible_block_num": 382431604, + "last_irreversible_block_id": "16cb71744c10bcbb15db4c6bd31de2bc8b636202573377a7133af48fbb7d4d81", + "head_block_id": "16cb72b9bf09a6ed082aa91d31d3eff20e56b6905b888f023dea997153a085ca", + "head_block_time": "2025-07-16T19:49:06.000", + "head_block_producer": "wombatblockx", + "virtual_block_cpu_limit": 200000, + "virtual_block_net_limit": 1048576000, + "block_cpu_limit": 200000, + "block_net_limit": 1048576, + "server_version_string": "v5.0.3wax01", + "fork_db_head_block_num": 382431929, + "fork_db_head_block_id": "16cb72b9bf09a6ed082aa91d31d3eff20e56b6905b888f023dea997153a085ca", + "server_full_version_string": "v5.0.3wax01-b18375f72cde5e3dbc31bcff1d4f546065975d1a", + "total_cpu_weight": "133720003227304002", + "total_net_weight": "386677926721957765", + "earliest_available_block_num": 382258379, + "last_irreversible_block_time": "2025-07-16T19:46:23.500" + }, + "text": "{\"server_version\":\"b18375f7\",\"chain_id\":\"1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4\",\"head_block_num\":382431929,\"last_irreversible_block_num\":382431604,\"last_irreversible_block_id\":\"16cb71744c10bcbb15db4c6bd31de2bc8b636202573377a7133af48fbb7d4d81\",\"head_block_id\":\"16cb72b9bf09a6ed082aa91d31d3eff20e56b6905b888f023dea997153a085ca\",\"head_block_time\":\"2025-07-16T19:49:06.000\",\"head_block_producer\":\"wombatblockx\",\"virtual_block_cpu_limit\":200000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v5.0.3wax01\",\"fork_db_head_block_num\":382431929,\"fork_db_head_block_id\":\"16cb72b9bf09a6ed082aa91d31d3eff20e56b6905b888f023dea997153a085ca\",\"server_full_version_string\":\"v5.0.3wax01-b18375f72cde5e3dbc31bcff1d4f546065975d1a\",\"total_cpu_weight\":\"133720003227304002\",\"total_net_weight\":\"386677926721957765\",\"earliest_available_block_num\":382258379,\"last_irreversible_block_time\":\"2025-07-16T19:46:23.500\"}" +} \ No newline at end of file diff --git a/test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json b/test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json new file mode 100644 index 0000000..841fc91 --- /dev/null +++ b/test/data/8a1ad3d64af233a183cab24ef0a34585838379c7.json @@ -0,0 +1,148 @@ +{ + "request": { + "path": "https://eos.greymass.com/v1/chain/get_account", + "params": { + "method": "POST", + "body": "{\"account_name\":\"greymassfuel\"}", + "headers": {} + } + }, + "status": 200, + "json": { + "account_name": "greymassfuel", + "head_block_num": 446867848, + "head_block_time": "2025-07-16T19:49:05.000", + "privileged": false, + "last_code_update": "1970-01-01T00:00:00.000", + "created": "2019-11-01T22:31:13.500", + "core_liquid_balance": "544.7766 EOS", + "ram_quota": 9229, + "net_weight": 5281058, + "cpu_weight": "8302889400", + "net_limit": { + "used": 247869, + "available": 9752132, + "max": 10000001, + "last_usage_update_time": "2025-07-16T19:47:02.000", + "current_used": 247516 + }, + "cpu_limit": { + "used": 579523, + "available": 170626, + "max": 750149, + "last_usage_update_time": "2025-07-16T19:47:02.000", + "current_used": 578698 + }, + "ram_usage": 4547, + "permissions": [ + { + "perm_name": "active", + "parent": "owner", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS8VE4hVEP4pNdFUwPf2u8inCscVeFGMf1MUt1ec8tfKHaiTJGQk", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [] + }, + { + "perm_name": "buyram", + "parent": "active", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS82EHUh2YMR51Hu6JRJWpQUhWQA3KarnePHuyi29AF9iJmoe6nK", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [ + { + "account": "eosio", + "action": "buyrambytes" + }, + { + "account": "eosio", + "action": "buyram" + } + ] + }, + { + "perm_name": "cosign", + "parent": "active", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS8Ym3MwFnAgPgDZUB9J9FwW3SrMNhr3JDv9qZA3R7nUC7DnBvm4", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [ + { + "account": "greymassnoop", + "action": "noop" + } + ] + }, + { + "perm_name": "owner", + "parent": "", + "required_auth": { + "threshold": 1, + "keys": [ + { + "key": "EOS6sLkWkqLZKPWEKpRqWU8oS8Tu7Ebjv4B8L82ViDb6r9fgZVYDx", + "weight": 1 + } + ], + "accounts": [], + "waits": [] + }, + "linked_actions": [] + } + ], + "total_resources": { + "owner": "greymassfuel", + "net_weight": "528.1058 EOS", + "cpu_weight": "830288.9400 EOS", + "ram_bytes": 7829 + }, + "self_delegated_bandwidth": null, + "refund_request": null, + "voter_info": { + "owner": "greymassfuel", + "proxy": "", + "producers": [], + "staked": 0, + "last_vote_weight": "0.00000000000000000", + "proxied_vote_weight": "0.00000000000000000", + "is_proxy": 0, + "flags1": 0, + "reserved2": 0, + "reserved3": "0 " + }, + "rex_info": null, + "subjective_cpu_bill_limit": { + "used": 0, + "available": 0, + "max": 0, + "last_usage_update_time": "2000-01-01T00:00:00.000", + "current_used": 0 + }, + "eosio_any_linked_actions": [] + }, + "text": "{\"account_name\":\"greymassfuel\",\"head_block_num\":446867848,\"head_block_time\":\"2025-07-16T19:49:05.000\",\"privileged\":false,\"last_code_update\":\"1970-01-01T00:00:00.000\",\"created\":\"2019-11-01T22:31:13.500\",\"core_liquid_balance\":\"544.7766 EOS\",\"ram_quota\":9229,\"net_weight\":5281058,\"cpu_weight\":\"8302889400\",\"net_limit\":{\"used\":247869,\"available\":9752132,\"max\":10000001,\"last_usage_update_time\":\"2025-07-16T19:47:02.000\",\"current_used\":247516},\"cpu_limit\":{\"used\":579523,\"available\":170626,\"max\":750149,\"last_usage_update_time\":\"2025-07-16T19:47:02.000\",\"current_used\":578698},\"ram_usage\":4547,\"permissions\":[{\"perm_name\":\"active\",\"parent\":\"owner\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS8VE4hVEP4pNdFUwPf2u8inCscVeFGMf1MUt1ec8tfKHaiTJGQk\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]},{\"perm_name\":\"buyram\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS82EHUh2YMR51Hu6JRJWpQUhWQA3KarnePHuyi29AF9iJmoe6nK\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"eosio\",\"action\":\"buyrambytes\"},{\"account\":\"eosio\",\"action\":\"buyram\"}]},{\"perm_name\":\"cosign\",\"parent\":\"active\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS8Ym3MwFnAgPgDZUB9J9FwW3SrMNhr3JDv9qZA3R7nUC7DnBvm4\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[{\"account\":\"greymassnoop\",\"action\":\"noop\"}]},{\"perm_name\":\"owner\",\"parent\":\"\",\"required_auth\":{\"threshold\":1,\"keys\":[{\"key\":\"EOS6sLkWkqLZKPWEKpRqWU8oS8Tu7Ebjv4B8L82ViDb6r9fgZVYDx\",\"weight\":1}],\"accounts\":[],\"waits\":[]},\"linked_actions\":[]}],\"total_resources\":{\"owner\":\"greymassfuel\",\"net_weight\":\"528.1058 EOS\",\"cpu_weight\":\"830288.9400 EOS\",\"ram_bytes\":7829},\"self_delegated_bandwidth\":null,\"refund_request\":null,\"voter_info\":{\"owner\":\"greymassfuel\",\"proxy\":\"\",\"producers\":[],\"staked\":0,\"last_vote_weight\":\"0.00000000000000000\",\"proxied_vote_weight\":\"0.00000000000000000\",\"is_proxy\":0,\"flags1\":0,\"reserved2\":0,\"reserved3\":\"0 \"},\"rex_info\":null,\"subjective_cpu_bill_limit\":{\"used\":0,\"available\":0,\"max\":0,\"last_usage_update_time\":\"2000-01-01T00:00:00.000\",\"current_used\":0},\"eosio_any_linked_actions\":[]}" +} \ No newline at end of file diff --git a/test/data/9524769002c6f1710084a9b2f020b2560af883ab.json b/test/data/9524769002c6f1710084a9b2f020b2560af883ab.json new file mode 100644 index 0000000..df49ed5 --- /dev/null +++ b/test/data/9524769002c6f1710084a9b2f020b2560af883ab.json @@ -0,0 +1,19 @@ +{ + "request": { + "path": "https://eos.greymass.com/v1/chain/get_table_rows", + "params": { + "method": "POST", + "body": "{\"code\":\"eosio\",\"scope\":\"eosio\",\"table\":\"rammarket\",\"key_type\":\"name\",\"json\":false}", + "headers": {} + } + }, + "status": 200, + "json": { + "rows": [ + "00407a10f35a00000452414d434f52459dbe9c830e0000000052414d00000000000000000000e03f92d7903b4700000004454f5300000000000000000000e03f" + ], + "more": false, + "next_key": "" + }, + "text": "{\"rows\":[\"00407a10f35a00000452414d434f52459dbe9c830e0000000052414d00000000000000000000e03f92d7903b4700000004454f5300000000000000000000e03f\"],\"more\":false,\"next_key\":\"\"}" +} \ No newline at end of file diff --git a/test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json b/test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json new file mode 100644 index 0000000..5e36985 --- /dev/null +++ b/test/data/9a90c13e62013539b53fd522e7d0834cc3a6aa66.json @@ -0,0 +1,19 @@ +{ + "request": { + "path": "https://eos.greymass.com/v1/chain/get_table_rows", + "params": { + "method": "POST", + "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", + "headers": {} + } + }, + "status": 200, + "json": { + "rows": [ + "00002ae97f9fd056000000a0724e180900004e79bb7de00000000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000633d6f0618000000ba7ab8732d0000002900786800a8a4ff7d425b010000a0724e1809000038e5edf6810300000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000007d495ef5071500005c705853091500002900786801000000010000000000000004454f5300000000" + ], + "more": false, + "next_key": "" + }, + "text": "{\"rows\":[\"00002ae97f9fd056000000a0724e180900004e79bb7de00000000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f5300000000633d6f0618000000ba7ab8732d0000002900786800a8a4ff7d425b010000a0724e1809000038e5edf6810300000080c6a47e8d030000a0724e1809000093c83560e8b96e6000000000000000408051010040787d010000000004454f53000000008017b42c0000000004454f53000000007d495ef5071500005c705853091500002900786801000000010000000000000004454f5300000000\"],\"more\":false,\"next_key\":\"\"}" +} \ No newline at end of file diff --git a/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json b/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json new file mode 100644 index 0000000..f2f83ae --- /dev/null +++ b/test/data/a041de03f2a7ee6c133465c8c6b2b286704a5d8f.json @@ -0,0 +1,33 @@ +{ + "request": { + "path": "https://jungle4.greymass.com/v1/chain/get_info", + "params": { + "method": "GET", + "headers": {} + } + }, + "status": 200, + "json": { + "server_version": "13356212", + "chain_id": "73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d", + "head_block_num": 213686587, + "last_irreversible_block_num": 213686585, + "last_irreversible_block_id": "0cbc9939b1a3a69846291eb183630ed576fca0474be4ea243ab16fb58cb48091", + "head_block_id": "0cbc993bce0149896cdf722aa77d88a1a62f0634aa70d57e39795a1a3a6451d8", + "head_block_time": "2025-07-16T19:49:04.000", + "head_block_producer": "atticlabeosb", + "virtual_block_cpu_limit": 200000000, + "virtual_block_net_limit": 1048576000, + "block_cpu_limit": 200000, + "block_net_limit": 1048576, + "server_version_string": "v1.1.5", + "fork_db_head_block_num": 213686587, + "fork_db_head_block_id": "0cbc993bce0149896cdf722aa77d88a1a62f0634aa70d57e39795a1a3a6451d8", + "server_full_version_string": "v1.1.5-13356212245054c35b1e1e7e20a9bd43ced48c4d", + "total_cpu_weight": "120570397011713", + "total_net_weight": "117540055017865", + "earliest_available_block_num": 213508721, + "last_irreversible_block_time": "2025-07-16T19:49:03.000" + }, + "text": "{\"server_version\":\"13356212\",\"chain_id\":\"73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d\",\"head_block_num\":213686587,\"last_irreversible_block_num\":213686585,\"last_irreversible_block_id\":\"0cbc9939b1a3a69846291eb183630ed576fca0474be4ea243ab16fb58cb48091\",\"head_block_id\":\"0cbc993bce0149896cdf722aa77d88a1a62f0634aa70d57e39795a1a3a6451d8\",\"head_block_time\":\"2025-07-16T19:49:04.000\",\"head_block_producer\":\"atticlabeosb\",\"virtual_block_cpu_limit\":200000000,\"virtual_block_net_limit\":1048576000,\"block_cpu_limit\":200000,\"block_net_limit\":1048576,\"server_version_string\":\"v1.1.5\",\"fork_db_head_block_num\":213686587,\"fork_db_head_block_id\":\"0cbc993bce0149896cdf722aa77d88a1a62f0634aa70d57e39795a1a3a6451d8\",\"server_full_version_string\":\"v1.1.5-13356212245054c35b1e1e7e20a9bd43ced48c4d\",\"total_cpu_weight\":\"120570397011713\",\"total_net_weight\":\"117540055017865\",\"earliest_available_block_num\":213508721,\"last_irreversible_block_time\":\"2025-07-16T19:49:03.000\"}" +} \ No newline at end of file diff --git a/test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json b/test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json new file mode 100644 index 0000000..24e2049 --- /dev/null +++ b/test/data/aefe0d25e3f0a6ac99195e23bd7410ede02c58df.json @@ -0,0 +1,19 @@ +{ + "request": { + "path": "https://wax.greymass.com/v1/chain/get_table_rows", + "params": { + "method": "POST", + "body": "{\"code\":\"eosio\",\"scope\":\"\",\"table\":\"powup.state\",\"key_type\":\"name\",\"json\":false}", + "headers": {} + } + }, + "status": 200, + "json": { + "rows": [ + "00004443c91d14a2460400c06e31d910010042f8c30ce420d5010000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf17000008574158000000006203403c74e82c000fdcdee069032d003002786800883a7a3d22ca520100c06e31d91001001619a2ac0e3291000000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf17000008574158000000001799528dd68f2300d96c445087c92400300278680100000001000000000000000857415800000000" + ], + "more": false, + "next_key": "" + }, + "text": "{\"rows\":[\"00004443c91d14a2460400c06e31d910010042f8c30ce420d5010000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf17000008574158000000006203403c74e82c000fdcdee069032d003002786800883a7a3d22ca520100c06e31d91001001619a2ac0e3291000000e941cc6b010000c06e31d910010072936e6870597368000000000000004080510100006e10bacb000000085741580000000000e4eccddf17000008574158000000001799528dd68f2300d96c445087c92400300278680100000001000000000000000857415800000000\"],\"more\":false,\"next_key\":\"\"}" +} \ No newline at end of file diff --git a/test/powerup.ts b/test/powerup.ts index 56a5502..11087a1 100644 --- a/test/powerup.ts +++ b/test/powerup.ts @@ -44,12 +44,20 @@ suite('[eos] powerup - cpu calculations', function () { test('powerup.cpu.us_to_weight', async function () { const powerup = await resources_eos.v1.powerup.get_state() const sample = await resources_eos.getSampledUsage() - assert.equal(powerup.cpu.us_to_weight(sample.cpu, 35868), 397914355) + assert.equal( + powerup.cpu.us_to_weight(sample.cpu, 35868).equals(397077382), + true, + `got ${powerup.cpu.us_to_weight(sample.cpu, 35868)} instead of 397077382` + ) }) test('powerup.cpu.weight_to_us', async function () { const powerup = await resources_eos.v1.powerup.get_state() const sample = await resources_eos.getSampledUsage() - assert.equal(powerup.cpu.weight_to_us(sample.cpu, 12930064), 1166) + assert.equal( + powerup.cpu.weight_to_us(sample.cpu, 12930064).equals(1168), + true, + `got ${powerup.cpu.weight_to_us(sample.cpu, 12930064)} instead of 1168` + ) }) test('powerup.cpu.allocated', async function () { const powerup = await resources_eos.v1.powerup.get_state() @@ -60,14 +68,18 @@ suite('[eos] powerup - cpu calculations', function () { test('powerup.cpu.reserved', async function () { const powerup = await resources_eos.v1.powerup.get_state() - assert.equal(powerup.cpu.reserved, 0.07891504719871277) + assert.equal( + powerup.cpu.reserved.equals(0.07891504719871277), + true, + `got ${powerup.cpu.reserved} instead of 0.07891504719871277` + ) // 7.891504719871277% represented as float }) test('powerup.cpu.price_per_us(60)', async function () { const powerup = await resources_eos.v1.powerup.get_state() const sample = await resources_eos.getSampledUsage() const price = powerup.cpu.price_per_ms(sample, 60, this.testFixture) - assert.equal(price, 0.0144) + assert.equal(price, 0.012) }) test('powerup.cpu.price_per_us(1)', async function () { const powerup = await resources_eos.v1.powerup.get_state() @@ -84,41 +96,41 @@ suite('[eos] powerup - cpu calculations', function () { const price_ms = powerup.cpu.price_per_ms(sample, 1, this.testFixture) assert.equal(price_us, price_ms) - assert.equal(price_us, 0.0003) + assert.equal(price_us, 0.0002) }) test('powerup.cpu.price_per_ms(1)', async function () { const powerup = await resources_eos.v1.powerup.get_state() const sample = await resources_eos.getSampledUsage() const price = powerup.cpu.price_per_ms(sample, 1, this.testFixture) - assert.equal(price, 0.0003) + assert.equal(price, 0.0002) const asset = Asset.from(price, '4,EOS') - assert.equal(String(asset), '0.0003 EOS') - assert.equal(asset.value, 0.0003) - assert.equal(Number(asset.units), 3) + assert.equal(String(asset), '0.0002 EOS') + assert.equal(asset.value, 0.0002) + assert.equal(Number(asset.units), 2) }) test('powerup.cpu.price_per_ms(1000)', async function () { const powerup = await resources_eos.v1.powerup.get_state() const sample = await resources_eos.getSampledUsage() const price = powerup.cpu.price_per_ms(sample, 1000, this.testFixture) - assert.equal(price, 0.239) + assert.equal(price, 0.106) const asset = Asset.from(price, '4,EOS') - assert.equal(String(asset), '0.2390 EOS') - assert.equal(asset.value, 0.239) - assert.equal(Number(asset.units), 2390) + assert.equal(String(asset), '0.1060 EOS') + assert.equal(asset.value, 0.106) + assert.equal(Number(asset.units), 1060) }) test('powerup.cpu.frac()', async function () { const powerup = await resources_eos.v1.powerup.get_state() const sample = await resources_eos.getSampledUsage() const frac1 = powerup.cpu.frac(sample, 100) - assert.equal(frac1, 2905547) + assert.equal(frac1.equals(2899435), true, `got ${frac1} instead of 2899435`) const frac1000 = powerup.cpu.frac(sample, 1000000) - assert.equal(frac1000, 29055489074) + assert.equal(frac1000.equals(28994373800), true, `got ${frac1000} instead of 28994373800`) }) }) @@ -140,7 +152,11 @@ suite('[eos] powerup - net calculations', function () { test('powerup.net.reserved', async function () { const powerup = await resources_eos.v1.powerup.get_state() - assert.equal(powerup.net.reserved, 0.004102226924904269) + assert.equal( + powerup.net.reserved.equals(0.004102226924904269), + true, + `got ${powerup.net.reserved} instead of 0.004102226924904269` + ) // 0.4102226924904269% represented as float }) test('powerup.net.price_per_kb(1000000000000)', async function () { @@ -160,7 +176,7 @@ suite('[eos] powerup - net calculations', function () { const sample = await resources_eos.getSampledUsage() const frac1000 = powerup.net.frac(sample, 1000000) - assert.equal(frac1000, 5556098) + assert.equal(frac1000.equals(5532558), true, `got ${frac1000} instead of 5556098`) }) }) @@ -182,7 +198,7 @@ suite('[jungle] powerup - cpu calculations', function () { test('powerup.cpu.reserved', async function () { const powerup = await resources_jungle.v1.powerup.get_state() - assert.equal(powerup.cpu.reserved, 0.022093458117636362) + assert.equal(powerup.cpu.reserved.equals(0.022093458117636362), true) // 0.032428358627099564% represented as float }) test('powerup.cpu.price_per_us(1000000)', async function () { @@ -192,31 +208,31 @@ suite('[jungle] powerup - cpu calculations', function () { const price_us = powerup.cpu.price_per_us(sample, 1000000, this.testFixture) const price_ms = powerup.cpu.price_per_ms(sample, 1000, this.testFixture) assert.equal(price_us, price_ms) - assert.equal(price_ms, 0.4601) + assert.equal(price_ms, 3.384) }) test('powerup.cpu.price_per_ms(1000)', async function () { const powerup = await resources_jungle.v1.powerup.get_state() const sample = await resources_eos.getSampledUsage() const price = powerup.cpu.price_per_ms(sample, 1000, this.testFixture) - assert.equal(price, 0.4601) + assert.equal(price, 3.384) const asset = Asset.from(price, '4,EOS') - assert.equal(String(asset), '0.4601 EOS') - assert.equal(asset.value, 0.4601) - assert.equal(Number(asset.units), 4601) + assert.equal(String(asset), '3.3840 EOS') + assert.equal(asset.value, 3.384) + assert.equal(Number(asset.units), 33840) }) test('powerup.cpu.price_per_ms(1000000)', async function () { const powerup = await resources_jungle.v1.powerup.get_state() const sample = await resources_eos.getSampledUsage() const price = powerup.cpu.price_per_ms(sample, 1000000, this.testFixture) - assert.equal(price, 914.8417) + assert.equal(price, 87.0144) const asset = Asset.from(price, '4,EOS') - assert.equal(String(asset), '914.8417 EOS') - assert.equal(asset.value, 914.8417) - assert.equal(Number(asset.units), 9148417) + assert.equal(String(asset), '87.0144 EOS') + assert.equal(asset.value, 87.0144) + assert.equal(Number(asset.units), 870144) }) }) @@ -237,7 +253,7 @@ suite('[wax] powerup - cpu calculations', function () { test('powerup.cpu.reserved', async function () { const powerup = await resources_wax.v1.powerup.get_state() - assert.equal(powerup.cpu.reserved, 0.1147547419042913) + assert.equal(powerup.cpu.reserved.equals(0.1147547419042913), true) }) test('powerup.cpu.price_per_us(1000000)', async function () { const powerup = await resources_wax.v1.powerup.get_state() @@ -246,31 +262,31 @@ suite('[wax] powerup - cpu calculations', function () { const price_us = powerup.cpu.price_per_us(sample, 1000000, this.testFixture) const price_ms = powerup.cpu.price_per_ms(sample, 1000, this.testFixture) assert.equal(price_us, price_ms) - assert.equal(price_ms, 7.6019681) + assert.equal(price_ms, 1.58622407) }) test('powerup.cpu.price_per_ms(1000)', async function () { const powerup = await resources_wax.v1.powerup.get_state() const sample = await resources_wax.getSampledUsage() const price = powerup.cpu.price_per_ms(sample, 1000, this.testFixture) - assert.equal(price, 7.6019681) + assert.equal(price, 1.58622407) const asset = Asset.from(price, '8,WAX') - assert.equal(String(asset), '7.60196810 WAX') - assert.equal(asset.value, 7.6019681) - assert.equal(Number(asset.units), 760196810) + assert.equal(String(asset), '1.58622407 WAX') + assert.equal(asset.value, 1.58622407) + assert.equal(Number(asset.units), 158622407) }) test('powerup.cpu.price_per_ms(1000000)', async function () { const powerup = await resources_wax.v1.powerup.get_state() const sample = await resources_wax.getSampledUsage() const price = powerup.cpu.price_per_ms(sample, 1000000, this.testFixture) - assert.equal(price, 11770.99029685) + assert.equal(price, 131.30369093) const asset = Asset.from(price, '8,WAX') - assert.equal(String(asset), '11770.99029685 WAX') - assert.equal(asset.value, 11770.99029685) - assert.equal(Number(asset.units), 1177099029685) + assert.equal(String(asset), '131.30369093 WAX') + assert.equal(asset.value, 131.30369093) + assert.equal(Number(asset.units), 13130369093) }) }) @@ -291,25 +307,25 @@ suite('[wax] powerup - net calculations', function () { test('powerup.net.reserved', async function () { const powerup = await resources_wax.v1.powerup.get_state() - assert.equal(powerup.net.reserved, 0.00006380031736302496) + assert.equal(powerup.net.reserved.equals(0.00006380031736302496), true) }) test('powerup.net.price_per_kb(1000000000000)', async function () { const powerup = await resources_wax.v1.powerup.get_state() const sample = await resources_wax.getSampledUsage() const price = powerup.net.price_per_kb(sample, 1000, this.testFixture) - assert.equal(price, 0.00044073) + assert.equal(price, 0.00013288) const asset = Asset.from(price, '8,WAX') - assert.equal(String(asset), '0.00044073 WAX') - assert.equal(asset.value, 0.00044073) - assert.equal(Number(asset.units), 44073) + assert.equal(String(asset), '0.00013288 WAX') + assert.equal(asset.value, 0.00013288) + assert.equal(Number(asset.units), 13288) }) test('powerup.net.frac()', async function () { const powerup = await resources_wax.v1.powerup.get_state() const sample = await resources_wax.getSampledUsage() const frac1000 = powerup.net.frac(sample, 1000000) - assert.equal(frac1000, 50216295) + assert.equal(frac1000.equals(6926405), true, `got ${frac1000} instead of 6926405`) }) }) diff --git a/test/ram.ts b/test/ram.ts index 079d5df..d9b8e73 100644 --- a/test/ram.ts +++ b/test/ram.ts @@ -14,18 +14,18 @@ suite('[eos] ram calculations', function () { }) test('ram.price_per(100)', async function () { const ram = await resources.v1.ram.get_state() - assert.equal(ram.price_per(100).value, 0.0016) + assert.equal(ram.price_per(100).value, 0.0491) }) test('ram.price_per(100000)', async function () { const ram = await resources.v1.ram.get_state() - assert.equal(ram.price_per(100000).value, 1.5723) + assert.equal(ram.price_per(100000).value, 49.0784) }) test('ram.price_per_kb(1)', async function () { const ram = await resources.v1.ram.get_state() const control = ram.price_per(1000) const actual = ram.price_per_kb(1) - assert.equal(control.value, 0.0158) - assert.equal(actual.value, 0.0158) + assert.equal(control.value, 0.4908) + assert.equal(actual.value, 0.4908) assert.equal(actual.equals(control), true) }) }) diff --git a/test/rex.ts b/test/rex.ts index 2ab996f..13e3e91 100644 --- a/test/rex.ts +++ b/test/rex.ts @@ -16,19 +16,17 @@ suite('[eos] rex calculations', function () { }) test('rex.reserved', async function () { const rex = await resources.v1.rex.get_state() - assert.equal(rex.reserved, 0.04960045779382111) - // 04.960045779382111% represented as float + assert.equal(rex.reserved, 0.007264384002969463) }) test('rex.value', async function () { const rex = await resources.v1.rex.get_state() - assert.equal(rex.value, 0.00010160262316038182) - // 0.00010160262316038182 EOS/REX + assert.equal(rex.value, 0.000132897336944197) }) test('rex.exchange', async function () { const rex = await resources.v1.rex.get_state() const amount = Asset.from('493874015.6505 REX') const tokens = rex.exchange(amount) - assert.equal(tokens.value, 50178.8955) + assert.equal(tokens.value, 65634.5414) }) test('rex.price_per(1000)', async function () { const rex = await resources.v1.rex.get_state() @@ -36,9 +34,9 @@ suite('[eos] rex calculations', function () { const price = rex.price_per(usage, 1000) const asset = Asset.from(price, '4,EOS') - assert.equal(String(asset), '0.0662 EOS') - assert.equal(asset.value, 0.0662) - assert.equal(Number(asset.units), 662) + assert.equal(String(asset), '0.0129 EOS') + assert.equal(asset.value, 0.0129) + assert.equal(Number(asset.units), 129) }) test('rex.price_per(10000)', async function () { const rex = await resources.v1.rex.get_state() @@ -46,9 +44,9 @@ suite('[eos] rex calculations', function () { const price = rex.price_per(usage, 10000) const asset = Asset.from(price, '4,EOS') - assert.equal(String(asset), '0.6624 EOS') - assert.equal(asset.value, 0.6624) - assert.equal(Number(asset.units), 6624) + assert.equal(String(asset), '0.1289 EOS') + assert.equal(asset.value, 0.1289) + assert.equal(Number(asset.units), 1289) }) test('rex.price_per(1000000)', async function () { const rex = await resources.v1.rex.get_state() @@ -56,8 +54,8 @@ suite('[eos] rex calculations', function () { const price = rex.price_per(usage, 1000000) const asset = Asset.from(price, '4,EOS') - assert.equal(String(asset), '66.2386 EOS') - assert.equal(asset.value, 66.2386) - assert.equal(Number(asset.units), 662386) + assert.equal(String(asset), '12.8880 EOS') + assert.equal(asset.value, 12.888) + assert.equal(Number(asset.units), 128880) }) }) From 329f10ca18f21bc8cd7856b981220a9a118926a8 Mon Sep 17 00:00:00 2001 From: aaroncox Date: Wed, 16 Jul 2025 13:29:34 -0700 Subject: [PATCH 14/17] v1.5.0-rc4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2a79361..4a82bab 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/resources", "description": "Library to assist in Antelope-blockchain resource calculations.", - "version": "1.5.0-rc3", + "version": "1.5.0-rc4", "homepage": "https://github.com/wharfkit/resources", "license": "BSD-3-Clause", "main": "lib/wharfkit-resources.js", From facd652d2cf105d72974dafafe41156d6809f1df Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 5 Aug 2025 17:53:47 -0700 Subject: [PATCH 15/17] Allowing passing min_payment to options, and check for requests with little CPU --- src/powerup/cpu.ts | 22 ++++++++++++++++++++-- src/powerup/options.ts | 4 +++- test/powerup.ts | 7 ------- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/powerup/cpu.ts b/src/powerup/cpu.ts index fa4a43f..f6151f0 100644 --- a/src/powerup/cpu.ts +++ b/src/powerup/cpu.ts @@ -1,4 +1,4 @@ -import {Int64, Int64Type, Struct, UInt128, UInt128Type} from '@wharfkit/antelope' +import {Asset, Int64, Int64Type, Struct, UInt128, UInt128Type} from '@wharfkit/antelope' import {BNPrecision, intToBigDecimal, SampleUsage} from '..' import {PowerUpStateResource} from './abstract' @@ -70,7 +70,25 @@ export class PowerUpStateResourceCPU extends PowerUpStateResource { const fee = this.fee(utilization_increase, adjusted_utilization) // Force the fee up to the next highest value of precision const precision = Math.pow(10, this.max_price.symbol.precision) - const value = Math.ceil(fee * precision) / precision + const price = fee * precision + const value = Math.ceil(price) / precision + const asset = Asset.fromFloat(fee, this.symbol) + if (price < 1) { + throw new Error( + `Price (${String( + asset + )}) for requested CPU amount (${us}us) below required precision, increase requested amount.` + ) + } + if (options && options.min_payment && options.min_payment.units.gt(asset.units)) { + throw new Error( + `Price (${String( + asset + )}) for requested CPU amount (${us}us) below minimum required payment (${String( + options.min_payment + )}), increase requested CPU amount.` + ) + } // Return the modified fee return value } diff --git a/src/powerup/options.ts b/src/powerup/options.ts index f030fd5..d57f9c7 100644 --- a/src/powerup/options.ts +++ b/src/powerup/options.ts @@ -1,4 +1,4 @@ -import {TimePointType, UInt64} from '@wharfkit/antelope' +import {Asset, TimePointType, UInt64} from '@wharfkit/antelope' export interface PowerUpStateOptions { // timestamp to base adjusted_utilization off @@ -6,4 +6,6 @@ export interface PowerUpStateOptions { // blockchain resource limits for calculating usage virtual_block_cpu_limit?: UInt64 virtual_block_net_limit?: UInt64 + // minimum payment amount + min_payment?: Asset } diff --git a/test/powerup.ts b/test/powerup.ts index 11087a1..f0e469b 100644 --- a/test/powerup.ts +++ b/test/powerup.ts @@ -81,13 +81,6 @@ suite('[eos] powerup - cpu calculations', function () { const price = powerup.cpu.price_per_ms(sample, 60, this.testFixture) assert.equal(price, 0.012) }) - test('powerup.cpu.price_per_us(1)', async function () { - const powerup = await resources_eos.v1.powerup.get_state() - const sample = await resources_eos.getSampledUsage() - - const price = powerup.cpu.price_per_us(sample, 1, this.testFixture) - assert.equal(price, 0.0001) - }) test('powerup.cpu.price_per_us(1000)', async function () { const powerup = await resources_eos.v1.powerup.get_state() const sample = await resources_eos.getSampledUsage() From 303c5c61217872218fb934830242e825013823ab Mon Sep 17 00:00:00 2001 From: aaroncox Date: Tue, 5 Aug 2025 17:54:00 -0700 Subject: [PATCH 16/17] v1.5.0-rc5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4a82bab..7a38a26 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/resources", "description": "Library to assist in Antelope-blockchain resource calculations.", - "version": "1.5.0-rc4", + "version": "1.5.0-rc5", "homepage": "https://github.com/wharfkit/resources", "license": "BSD-3-Clause", "main": "lib/wharfkit-resources.js", From f15a278353c79c00fe374d983d1747901e7114bd Mon Sep 17 00:00:00 2001 From: aaroncox Date: Sat, 20 Sep 2025 00:08:10 -0700 Subject: [PATCH 17/17] v1.5.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a38a26..cc562f9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@wharfkit/resources", "description": "Library to assist in Antelope-blockchain resource calculations.", - "version": "1.5.0-rc5", + "version": "1.5.0", "homepage": "https://github.com/wharfkit/resources", "license": "BSD-3-Clause", "main": "lib/wharfkit-resources.js",