mirror of
https://github.com/transatoshi-mw/grin-web-wallet.git
synced 2025-10-07 00:02:47 +00:00
contents of zip
This commit is contained in:
64
scripts/height.js
Executable file
64
scripts/height.js
Executable file
@@ -0,0 +1,64 @@
|
||||
// Use strict
|
||||
"use strict";
|
||||
|
||||
|
||||
// Classes
|
||||
|
||||
// Height class
|
||||
class Height {
|
||||
|
||||
// Public
|
||||
|
||||
// Constructor
|
||||
constructor(height, hash = Height.NO_HASH) {
|
||||
|
||||
// Set height
|
||||
this.setHeight(height);
|
||||
|
||||
// Set hash
|
||||
this.setHash(hash);
|
||||
}
|
||||
|
||||
// Set height
|
||||
setHeight(height) {
|
||||
|
||||
// Set height
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
// Get height
|
||||
getHeight() {
|
||||
|
||||
// Return height
|
||||
return this.height;
|
||||
}
|
||||
|
||||
// Set hash
|
||||
setHash(hash) {
|
||||
|
||||
// Set hash
|
||||
this.hash = hash;
|
||||
}
|
||||
|
||||
// Get hash
|
||||
getHash() {
|
||||
|
||||
// Return hash
|
||||
return this.hash;
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
// No hash
|
||||
static get NO_HASH() {
|
||||
|
||||
// Return no hash
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Main function
|
||||
|
||||
// Set global object's height
|
||||
globalThis["Height"] = Height;
|
Reference in New Issue
Block a user