Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Moving from App to Account terminology - Part 13 #296

Merged
merged 56 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6adf158
Renaming `App` to `Account`
YaronWittenstein Jul 14, 2021
b2bbef7
Ready for review.
YaronWittenstein Jul 14, 2021
e2bae16
Renamig `SpawnAppReceipt` to `SpawnReceipt`
YaronWittenstein Jul 14, 2021
2bfbc7a
Merge branch 'master' into app-term-deprecation-2
YaronWittenstein Jul 14, 2021
9ec985e
cargo fmt
YaronWittenstein Jul 14, 2021
6d1d378
Merge branch 'master' into app-term-deprecation-3
YaronWittenstein Jul 14, 2021
ae9239a
Renaming `AppAddr` to `AccountAddr`
YaronWittenstein Jul 14, 2021
546ed3a
Merge branch 'master' into app-term-deprecation-3
YaronWittenstein Jul 14, 2021
e2e0166
cargo fmt
YaronWittenstein Jul 14, 2021
e4552a3
Rename `SpawnApp` -> `SpawnAccount`
YaronWittenstein Jul 14, 2021
86e675b
Merge branch 'master' into app-term-deprecation-4
YaronWittenstein Jul 14, 2021
e38e9b6
`RuntimeError` - renaming fields from `app_addr` -> `account_addr`
YaronWittenstein Jul 14, 2021
bcf54a2
code compiles.
YaronWittenstein Jul 14, 2021
2185686
WIP: finishing the migration for the `svm-types` crate.
YaronWittenstein Jul 14, 2021
ebe85ba
tests pass
YaronWittenstein Jul 14, 2021
e168fb4
Merge branch 'app-term-deprecation-4' into app-term-deprecation-5
YaronWittenstein Jul 14, 2021
ebfff86
Merge branch 'master' into app-term-deprecation-5
YaronWittenstein Jul 14, 2021
8e5d279
`Transaction` - rename `app` to `target`
YaronWittenstein Jul 14, 2021
beff562
Renaming Receipts types.
YaronWittenstein Jul 14, 2021
e0e9f6b
cargo fmt
YaronWittenstein Jul 14, 2021
b4056c3
Merge branch 'master' into app-term-deprecation-6
YaronWittenstein Jul 14, 2021
8d94242
`svm-types` crate seems to have been migrated to the new AA terminology.
YaronWittenstein Jul 14, 2021
c0fb98d
WIP - Renaming to the new AA terminology in `svm-codec`.
YaronWittenstein Jul 14, 2021
0f4e141
More changes to `svm-codec`
YaronWittenstein Jul 14, 2021
690ff60
`svm-code` - more changes.
YaronWittenstein Jul 14, 2021
203dcfc
Fixing tests
YaronWittenstein Jul 14, 2021
d3a9faf
More changes to `svm-codec` (`api/json` and `api/wasm`)
YaronWittenstein Jul 14, 2021
98195fb
cargo fmt
YaronWittenstein Jul 14, 2021
6a34a87
Ready for review.
YaronWittenstein Jul 14, 2021
0381e58
`svm-codec` - modifying `src/receipt/error.rs` to use the new termino…
YaronWittenstein Jul 14, 2021
5e8e865
More changes to the new AA terminology.
YaronWittenstein Jul 14, 2021
5c60234
`svm-codec` is almost completely migrated to the new AA terminology.
YaronWittenstein Jul 14, 2021
a2208f9
crate `svm-storage` has been migrated the use the new AA terminology.
YaronWittenstein Jul 14, 2021
18da3ec
Fixed some of the `codec` Java-Script failing tests.
YaronWittenstein Jul 14, 2021
6c9a95d
`svm_codec.wasm` test pass.
YaronWittenstein Jul 15, 2021
447c924
WIP: migrating `svm-runtime` to the new AA terminology.
YaronWittenstein Jul 15, 2021
25d3165
WIP: migrating `svm-runtime` to the new AA terminology.
YaronWittenstein Jul 15, 2021
ba48bda
`svm-codec` WIP
YaronWittenstein Jul 15, 2021
9575be8
`svm-runtime` - migrating `runtime_tests.rs`
YaronWittenstein Jul 15, 2021
be95cfc
Merge branch 'master' into app-term-deprecation-10
YaronWittenstein Jul 15, 2021
490cac2
Ready for review.
YaronWittenstein Jul 15, 2021
6b65d47
Merge branch 'master' into app-term-deprecation-11
YaronWittenstein Jul 15, 2021
2e19208
crate `svm-gas` is using the new AA terminology.
YaronWittenstein Jul 15, 2021
ad02abb
Changes for `rocksdb` (still not finished)
YaronWittenstein Jul 15, 2021
b91230e
Merge branch 'master' into app-term-deprecation-12
YaronWittenstein Jul 15, 2021
e887556
WIP: migrating `svm-sdk` to use the new AA terminology.
YaronWittenstein Jul 15, 2021
408b492
`svm-sdk` is using the new AA terminology.
YaronWittenstein Jul 15, 2021
2748256
Migrating `svm-sdk-tests` to use the new AA terminology.
YaronWittenstein Jul 15, 2021
bd634a7
WIP: migrating `svm-sdk-tests` to the new AA terminology.
YaronWittenstein Jul 15, 2021
58088db
`svm-sdk` tests pass.
YaronWittenstein Jul 15, 2021
bd7599b
Ready for review.
YaronWittenstein Jul 15, 2021
b2bf266
WIP: migrating `runtime-ffi` into the new AA terminology.
YaronWittenstein Jul 15, 2021
58c17b0
Ready for a review.
YaronWittenstein Jul 15, 2021
d5e91e6
Merge branch 'master' into app-term-deprecation-13
YaronWittenstein Jul 15, 2021
ce5f5d8
Ready for review.
YaronWittenstein Jul 15, 2021
aebe6d0
cargo fmt
YaronWittenstein Jul 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/codec/src/api/json/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::api::builder::TemplateBuilder;
use crate::api::json::{self, JsonError};
use crate::template;

use svm_layout::{Id, Layout, LayoutBuilder};
use svm_layout::{FixedLayoutBuilder, Id, Layout};
use svm_types::{CodeSection, CtorsSection, DataSection, HeaderSection};

///
Expand Down Expand Up @@ -71,7 +71,7 @@ fn to_data_layout(blob: Vec<u8>) -> Result<Layout, JsonError> {
.collect();

// Note: `LayoutBuilder` assume that the `first var id` is zero
let mut builder = LayoutBuilder::with_capacity(data.len());
let mut builder = FixedLayoutBuilder::with_capacity(data.len());

builder.set_first(Id(0));
builder.extend_from_slice(&data);
Expand Down
4 changes: 2 additions & 2 deletions crates/codec/src/section/sections/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

use std::io::Cursor;

use svm_layout::{Id, Layout, LayoutBuilder, LayoutKind, RawVar};
use svm_layout::{FixedLayoutBuilder, Id, Layout, LayoutKind, RawVar};
use svm_types::DataSection;

use crate::section::{SectionDecoder, SectionEncoder};
Expand Down Expand Up @@ -124,7 +124,7 @@ fn decode_layout(cursor: &mut Cursor<&[u8]>) -> Result<Layout, ParseError> {
Ok(var_count) => {
let var_count = var_count as usize;

let mut builder = LayoutBuilder::with_capacity(var_count);
let mut builder = FixedLayoutBuilder::with_capacity(var_count);

if var_count > 0 {
// `First Var Id`
Expand Down
12 changes: 4 additions & 8 deletions crates/layout/src/builder.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
use crate::{FixedLayout, Id, RawVar};

/// Specifies the fixed-sized variables
pub struct LayoutBuilder {
pub struct FixedLayoutBuilder {
first: Option<Id>,

vars: Vec<(u32, u32)>,

next_offset: u32,
}

impl Default for LayoutBuilder {
impl Default for FixedLayoutBuilder {
fn default() -> Self {
Self::new()
}
}

/// `LayoutBuilder` represents the fixed-sized variables (storage) of an application.
impl LayoutBuilder {
/// Builds [`FixedLayout`].
impl FixedLayoutBuilder {
/// New builder
pub fn new() -> Self {
Self::with_capacity(0)
Expand Down Expand Up @@ -61,9 +59,7 @@ impl LayoutBuilder {
/// The starting offset is right after where the previous variable ended.
pub fn push(&mut self, len: u32) {
let offset = self.next_offset;

self.vars.push((offset, len));

self.next_offset += len;
}

Expand Down
10 changes: 5 additions & 5 deletions crates/layout/src/fixed.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{Id, LayoutBuilder, RawVar};
use crate::{FixedLayoutBuilder, Id, RawVar};

/// In-memory representation of a program's fixed-sized storage variables.
#[derive(Debug, PartialEq, Clone)]
Expand Down Expand Up @@ -97,7 +97,7 @@ impl From<&[u32]> for FixedLayout {
fn from(slice: &[u32]) -> Self {
let len = slice.len();

let mut builder = LayoutBuilder::with_capacity(len);
let mut builder = FixedLayoutBuilder::with_capacity(len);

if len > 0 {
builder.set_first(Id(0));
Expand Down Expand Up @@ -161,7 +161,7 @@ mod tests {

#[test]
fn layout_new() {
let mut builder = LayoutBuilder::with_capacity(2);
let mut builder = FixedLayoutBuilder::with_capacity(2);

builder.set_first(Id(3));
builder.push(10);
Expand All @@ -185,7 +185,7 @@ mod tests {

#[test]
fn layout_extend_from_slice() {
let mut builder = LayoutBuilder::with_capacity(2);
let mut builder = FixedLayoutBuilder::with_capacity(2);

builder.set_first(Id(4));
builder.push(10);
Expand All @@ -203,7 +203,7 @@ mod tests {

#[test]
fn layout_iter() {
let mut builder = LayoutBuilder::with_capacity(2);
let mut builder = FixedLayoutBuilder::with_capacity(2);

builder.set_first(Id(1));
builder.push(10);
Expand Down
2 changes: 1 addition & 1 deletion crates/layout/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod builder;
mod fixed;
mod var;

pub use builder::LayoutBuilder;
pub use builder::FixedLayoutBuilder;
pub use fixed::FixedLayout;
pub use var::{Id, Primitive, RawVar, SymbolicVar, Type};

Expand Down
Loading