Skip to content

Commit

Permalink
chore: update aluvm
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Oct 19, 2024
1 parent 50a7607 commit ee649c6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/interface/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ impl<Seal: ExposedSeal> OperationBuilder<Seal> {
fn assignments_type(&self, name: impl Into<FieldName>) -> Result<AssignmentType, BuilderError> {
let name = name.into();
self.iimpl
.assignments_type(&name)
.assignment_type(&name)
.ok_or(BuilderError::AssignmentNotFound(name))
}

Expand Down
10 changes: 4 additions & 6 deletions src/interface/calc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

use aluvm::data::ByteStr;
use aluvm::library::{LibId, LibSite};
use aluvm::reg::{Reg16, Reg32, RegA, RegR, RegS};
use aluvm::reg::{Reg16, Reg32, RegA, RegR};
use amplify::num::{u256, u4};
use amplify::{ByteArray, Wrapper};
use rgb::validation::Scripts;
Expand Down Expand Up @@ -91,7 +91,7 @@ impl StateCalc {

fn run(&mut self, site: LibSite) -> Result<(), String> {
if !self.vm.exec(site, |id| self.scripts.get(&id), &()) {
if let Some(err) = self.vm.registers.get_s(RegS::from(15)).cloned() {
if let Some(err) = self.vm.registers.s16(15).cloned() {
return Err(err.to_string());
}
}
Expand All @@ -104,9 +104,7 @@ impl StateCalc {
.set_n(RegA::A16, Reg32::Reg0, Some(ty.to_inner()));
assert_eq!(state.reserved, none!());
self.vm.registers.set_n(RegA::A8, Reg32::Reg0, Some(0u8));
self.vm
.registers
.set_s(RegS::from(0), Some(ByteStr::with(&state.data)));
self.vm.registers.set_s16(0, ByteStr::with(&state.data));
self.vm.registers.set_n(
RegR::R256,
Reg32::Reg0,
Expand All @@ -119,7 +117,7 @@ impl StateCalc {
ty: AssignmentType,
idx: Reg16,
) -> Result<Option<rgb::State>, StateCalcError> {
let Some(data) = self.vm.registers.get_s(RegS::from(u4::from(idx))) else {
let Some(data) = self.vm.registers.s16(u4::from(idx)) else {
return Ok(None);
};
let reserved = self
Expand Down
2 changes: 1 addition & 1 deletion src/interface/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl<S: ContractStateRead> ContractIface<S> {
fn assignment_type(&self, name: impl Into<FieldName>) -> Result<AssignmentType, ContractError> {
let name = name.into();
self.iface
.assignments_type(&name)
.assignment_type(&name)
.ok_or(ContractError::FieldNameUnknown(name))
}

Expand Down
2 changes: 1 addition & 1 deletion src/interface/iimpl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ impl IfaceImpl {
.map(|nt| nt.id)
}

pub fn assignments_type(&self, name: &FieldName) -> Option<AssignmentType> {
pub fn assignment_type(&self, name: &FieldName) -> Option<AssignmentType> {
self.assignments
.iter()
.find(|nt| &nt.name == name)
Expand Down

0 comments on commit ee649c6

Please sign in to comment.