-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* upgrade for basic_dao * nft * rerun CI * collection motoko * rust collections * fix * fix * add utils * use utils in collections * refactor * fix * certified_map upgrade * readme * fix nft did * fix
- Loading branch information
1 parent
5158daf
commit 9c6c2f2
Showing
48 changed files
with
486 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,38 @@ | ||
import Vector "mo:vector/Class"; | ||
import Vector "mo:vector"; | ||
import Iter "mo:base/Iter"; | ||
import Random "random"; | ||
import Nat64 "mo:base/Nat64"; | ||
import Option "mo:base/Option"; | ||
import Profiling "../../../utils/motoko/Profiling"; | ||
|
||
actor { | ||
var buffer = Vector.Vector<Nat64>(); | ||
stable let profiling = Profiling.init(); | ||
|
||
stable let buffer : Vector.Vector<Nat64> = Vector.new(); | ||
|
||
public func generate(n: Nat) : async () { | ||
buffer.clear(); | ||
Vector.clear(buffer); | ||
for (_ in Iter.range(1, n)) { | ||
buffer.add(42); | ||
Vector.add<Nat64>(buffer, 42); | ||
} | ||
}; | ||
public query func get_mem() : async (Nat,Nat,Nat) { | ||
Random.get_memory() | ||
}; | ||
public func batch_get(n : Nat) : async () { | ||
let size = buffer.size(); | ||
let size = Vector.size(buffer); | ||
for (idx in Iter.range(1, n)) { | ||
ignore buffer.get(idx); | ||
ignore Vector.get(buffer, idx); | ||
} | ||
}; | ||
public func batch_put(n : Nat) : async () { | ||
for (_ in Iter.range(1, n)) { | ||
buffer.add(42); | ||
Vector.add<Nat64>(buffer, 42); | ||
} | ||
}; | ||
public func batch_remove(n : Nat) : async () { | ||
for (_ in Iter.range(1, n)) { | ||
ignore buffer.removeLast(); | ||
ignore Vector.removeLast(buffer); | ||
} | ||
}; | ||
} |
Oops, something went wrong.