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

Renaming avm to nef #381

Merged
merged 12 commits into from
Jul 31, 2019
Merged

Renaming avm to nef #381

merged 12 commits into from
Jul 31, 2019

Conversation

vncoelho
Copy link
Member

@vncoelho vncoelho commented Jun 3, 2019

shargon
shargon previously approved these changes Jun 3, 2019
@shargon
Copy link
Member

shargon commented Jun 3, 2019

Wait for neo-project/neo-devpack-dotnet#55

@vncoelho
Copy link
Member Author

vncoelho commented Jun 3, 2019

Perfect, my friend.
Is there any other place in which we need to rename? Or it is just neo-cli and dev-pack?

@shargon
Copy link
Member

shargon commented Jun 3, 2019

I don't know ... (readme and docs?)

@vncoelho
Copy link
Member Author

vncoelho commented Jun 3, 2019

That is true!

@vncoelho
Copy link
Member Author

vncoelho commented Jun 6, 2019

@shargon, please double check this last merge.

Copy link
Contributor

@lock9 lock9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there anything else we need?

@erikzhang
Copy link
Member

We need neo-project/neo#903.

@vncoelho vncoelho changed the title Renaming avm to nvm Renaming avm to nef Jul 28, 2019
Copy link
Member

@erikzhang erikzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to remove the NEF header before deploy.

}

byte[] script = File.ReadAllBytes(nvmFilePath);
byte[] script = File.ReadAllBytes(nefFilePath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use the NefFile class

Copy link
Member Author

@vncoelho vncoelho Jul 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shargon, you mean something like:

  • get the nefFilePath
  • serialize the data into the class
  • get the script from it and just call the InteropService.Neo_Contract_Create with everything?

So that would also remove the NEF header before deploy, as @erikzhang affirmed.
Where the header will be stored?

Can you help to proceed with this change?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just need to decide and count the NEF bytes... this is the header.

Copy link

@igormcoelho igormcoelho Jul 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess they did a nice summary on other PR, Vitor:
https://github.com/neo-project/neo/pull/903/files

    /// +------------+-----------+------------------------------------------------------------+
    /// |   Field    |  Length   |                          Comment                           |
    /// +------------+-----------+------------------------------------------------------------+
    /// | Magic      | 4 bytes   | Magic header                                               |
    /// | Compiler   | 32 bytes  | Compiler used                                              |
    /// | Version    | 16 bytes  | Compiler version (Mayor, Minor, Build, Version)            |
    /// | ScriptHash | 20 bytes  | ScriptHash for the script                                  |
    /// +------------+-----------+------------------------------------------------------------+
    /// | Checksum   | 4 bytes   | Sha256 of the header (CRC)                                 |
    /// +------------+-----------+------------------------------------------------------------+
    /// | Script     | Var bytes | Var bytes for the payload                                  |
    /// +------------+-----------+------------------------------------------------------------+

I think it's 76bytes + script... on script, it's important to load it as ReadVarBytes, so its "header" (byte count) is also automatically removed.

@vncoelho vncoelho requested a review from erikzhang July 31, 2019 09:35
@shargon shargon merged commit 7fdbc54 into master Jul 31, 2019
@shargon shargon deleted the rename-avm-to-nvm branch July 31, 2019 10:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants