-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Additional Call to Upgrade (#19)
* allow additional call data to be appended to build upgrade * readme
- Loading branch information
1 parent
f68e3cb
commit 5e27fda
Showing
7 changed files
with
67 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use std::fs; | ||
|
||
// Check what the user entered for the proposal. If it is just call data, return it back. Otherwise, | ||
// we expect a path to a file that contains the call data. Read that in and return it. | ||
pub(crate) fn get_proposal_bytes(proposal: String) -> Vec<u8> { | ||
let proposal = proposal.as_str(); | ||
if proposal.starts_with("0x") { | ||
// This is just call data | ||
return hex::decode(proposal.trim_start_matches("0x")).expect("Valid proposal") | ||
} else { | ||
// This is a file path | ||
let contents = fs::read_to_string(proposal).expect("Should give a valid file path"); | ||
return hex::decode(contents.as_str().trim_start_matches("0x")).expect("Valid proposal") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters