Skip to content

Commit

Permalink
compute terms stored by fun init
Browse files Browse the repository at this point in the history
  • Loading branch information
steinerkelvin committed Oct 24, 2022
1 parent 3d9f2a9 commit 8f80194
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# TODO

- count space in cells
- compute on fun state init
- show space (and mana?) usage on fun definition
1 change: 0 additions & 1 deletion breaking_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
## Networking

- [ ] inversion of TX_COUNT bit order
- [ ] 2 bits for statement tag serialization

## Chain state

Expand Down
2 changes: 2 additions & 0 deletions src/hvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,8 @@ impl Runtime {
self.define_function(name, func, stmt_index, hash);
let state = self.create_term(init, 0, &mut init_map());
let state = handle_runtime_err(self, "fun", state)?;
let state = self.compute(state, self.get_mana_limit());
let state = handle_runtime_err(self, "fun", state)?;
self.write_disk(U120::from(name), state);
let args = args.iter().map(|x| *x).collect::<Vec<_>>();
StatementInfo::Fun { name, args }
Expand Down

0 comments on commit 8f80194

Please sign in to comment.