From e01d7a5eb9374f3e6e230f7ef1ac3cfd7e868b79 Mon Sep 17 00:00:00 2001 From: johann bestowrous Date: Thu, 2 Nov 2023 14:39:43 -0700 Subject: [PATCH] bitwise 'Name' method in docs returns correct name (#319) * bitwise 'Name' method in docs returns correct name * typo in `BITWISE_INPUT_CELLS_PER_INSTANCE` * BIWISE->BITWISE * const BIWISE->BITWISE fix * fix for `InputCellsPerInstance` method --- README.md | 4 ++-- pkg/builtins/bitwise.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b62e1646..5a0d9af2 100644 --- a/README.md +++ b/README.md @@ -2875,7 +2875,7 @@ func (b *BitwiseBuiltinRunner) Base() memory.Relocatable { } func (b *BitwiseBuiltinRunner) Name() string { - return "range_check" + return "bitwise" } ``` @@ -2913,7 +2913,7 @@ const BIWISE_INPUT_CELLS_PER_INSTANCE = 2 func (b *BitwiseBuiltinRunner) DeduceMemoryCell(address memory.Relocatable, mem *memory.Memory) (*memory.MaybeRelocatable, error) { index := address.Offset % BITWISE_CELLS_PER_INSTANCE - if index < BIWISE_INPUT_CELLS_PER_INSTANCE { + if index < BITWISE_INPUT_CELLS_PER_INSTANCE { return nil, nil } diff --git a/pkg/builtins/bitwise.go b/pkg/builtins/bitwise.go index 39a9a44c..435949a8 100644 --- a/pkg/builtins/bitwise.go +++ b/pkg/builtins/bitwise.go @@ -11,7 +11,7 @@ import ( const BITWISE_BUILTIN_NAME = "bitwise" const BITWISE_CELLS_PER_INSTANCE = 5 const BITWISE_TOTAL_N_BITS = 251 -const BIWISE_INPUT_CELLS_PER_INSTANCE = 2 +const BITWISE_INPUT_CELLS_PER_INSTANCE = 2 type BitwiseBuiltinRunner struct { base memory.Relocatable @@ -60,7 +60,7 @@ func (b *BitwiseBuiltinRunner) InitialStack() []memory.MaybeRelocatable { func (b *BitwiseBuiltinRunner) DeduceMemoryCell(address memory.Relocatable, mem *memory.Memory) (*memory.MaybeRelocatable, error) { index := address.Offset % BITWISE_CELLS_PER_INSTANCE - if index < BIWISE_INPUT_CELLS_PER_INSTANCE { + if index < BITWISE_INPUT_CELLS_PER_INSTANCE { return nil, nil } @@ -112,7 +112,7 @@ func (b *BitwiseBuiltinRunner) CellsPerInstance() uint { } func (b *BitwiseBuiltinRunner) InputCellsPerInstance() uint { - return BIWISE_INPUT_CELLS_PER_INSTANCE + return BITWISE_INPUT_CELLS_PER_INSTANCE } func (b *BitwiseBuiltinRunner) GetAllocatedMemoryUnits(segments *memory.MemorySegmentManager, currentStep uint) (uint, error) {